diff options
author | Kévin THIERRY <kevin.thierry@open.eurogiciel.org> | 2014-12-23 09:30:24 +0100 |
---|---|---|
committer | Kévin THIERRY <kevin.thierry@open.eurogiciel.org> | 2014-12-23 09:30:24 +0100 |
commit | 317dbdb79761ef65e45c7358cfc7571c6afa54ad (patch) | |
tree | d6e8d59029aea04ca4a0579fb1c19c3e493af78f /Tests/RunCMake | |
parent | 297c63fa65327491a2b50e521b661c5835a19fe4 (diff) | |
download | cmake-317dbdb79761ef65e45c7358cfc7571c6afa54ad.tar.gz cmake-317dbdb79761ef65e45c7358cfc7571c6afa54ad.tar.bz2 cmake-317dbdb79761ef65e45c7358cfc7571c6afa54ad.zip |
Imported Upstream version 2.8.12.2upstream/2.8.12.2sandbox/kevinthierry/upstream
Diffstat (limited to 'Tests/RunCMake')
338 files changed, 1519 insertions, 30 deletions
diff --git a/Tests/RunCMake/CMP0004/CMP0004-NEW.cmake b/Tests/RunCMake/CMP0004/CMP0004-NEW.cmake index 7c61961f5..f42d8e49d 100644 --- a/Tests/RunCMake/CMP0004/CMP0004-NEW.cmake +++ b/Tests/RunCMake/CMP0004/CMP0004-NEW.cmake @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) cmake_policy(SET CMP0004 NEW) diff --git a/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake b/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake index d6ed72c79..3fa58b6b6 100644 --- a/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake +++ b/Tests/RunCMake/CMP0004/CMP0004-OLD.cmake @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) cmake_policy(SET CMP0004 OLD) diff --git a/Tests/RunCMake/CMP0004/CMP0004-policy-genex.cmake b/Tests/RunCMake/CMP0004/CMP0004-policy-genex.cmake index eab680a92..297047662 100644 --- a/Tests/RunCMake/CMP0004/CMP0004-policy-genex.cmake +++ b/Tests/RunCMake/CMP0004/CMP0004-policy-genex.cmake @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) cmake_policy(SET CMP0004 NEW) diff --git a/Tests/RunCMake/CMP0004/CMakeLists.txt b/Tests/RunCMake/CMP0004/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/CMP0004/CMakeLists.txt +++ b/Tests/RunCMake/CMP0004/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0019/CMakeLists.txt b/Tests/RunCMake/CMP0019/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/CMP0019/CMakeLists.txt +++ b/Tests/RunCMake/CMP0019/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake new file mode 100644 index 000000000..b0268c842 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake @@ -0,0 +1,7 @@ +enable_language(CXX) + +add_library(testLib empty_vs6_1.cpp) +add_executable(testExe empty_vs6_2.cpp) +target_link_libraries(testExe testLib) + +export(TARGETS testExe FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NOWARN-exe.cmake") diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake new file mode 100644 index 000000000..57c3ed0d7 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared.cmake @@ -0,0 +1,8 @@ +enable_language(CXX) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +target_link_libraries(bar foo) + +add_executable(zot empty.cpp) +target_link_libraries(zot bar) diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries.cmake new file mode 100644 index 000000000..42c4084a6 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries.cmake @@ -0,0 +1,9 @@ + +enable_language(CXX) + +add_subdirectory(dep1) +add_subdirectory(dep2) +add_subdirectory(dep3) + +add_library(somelib empty.cpp) +target_link_libraries(somelib dep3) diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake new file mode 100644 index 000000000..ad3b8df74 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake @@ -0,0 +1,12 @@ + +project(CMP0022-NOWARN-static) + +add_library(foo STATIC empty_vs6_1.cpp) +add_library(bar STATIC empty_vs6_2.cpp) +add_library(bat STATIC empty_vs6_3.cpp) +target_link_libraries(foo bar) +# The last element here needs to contain a space so that it is a single +# element which is not a valid target name. As bar is a STATIC library, +# this tests that the LINK_ONLY generator expression is not used for +# that element, creating an error. +target_link_libraries(bar bat "-lz -lm") diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt new file mode 100644 index 000000000..6a6a0c782 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt @@ -0,0 +1,19 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link + interface. Run "cmake --help-policy CMP0022" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "bar" has an INTERFACE_LINK_LIBRARIES property. This should be + preferred as the source of the link interface for this library but because + CMP0022 is not set CMake is ignoring the property and using the link + implementation as the link interface instead. + + INTERFACE_LINK_LIBRARIES: + + foo + + Link implementation: + + \(empty\) + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake new file mode 100644 index 000000000..c5d3c29d9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old.cmake @@ -0,0 +1,10 @@ + +project(CMP0022-WARN-empty-old) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) + +set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo) + +add_library(user empty.cpp) +target_link_libraries(user bar) diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt new file mode 100644 index 000000000..1370c5ebe --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-static-stderr.txt @@ -0,0 +1,19 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link + interface. Run "cmake --help-policy CMP0022" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "bar" has an INTERFACE_LINK_LIBRARIES property. This should be + preferred as the source of the link interface for this library but because + CMP0022 is not set CMake is ignoring the property and using the link + implementation as the link interface instead. + + INTERFACE_LINK_LIBRARIES: + + foo + + Link implementation: + + bat + +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake new file mode 100644 index 000000000..b3cb13160 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-static.cmake @@ -0,0 +1,11 @@ + +project(CMP0022-WARN) + +add_library(foo STATIC empty_vs6_1.cpp) +add_library(bar STATIC empty_vs6_2.cpp) +add_library(bat STATIC empty_vs6_3.cpp) +set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo) +set_property(TARGET bar PROPERTY LINK_LIBRARIES bat) + +add_library(user empty.cpp) +target_link_libraries(user bar) diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt new file mode 100644 index 000000000..2f7dfbfb7 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt @@ -0,0 +1,17 @@ +^CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link + interface. Run "cmake --help-policy CMP0022" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from + its LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + bat + +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt new file mode 100644 index 000000000..f6722853a --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll-stderr.txt @@ -0,0 +1,17 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link + interface. Run "cmake --help-policy CMP0022" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "bar" has an INTERFACE_LINK_LIBRARIES property which differs from + its LINK_INTERFACE_LIBRARIES properties. + + INTERFACE_LINK_LIBRARIES: + + foo + + LINK_INTERFACE_LIBRARIES: + + bat + +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake new file mode 100644 index 000000000..11b4e22a9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-tll.cmake @@ -0,0 +1,11 @@ + +project(CMP0022-WARN-tll) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +add_library(bat SHARED empty_vs6_3.cpp) +target_link_libraries(bar LINK_PUBLIC foo) +set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat) + +add_library(user SHARED empty.cpp) +target_link_libraries(user bar) diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake new file mode 100644 index 000000000..fe7e858b7 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake @@ -0,0 +1,16 @@ + +project(CMP0022-WARN) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +add_library(bat SHARED empty_vs6_3.cpp) +set_property(TARGET bar PROPERTY INTERFACE_LINK_LIBRARIES foo) +set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat) + +add_library(user empty.cpp) +target_link_libraries(user bar) + +# Use "bar" again with a different "head" target to check +# that the warning does not appear again. +add_library(user2 empty_vs6_3.cpp) +target_link_libraries(user2 bar) diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake b/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake new file mode 100644 index 000000000..d832faceb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export-exe.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) + +cmake_policy(SET CMP0022 NEW) + +add_library(testLib empty_vs6_1.cpp) +add_executable(testExe empty_vs6_2.cpp) +target_link_libraries(testExe testLib) + +export(TARGETS testExe FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NEW-exe.cmake") diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-result.txt b/Tests/RunCMake/CMP0022/CMP0022-export-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt new file mode 100644 index 000000000..ae7627e1e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CMP0022-export.cmake:11 \(export\): + Target "cmp0022NEW" has policy CMP0022 enabled, but also has old-style + LINK_INTERFACE_LIBRARIES properties populated, but it was exported without + the EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties diff --git a/Tests/RunCMake/CMP0022/CMP0022-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-export.cmake new file mode 100644 index 000000000..06147f39e --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export.cmake @@ -0,0 +1,11 @@ + +project(cmp0022NEW) + +cmake_policy(SET CMP0022 NEW) + +add_library(cmp0022NEW SHARED empty_vs6_1.cpp) +add_library(testLib SHARED empty_vs6_2.cpp) + +set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib) + +export(TARGETS cmp0022NEW testLib FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NEW.cmake") diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt b/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-install-export-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt new file mode 100644 index 000000000..405dd8dc8 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-install-export-stderr.txt @@ -0,0 +1,4 @@ +CMake Error in CMakeLists.txt: + Target "cmp0022NEW" has policy CMP0022 enabled, but also has old-style + LINK_INTERFACE_LIBRARIES properties populated, but it was exported without + the EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties diff --git a/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake new file mode 100644 index 000000000..171febe3a --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-install-export.cmake @@ -0,0 +1,12 @@ + +project(cmp0022NEW) + +cmake_policy(SET CMP0022 NEW) + +add_library(cmp0022NEW SHARED empty_vs6_1.cpp) +add_library(testLib SHARED empty_vs6_2.cpp) + +set_property(TARGET cmp0022NEW APPEND PROPERTY LINK_INTERFACE_LIBRARIES testLib) + +install(TARGETS cmp0022NEW testLib EXPORT exp DESTINATION lib) +install(EXPORT exp FILE expTargets.cmake DESTINATION lib/cmake/exp) diff --git a/Tests/RunCMake/CMP0022/CMakeLists.txt b/Tests/RunCMake/CMP0022/CMakeLists.txt new file mode 100644 index 000000000..72abfc809 --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.11) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake new file mode 100644 index 000000000..2781d2094 --- /dev/null +++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake @@ -0,0 +1,13 @@ +include(RunCMake) + +run_cmake(CMP0022-WARN) +run_cmake(CMP0022-WARN-tll) +run_cmake(CMP0022-WARN-static) +run_cmake(CMP0022-WARN-empty-old) +run_cmake(CMP0022-NOWARN-exe) +run_cmake(CMP0022-NOWARN-shared) +run_cmake(CMP0022-NOWARN-static) +run_cmake(CMP0022-NOWARN-static-link_libraries) +run_cmake(CMP0022-export) +run_cmake(CMP0022-export-exe) +run_cmake(CMP0022-install-export) diff --git a/Tests/RunCMake/CMP0022/dep1/CMakeLists.txt b/Tests/RunCMake/CMP0022/dep1/CMakeLists.txt new file mode 100644 index 000000000..f0a817923 --- /dev/null +++ b/Tests/RunCMake/CMP0022/dep1/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_library(dep1 ../empty_vs6_1.cpp) diff --git a/Tests/RunCMake/CMP0022/dep2/CMakeLists.txt b/Tests/RunCMake/CMP0022/dep2/CMakeLists.txt new file mode 100644 index 000000000..4f90162f8 --- /dev/null +++ b/Tests/RunCMake/CMP0022/dep2/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_library(dep2 ../empty_vs6_2.cpp) diff --git a/Tests/RunCMake/CMP0022/dep3/CMakeLists.txt b/Tests/RunCMake/CMP0022/dep3/CMakeLists.txt new file mode 100644 index 000000000..e85cb5431 --- /dev/null +++ b/Tests/RunCMake/CMP0022/dep3/CMakeLists.txt @@ -0,0 +1,5 @@ + +link_libraries(dep1) + +add_library(dep3 ../empty_vs6_3.cpp) +target_link_libraries(dep3 dep2) diff --git a/Tests/RunCMake/CMP0022/empty.cpp b/Tests/RunCMake/CMP0022/empty.cpp new file mode 100644 index 000000000..bfbbddeb9 --- /dev/null +++ b/Tests/RunCMake/CMP0022/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMP0022/empty_vs6_1.cpp b/Tests/RunCMake/CMP0022/empty_vs6_1.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/CMP0022/empty_vs6_1.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/CMP0022/empty_vs6_2.cpp b/Tests/RunCMake/CMP0022/empty_vs6_2.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/CMP0022/empty_vs6_2.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/CMP0022/empty_vs6_3.cpp b/Tests/RunCMake/CMP0022/empty_vs6_3.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/CMP0022/empty_vs6_3.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/CMP0022/empty_vs6_4.cpp b/Tests/RunCMake/CMP0022/empty_vs6_4.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/CMP0022/empty_vs6_4.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 402c8a980..e45aba378 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -28,7 +28,7 @@ # <SubTest>-stdout.txt = Regex matching expected stdout content # <SubTest>-stderr.txt = Regex matching expected stderr content # <SubTest>-check.cmake = Custom result check -# Note that trailing newlines will be stripped from actual test +# Note that trailing newlines will be stripped from actual and expected test # output before matching against the stdout and stderr expressions. # The code in <SubTest>-check.cmake may use variables # RunCMake_TEST_SOURCE_DIR = Top of test source tree @@ -52,10 +52,12 @@ if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 3) endif() add_RunCMake_test(CMP0019) +add_RunCMake_test(CMP0022) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) endif() +add_RunCMake_test(Configure) add_RunCMake_test(ExternalData) add_RunCMake_test(FPHSA) add_RunCMake_test(GeneratorExpression) @@ -65,24 +67,55 @@ add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) if(NOT WIN32) add_RunCMake_test(PositionIndependentCode) + set(SKIP_VISIBILITY 0) + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.2) + set(SKIP_VISIBILITY 1) + endif() + + if (CMAKE_CXX_COMPILER_ID MATCHES Watcom + OR CMAKE_SYSTEM_NAME MATCHES IRIX64 + OR CMAKE_CXX_COMPILER_ID MATCHES HP + OR CMAKE_CXX_COMPILER_ID MATCHES XL + OR CMAKE_CXX_COMPILER_ID MATCHES SunPro) + set(SKIP_VISIBILITY 1) + endif() + + if (NOT SKIP_VISIBILITY) + add_RunCMake_test(VisibilityPreset) + endif() endif() add_RunCMake_test(CompatibleInterface) +add_RunCMake_test(Syntax) add_RunCMake_test(add_dependencies) add_RunCMake_test(build_command) add_RunCMake_test(find_package) +add_RunCMake_test(get_filename_component) +add_RunCMake_test(if) add_RunCMake_test(include) add_RunCMake_test(include_directories) add_RunCMake_test(list) +add_RunCMake_test(try_compile) +add_RunCMake_test(variable_watch) add_RunCMake_test(CMP0004) +add_RunCMake_test(TargetPolicies) +add_RunCMake_test(alias_targets) find_package(Qt4 QUIET) find_package(Qt5Core QUIET) if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0) add_RunCMake_test(IncompatibleQt) endif() +if (QT4_FOUND) + set(ObsoleteQtMacros_ARGS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) + add_RunCMake_test(ObsoleteQtMacros) +endif() if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]") add_RunCMake_test(include_external_msproject) add_RunCMake_test(SolutionGlobalSections) endif() + +add_RunCMake_test(File_Generate) +add_RunCMake_test(ExportWithoutLanguage) +add_RunCMake_test(target_link_libraries) diff --git a/Tests/RunCMake/CTest/CMakeLists.txt b/Tests/RunCMake/CTest/CMakeLists.txt index f6e84c04d..73e6a785a 100644 --- a/Tests/RunCMake/CTest/CMakeLists.txt +++ b/Tests/RunCMake/CTest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) if(NOT NoProject) project(${RunCMake_TEST} NONE) endif() diff --git a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt index 68dd8d6a1..f452db177 100644 --- a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt +++ b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CompilerChange/CMakeLists.txt b/Tests/RunCMake/CompilerChange/CMakeLists.txt index 3b925188d..b4b30165f 100644 --- a/Tests/RunCMake/CompilerChange/CMakeLists.txt +++ b/Tests/RunCMake/CompilerChange/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) if(NOT RunCMake_TEST) set(RunCMake_TEST "$ENV{RunCMake_TEST}") # needed when cache is deleted endif() diff --git a/Tests/RunCMake/Configure/CMakeLists.txt b/Tests/RunCMake/Configure/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/Configure/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Configure/ErrorLogs-result.txt b/Tests/RunCMake/Configure/ErrorLogs-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Configure/ErrorLogs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Configure/ErrorLogs-stderr.txt b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt new file mode 100644 index 000000000..4eee45dbc --- /dev/null +++ b/Tests/RunCMake/Configure/ErrorLogs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at ErrorLogs.cmake:3 \(message\): + Some error! +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/Configure/ErrorLogs-stdout.txt b/Tests/RunCMake/Configure/ErrorLogs-stdout.txt new file mode 100644 index 000000000..c467b6204 --- /dev/null +++ b/Tests/RunCMake/Configure/ErrorLogs-stdout.txt @@ -0,0 +1,3 @@ +-- Configuring incomplete, errors occurred! +See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeOutput\.log"\. +See also ".*/Tests/RunCMake/Configure/ErrorLogs-build/CMakeFiles/CMakeError\.log"\. diff --git a/Tests/RunCMake/Configure/ErrorLogs.cmake b/Tests/RunCMake/Configure/ErrorLogs.cmake new file mode 100644 index 000000000..e8cf06266 --- /dev/null +++ b/Tests/RunCMake/Configure/ErrorLogs.cmake @@ -0,0 +1,3 @@ +file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Some detailed error information!\n") +message(SEND_ERROR "Some error!") diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake b/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake new file mode 100644 index 000000000..db0cb0a34 --- /dev/null +++ b/Tests/RunCMake/Configure/FailCopyFileABI-check.cmake @@ -0,0 +1,14 @@ +set(log "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/CMakeError.log") +if(EXISTS "${log}") + file(READ "${log}" error_log) +else() + set(error_log "") +endif() +string(REPLACE "\r\n" "\n" regex "Cannot copy output executable.* +to destination specified by COPY_FILE:.* +Unable to find the executable at any of: + .*\\.missing") +if(NOT error_log MATCHES "${regex}") + string(REGEX REPLACE "\n" "\n " error_log " ${error_log}") + set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected COPY_FILE failure message:\n${error_log}") +endif() diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake b/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake new file mode 100644 index 000000000..c633555b6 --- /dev/null +++ b/Tests/RunCMake/Configure/FailCopyFileABI-override.cmake @@ -0,0 +1,6 @@ +# Change the executable suffix that try_compile will use for +# COPY_FILE but not inside the test project. This forces failure. +get_property(in_try_compile GLOBAL PROPERTY IN_TRY_COMPILE) +if(NOT in_try_compile) + set(CMAKE_EXECUTABLE_SUFFIX .missing) +endif() diff --git a/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt new file mode 100644 index 000000000..bb87f4c31 --- /dev/null +++ b/Tests/RunCMake/Configure/FailCopyFileABI-stdout.txt @@ -0,0 +1,4 @@ +-- Detecting C compiler ABI info +-- Detecting C compiler ABI info - failed +-- Configuring done +-- Generating done diff --git a/Tests/RunCMake/Configure/FailCopyFileABI.cmake b/Tests/RunCMake/Configure/FailCopyFileABI.cmake new file mode 100644 index 000000000..74efd9720 --- /dev/null +++ b/Tests/RunCMake/Configure/FailCopyFileABI.cmake @@ -0,0 +1,2 @@ +set(CMAKE_USER_MAKE_RULES_OVERRIDE_C ${CMAKE_CURRENT_SOURCE_DIR}/FailCopyFileABI-override.cmake) +enable_language(C) diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake new file mode 100644 index 000000000..79e4060cc --- /dev/null +++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(ErrorLogs) +run_cmake(FailCopyFileABI) diff --git a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt new file mode 100644 index 000000000..67a0ae37c --- /dev/null +++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: CMake can not determine linker language for target: NoLanguage +CMake Error at NoLanguage.cmake:2 \(export\): + Exporting the target "NoLanguage" is not allowed since its linker language + cannot be determined +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake new file mode 100644 index 000000000..2ede85431 --- /dev/null +++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake @@ -0,0 +1,2 @@ +add_library(NoLanguage header.h) +export(TARGETS NoLanguage FILE "${CMAKE_CURRENT_BINARY_DIR}/export.cmake") diff --git a/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake b/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake new file mode 100644 index 000000000..f77f4eba0 --- /dev/null +++ b/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(NoLanguage) diff --git a/Tests/RunCMake/ExternalData/CMakeLists.txt b/Tests/RunCMake/ExternalData/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/ExternalData/CMakeLists.txt +++ b/Tests/RunCMake/ExternalData/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FPHSA/CMakeLists.txt b/Tests/RunCMake/FPHSA/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/FPHSA/CMakeLists.txt +++ b/Tests/RunCMake/FPHSA/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Generate/BadCondition-result.txt b/Tests/RunCMake/File_Generate/BadCondition-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/BadCondition-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/BadCondition-stderr.txt b/Tests/RunCMake/File_Generate/BadCondition-stderr.txt new file mode 100644 index 000000000..bab836843 --- /dev/null +++ b/Tests/RunCMake/File_Generate/BadCondition-stderr.txt @@ -0,0 +1,3 @@ +CMake Error in CMakeLists.txt: + Evaluation file condition \"\$<1:Bad>\" did not evaluate to valid content. + Got \"Bad\". diff --git a/Tests/RunCMake/File_Generate/BadCondition.cmake b/Tests/RunCMake/File_Generate/BadCondition.cmake new file mode 100644 index 000000000..82ad672ad --- /dev/null +++ b/Tests/RunCMake/File_Generate/BadCondition.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $<1:Bad> +) diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Generate/CommandConflict-result.txt b/Tests/RunCMake/File_Generate/CommandConflict-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CommandConflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt b/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt new file mode 100644 index 000000000..da97ba476 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CommandConflict-stderr.txt @@ -0,0 +1 @@ +CMake Error: File to be generated by multiple different commands: .*CommandConflict-build/output_.*.txt diff --git a/Tests/RunCMake/File_Generate/CommandConflict.cmake b/Tests/RunCMake/File_Generate/CommandConflict.cmake new file mode 100644 index 000000000..d57bc1284 --- /dev/null +++ b/Tests/RunCMake/File_Generate/CommandConflict.cmake @@ -0,0 +1,9 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_$<CONFIGURATION>.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $<CONFIG:$<CONFIGURATION>> +) +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_$<CONFIGURATION>.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $<CONFIG:$<CONFIGURATION>> +) diff --git a/Tests/RunCMake/File_Generate/DebugEvaluate.cmake b/Tests/RunCMake/File_Generate/DebugEvaluate.cmake new file mode 100644 index 000000000..1fa9b62bb --- /dev/null +++ b/Tests/RunCMake/File_Generate/DebugEvaluate.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION $<CONFIG:Debug> +) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt new file mode 100644 index 000000000..9fe39cca6 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition1-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at EmptyCondition1.cmake:2 \(file\): + file Incorrect arguments to GENERATE subcommand. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition1.cmake b/Tests/RunCMake/File_Generate/EmptyCondition1.cmake new file mode 100644 index 000000000..8574a5f7d --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition1.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION +) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt new file mode 100644 index 000000000..73d5f2504 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at EmptyCondition2.cmake:2 \(file\): + file CONDITION of sub-command GENERATE must not be empty if specified. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/File_Generate/EmptyCondition2.cmake b/Tests/RunCMake/File_Generate/EmptyCondition2.cmake new file mode 100644 index 000000000..626bfb4c4 --- /dev/null +++ b/Tests/RunCMake/File_Generate/EmptyCondition2.cmake @@ -0,0 +1,5 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" + CONDITION "" +) diff --git a/Tests/RunCMake/File_Generate/OutputConflict-result.txt b/Tests/RunCMake/File_Generate/OutputConflict-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputConflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt new file mode 100644 index 000000000..dbd39de50 --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputConflict-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Evaluation file to be written multiple times for different configurations + with different content: + + .*output.txt diff --git a/Tests/RunCMake/File_Generate/OutputConflict.cmake b/Tests/RunCMake/File_Generate/OutputConflict.cmake new file mode 100644 index 000000000..7f3e8c7c7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/OutputConflict.cmake @@ -0,0 +1,4 @@ + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output.txt" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" +) diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake new file mode 100644 index 000000000..f07431c0e --- /dev/null +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -0,0 +1,10 @@ +include(RunCMake) + +run_cmake(CommandConflict) +if("${RunCMake_GENERATOR}" MATCHES "Visual Studio" OR "${RunCMake_GENERATOR}" MATCHES "XCode" ) + run_cmake(OutputConflict) +endif() +run_cmake(EmptyCondition1) +run_cmake(EmptyCondition2) +run_cmake(BadCondition) +run_cmake(DebugEvaluate) diff --git a/Tests/RunCMake/File_Generate/input.txt b/Tests/RunCMake/File_Generate/input.txt new file mode 100644 index 000000000..3db429d21 --- /dev/null +++ b/Tests/RunCMake/File_Generate/input.txt @@ -0,0 +1 @@ +Some $<$<CONFIG:Debug>:conflicting> $<$<NOT:$<CONFIG:Debug>>:content> diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject-result.txt b/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject-stderr.txt new file mode 100644 index 000000000..533d38cef --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject-stderr.txt @@ -0,0 +1,26 @@ +CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_FILE:objlib> + + Target "objlib" is not an executable or library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_SONAME_FILE:objlib> + + Target "objlib" is not an executable or library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadTargetTypeObject.cmake:3 \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_LINKER_FILE:objlib> + + Target "objlib" is not an executable or library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject.cmake b/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject.cmake new file mode 100644 index 000000000..c47ee2bec --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadTargetTypeObject.cmake @@ -0,0 +1,7 @@ +enable_language(C) +add_library(objlib OBJECT empty.c) +add_custom_target(check ALL COMMAND echo + $<TARGET_FILE:objlib> + $<TARGET_SONAME_FILE:objlib> + $<TARGET_LINKER_FILE:objlib> + ) diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 62bf29bc9..54d5064ce 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -7,4 +7,5 @@ run_cmake(BadNOT) run_cmake(BadStrEqual) run_cmake(BadZero) run_cmake(BadTargetName) +run_cmake(BadTargetTypeObject) run_cmake(BadInstallPrefix) diff --git a/Tests/RunCMake/GeneratorExpression/empty.c b/Tests/RunCMake/GeneratorExpression/empty.c new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/empty.c diff --git a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt index 68dd8d6a1..f452db177 100644 --- a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt +++ b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Languages/CMakeLists.txt b/Tests/RunCMake/Languages/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/Languages/CMakeLists.txt +++ b/Tests/RunCMake/Languages/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt new file mode 100644 index 000000000..a5d5d5088 --- /dev/null +++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:LINKER_LANGUAGE> + + LINKER_LANGUAGE target property can not be used while evaluating link + libraries diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake new file mode 100644 index 000000000..64f394c11 --- /dev/null +++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake @@ -0,0 +1,4 @@ + +add_library(foo STATIC empty.cpp) +add_library(bar STATIC empty.cpp) +target_link_libraries(foo $<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,anything>:bar>) diff --git a/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt b/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt index 3f93cf86c..983129a21 100644 --- a/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt +++ b/Tests/RunCMake/Languages/NoLangSHARED-stderr.txt @@ -1 +1 @@ -CMake Error: CMake can not determine linker language for target:NoLang +CMake Error: CMake can not determine linker language for target: NoLang diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake index a99548f05..6517a8105 100644 --- a/Tests/RunCMake/Languages/RunCMakeTest.cmake +++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake @@ -1,3 +1,6 @@ include(RunCMake) run_cmake(NoLangSHARED) +run_cmake(LINK_LANGUAGE-genex) +run_cmake(link-libraries-TARGET_FILE-genex) +run_cmake(link-libraries-TARGET_FILE-genex-ok) diff --git a/Tests/RunCMake/Languages/empty.cpp b/Tests/RunCMake/Languages/empty.cpp new file mode 100644 index 000000000..7279c5e0b --- /dev/null +++ b/Tests/RunCMake/Languages/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty(void) +{ + return 0; +} diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake new file mode 100644 index 000000000..f0fd6e5aa --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo SHARED empty.cpp) +add_library(bar SHARED empty.cpp) +target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:bar>,anything>:bar>) diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt new file mode 100644 index 000000000..2d7a3c9d6 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_FILE:foo> + + Expressions which require the linker language may not be used while + evaluating link libraries diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake new file mode 100644 index 000000000..eca73e977 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake @@ -0,0 +1,4 @@ + +add_library(foo SHARED empty.cpp) +add_library(bar SHARED empty.cpp) +target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,anything>:bar>) diff --git a/Tests/RunCMake/ObjectLibrary/CMakeLists.txt b/Tests/RunCMake/ObjectLibrary/CMakeLists.txt index a7f077912..a17c8cd13 100644 --- a/Tests/RunCMake/ObjectLibrary/CMakeLists.txt +++ b/Tests/RunCMake/ObjectLibrary/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} C) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-result.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/MissingSource-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt new file mode 100644 index 000000000..411cd7cb7 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at MissingSource.cmake:1 \(add_library\): + Cannot find source file: + + missing.c + + Tried extensions( \.[A-Za-z+]+| + )* +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource.cmake b/Tests/RunCMake/ObjectLibrary/MissingSource.cmake new file mode 100644 index 000000000..258eaedb2 --- /dev/null +++ b/Tests/RunCMake/ObjectLibrary/MissingSource.cmake @@ -0,0 +1 @@ +add_library(A OBJECT missing.c) diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake index 55db14dfd..2dd8d3859 100644 --- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake +++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake @@ -12,6 +12,7 @@ run_cmake(Install) run_cmake(LinkObjLHS) run_cmake(LinkObjRHS1) run_cmake(LinkObjRHS2) +run_cmake(MissingSource) run_cmake(ObjWithObj) run_cmake(PostBuild) run_cmake(PreBuild) diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-result.txt b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt new file mode 100644 index 000000000..6f7e8ee61 --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN-stderr.txt @@ -0,0 +1,5 @@ +CMake Warning at .*/Modules/Qt4Macros.cmake:[^ ]+ \(message\): + The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead. +Call Stack \(most recent call first\): + AutomocMacro-WARN.cmake:7 \(qt4_automoc\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake new file mode 100644 index 000000000..c0c64a5b7 --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/AutomocMacro-WARN.cmake @@ -0,0 +1,7 @@ + +find_package(Qt4 REQUIRED) + +set(CMAKE_WARN_DEPRECATED 1) + +add_library(foo SHARED empty.cpp) +qt4_automoc(foo_moc_srcs empty.cpp) diff --git a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt new file mode 100644 index 000000000..65ac8e8db --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.11) +project(${RunCMake_TEST}) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake b/Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake new file mode 100644 index 000000000..eee2cc399 --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/RunCMakeTest.cmake @@ -0,0 +1,6 @@ +include(RunCMake) + +set(RunCMake_TEST_OPTIONS -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}) + +run_cmake(UseModulesMacro-WARN) +run_cmake(AutomocMacro-WARN) diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-result.txt b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt new file mode 100644 index 000000000..b90c6651a --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN-stderr.txt @@ -0,0 +1,6 @@ +CMake Warning at .*/Modules/Qt4Macros.cmake:[^ ]+ \(message\): + The qt4_use_modules function is obsolete. Use target_link_libraries with + IMPORTED targets instead. +Call Stack \(most recent call first\): + UseModulesMacro-WARN.cmake:[^ ]+ \(qt4_use_modules\) + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake new file mode 100644 index 000000000..e86a3723b --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/UseModulesMacro-WARN.cmake @@ -0,0 +1,7 @@ + +find_package(Qt4 REQUIRED) + +set(CMAKE_WARN_DEPRECATED 1) + +add_library(foo SHARED empty.cpp) +qt4_use_modules(foo LINK_PRIVATE Core) diff --git a/Tests/RunCMake/ObsoleteQtMacros/empty.cpp b/Tests/RunCMake/ObsoleteQtMacros/empty.cpp new file mode 100644 index 000000000..7279c5e0b --- /dev/null +++ b/Tests/RunCMake/ObsoleteQtMacros/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty(void) +{ + return 0; +} diff --git a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt index 22577da4a..90afc127e 100644 --- a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt +++ b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} CXX) # MSVC creates extra targets which pollute the stderr unless we set this. diff --git a/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt b/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt +++ b/Tests/RunCMake/SolutionGlobalSections/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Syntax/.gitattributes b/Tests/RunCMake/Syntax/.gitattributes new file mode 100644 index 000000000..fc9ebff69 --- /dev/null +++ b/Tests/RunCMake/Syntax/.gitattributes @@ -0,0 +1 @@ +CommandTabs.cmake whitespace=-tab-in-indent diff --git a/Tests/RunCMake/Syntax/BracketWarn-stderr.txt b/Tests/RunCMake/Syntax/BracketWarn-stderr.txt new file mode 100644 index 000000000..4a9cca641 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketWarn-stderr.txt @@ -0,0 +1,35 @@ +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:16 + + A future version of CMake may treat unquoted argument: + + \[\[ + + as an opening long bracket. Double-quote the argument. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:19 + + A future version of CMake may treat unquoted argument: + + \[=\[ + + as an opening long bracket. Double-quote the argument. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/BracketWarn.cmake:1:27 + + A future version of CMake may treat unquoted argument: + + \[==\[x + + as an opening long bracket. Double-quote the argument. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/Syntax/BracketWarn-stdout.txt b/Tests/RunCMake/Syntax/BracketWarn-stdout.txt new file mode 100644 index 000000000..01b2caaa4 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketWarn-stdout.txt @@ -0,0 +1 @@ +-- \[\[\[=\[\[=x\[==\[x diff --git a/Tests/RunCMake/Syntax/BracketWarn.cmake b/Tests/RunCMake/Syntax/BracketWarn.cmake new file mode 100644 index 000000000..8f33946f0 --- /dev/null +++ b/Tests/RunCMake/Syntax/BracketWarn.cmake @@ -0,0 +1 @@ +message(STATUS [[ [=[ [=x [==[x) diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt new file mode 100644 index 000000000..618473aaa --- /dev/null +++ b/Tests/RunCMake/Syntax/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.9) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Syntax/CommandComments-stderr.txt b/Tests/RunCMake/Syntax/CommandComments-stderr.txt new file mode 100644 index 000000000..df72cc5b9 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandComments-stderr.txt @@ -0,0 +1,4 @@ +Example Message +Example Message +Example Message +Second Line of Example diff --git a/Tests/RunCMake/Syntax/CommandComments.cmake b/Tests/RunCMake/Syntax/CommandComments.cmake new file mode 100644 index 000000000..0fd748452 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandComments.cmake @@ -0,0 +1,6 @@ +message("Example Message"#) + ) +message ("Example Message" # ) + ) +message( "Example Message\n" # "Commented" ) + "Second Line of Example") diff --git a/Tests/RunCMake/Syntax/CommandError0-result.txt b/Tests/RunCMake/Syntax/CommandError0-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CommandError0-stderr.txt b/Tests/RunCMake/Syntax/CommandError0-stderr.txt new file mode 100644 index 000000000..24d7997ad --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError0-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: Error in cmake code at +.*/Tests/RunCMake/Syntax/CommandError0.cmake:2: +Parse error. Expected "\(", got newline with text " +". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + CommandError0.cmake diff --git a/Tests/RunCMake/Syntax/CommandError0.cmake b/Tests/RunCMake/Syntax/CommandError0.cmake new file mode 100644 index 000000000..3222a9765 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError0.cmake @@ -0,0 +1,2 @@ +message + ("Example Message") diff --git a/Tests/RunCMake/Syntax/CommandError1-result.txt b/Tests/RunCMake/Syntax/CommandError1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/CommandError1-stderr.txt b/Tests/RunCMake/Syntax/CommandError1-stderr.txt new file mode 100644 index 000000000..599f60021 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError1-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: Error in cmake code at +.*/Tests/RunCMake/Syntax/CommandError1.cmake:1: +Parse error. Expected a newline, got identifier with text "message". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + CommandError1.cmake diff --git a/Tests/RunCMake/Syntax/CommandError1.cmake b/Tests/RunCMake/Syntax/CommandError1.cmake new file mode 100644 index 000000000..f8661a198 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandError1.cmake @@ -0,0 +1 @@ +message("Example Message") message("Second Message") diff --git a/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt b/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt new file mode 100644 index 000000000..571b15227 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandNewlines-stderr.txt @@ -0,0 +1,3 @@ +Example Message +Example Message +Example Message diff --git a/Tests/RunCMake/Syntax/CommandNewlines.cmake b/Tests/RunCMake/Syntax/CommandNewlines.cmake new file mode 100644 index 000000000..0587afb31 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandNewlines.cmake @@ -0,0 +1,10 @@ +message( + "Example Message") +message ( + "Example Message" + ) +message( + + "Example Message" + + ) diff --git a/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt b/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt new file mode 100644 index 000000000..54a8b3864 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandSpaces-stderr.txt @@ -0,0 +1,6 @@ +Example Message +Example Message +Example Message +Example Message +Example Message +Example Message diff --git a/Tests/RunCMake/Syntax/CommandSpaces.cmake b/Tests/RunCMake/Syntax/CommandSpaces.cmake new file mode 100644 index 000000000..5bd42945f --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandSpaces.cmake @@ -0,0 +1,6 @@ +message("Example Message") +message ("Example Message") +message( "Example Message" ) +message( "Example Message") + message ( "Example Message") +message ( Example " " Message ) diff --git a/Tests/RunCMake/Syntax/CommandTabs-stderr.txt b/Tests/RunCMake/Syntax/CommandTabs-stderr.txt new file mode 100644 index 000000000..54a8b3864 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandTabs-stderr.txt @@ -0,0 +1,6 @@ +Example Message +Example Message +Example Message +Example Message +Example Message +Example Message diff --git a/Tests/RunCMake/Syntax/CommandTabs.cmake b/Tests/RunCMake/Syntax/CommandTabs.cmake new file mode 100644 index 000000000..93876f862 --- /dev/null +++ b/Tests/RunCMake/Syntax/CommandTabs.cmake @@ -0,0 +1,6 @@ +message("Example Message") +message ("Example Message") +message( "Example Message" ) +message( "Example Message") + message ( "Example Message") +message ( Example " " Message ) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace-stderr.txt b/Tests/RunCMake/Syntax/ParenNoSpace-stderr.txt new file mode 100644 index 000000000..10f32932e --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/Syntax/ParenNoSpace-stdout.txt b/Tests/RunCMake/Syntax/ParenNoSpace-stdout.txt new file mode 100644 index 000000000..72addd794 --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace-stdout.txt @@ -0,0 +1,2 @@ +-- unquoted\(unquoted\) +-- quoted\(quoted\) diff --git a/Tests/RunCMake/Syntax/ParenNoSpace.cmake b/Tests/RunCMake/Syntax/ParenNoSpace.cmake new file mode 100644 index 000000000..c690d964e --- /dev/null +++ b/Tests/RunCMake/Syntax/ParenNoSpace.cmake @@ -0,0 +1,2 @@ +message(STATUS unquoted(unquoted)) +message(STATUS "quoted"("quoted")) diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake new file mode 100644 index 000000000..94963f348 --- /dev/null +++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake @@ -0,0 +1,18 @@ +include(RunCMake) + +run_cmake(CommandSpaces) +run_cmake(CommandTabs) +run_cmake(CommandNewlines) +run_cmake(CommandComments) +run_cmake(CommandError0) +run_cmake(CommandError1) +run_cmake(String0) +run_cmake(String1) +run_cmake(StringNoSpace) +run_cmake(Unquoted0) +run_cmake(Unquoted1) +run_cmake(ParenNoSpace) +run_cmake(UnterminatedCall1) +run_cmake(UnterminatedCall2) +run_cmake(UnterminatedString) +run_cmake(BracketWarn) diff --git a/Tests/RunCMake/Syntax/String0-stderr.txt b/Tests/RunCMake/Syntax/String0-stderr.txt new file mode 100644 index 000000000..8eea0695c --- /dev/null +++ b/Tests/RunCMake/Syntax/String0-stderr.txt @@ -0,0 +1 @@ +^1 2;3 4$ diff --git a/Tests/RunCMake/Syntax/String0.cmake b/Tests/RunCMake/Syntax/String0.cmake new file mode 100644 index 000000000..95281d73f --- /dev/null +++ b/Tests/RunCMake/Syntax/String0.cmake @@ -0,0 +1,2 @@ +set(var 2 3) +message("1 ${var} 4") diff --git a/Tests/RunCMake/Syntax/String1-stderr.txt b/Tests/RunCMake/Syntax/String1-stderr.txt new file mode 100644 index 000000000..07e98dae0 --- /dev/null +++ b/Tests/RunCMake/Syntax/String1-stderr.txt @@ -0,0 +1,3 @@ +^ + 1 \${var} 4 + $ diff --git a/Tests/RunCMake/Syntax/String1.cmake b/Tests/RunCMake/Syntax/String1.cmake new file mode 100644 index 000000000..a94c9ffdb --- /dev/null +++ b/Tests/RunCMake/Syntax/String1.cmake @@ -0,0 +1,3 @@ +message(" + 1 \${var} 4 + ") diff --git a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt new file mode 100644 index 000000000..89c2d2ae5 --- /dev/null +++ b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt @@ -0,0 +1,19 @@ +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28 + + Argument not separated from preceding token by whitespace. +This warning is for project developers. Use -Wno-dev to suppress it. + +CMake Warning \(dev\) at CMakeLists.txt:3 \(include\): + Syntax Warning in cmake code at + + .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31 + + Argument not separated from preceding token by whitespace. +This warning is for project developers. Use -Wno-dev to suppress it. + +\[1 \${var} \\n 4\] +\[x\] +\[y\]$ diff --git a/Tests/RunCMake/Syntax/StringNoSpace.cmake b/Tests/RunCMake/Syntax/StringNoSpace.cmake new file mode 100644 index 000000000..76f22db9a --- /dev/null +++ b/Tests/RunCMake/Syntax/StringNoSpace.cmake @@ -0,0 +1,4 @@ +# Quoted arguments may be immediately followed by another argument. +foreach(x "1 \${var} \\n 4""x"y) + message("[${x}]") +endforeach() diff --git a/Tests/RunCMake/Syntax/Unquoted0-stderr.txt b/Tests/RunCMake/Syntax/Unquoted0-stderr.txt new file mode 100644 index 000000000..ea68ebfa9 --- /dev/null +++ b/Tests/RunCMake/Syntax/Unquoted0-stderr.txt @@ -0,0 +1 @@ +^1234$ diff --git a/Tests/RunCMake/Syntax/Unquoted0.cmake b/Tests/RunCMake/Syntax/Unquoted0.cmake new file mode 100644 index 000000000..c5314c9f0 --- /dev/null +++ b/Tests/RunCMake/Syntax/Unquoted0.cmake @@ -0,0 +1,2 @@ +set(var 2 3) +message(1 ${var} 4) diff --git a/Tests/RunCMake/Syntax/Unquoted1-stderr.txt b/Tests/RunCMake/Syntax/Unquoted1-stderr.txt new file mode 100644 index 000000000..ff8194a6f --- /dev/null +++ b/Tests/RunCMake/Syntax/Unquoted1-stderr.txt @@ -0,0 +1 @@ +^\[\]\[=\]\[\$\$\(MV\)-DSTR=" \[="\[;\]$ diff --git a/Tests/RunCMake/Syntax/Unquoted1.cmake b/Tests/RunCMake/Syntax/Unquoted1.cmake new file mode 100644 index 000000000..0344fbd59 --- /dev/null +++ b/Tests/RunCMake/Syntax/Unquoted1.cmake @@ -0,0 +1 @@ +message([] [=] [$ $(MV) -DSTR=" [=" [;]) diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1-result.txt b/Tests/RunCMake/Syntax/UnterminatedCall1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedCall1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt new file mode 100644 index 000000000..281ce0da8 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: Error in cmake code at +.*/Syntax/UnterminatedCall1.cmake:2: +Parse error. Function missing ending "\)". End of file reached. +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + UnterminatedCall1.cmake diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1.cmake b/Tests/RunCMake/Syntax/UnterminatedCall1.cmake new file mode 100644 index 000000000..1166109c9 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedCall1.cmake @@ -0,0 +1 @@ +message( diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2-result.txt b/Tests/RunCMake/Syntax/UnterminatedCall2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedCall2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt new file mode 100644 index 000000000..065de30fc --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: Error in cmake code at +.*/Syntax/UnterminatedCall2.cmake:4: +Parse error. Function missing ending "\)". End of file reached. +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + UnterminatedCall2.cmake diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2.cmake b/Tests/RunCMake/Syntax/UnterminatedCall2.cmake new file mode 100644 index 000000000..26e9e6223 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedCall2.cmake @@ -0,0 +1,3 @@ +set(var "\ +") +message( diff --git a/Tests/RunCMake/Syntax/UnterminatedString-result.txt b/Tests/RunCMake/Syntax/UnterminatedString-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedString-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt new file mode 100644 index 000000000..d9250328d --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt @@ -0,0 +1,8 @@ +CMake Error: Error in cmake code at +.*/Syntax/UnterminatedString.cmake:2: +Parse error. Function missing ending "\)". Instead found unterminated string with text "\) +". +CMake Error at CMakeLists.txt:3 \(include\): + include could not find load file: + + UnterminatedString.cmake$ diff --git a/Tests/RunCMake/Syntax/UnterminatedString.cmake b/Tests/RunCMake/Syntax/UnterminatedString.cmake new file mode 100644 index 000000000..721ae7510 --- /dev/null +++ b/Tests/RunCMake/Syntax/UnterminatedString.cmake @@ -0,0 +1 @@ +set(var ") diff --git a/Tests/RunCMake/TargetPolicies/CMakeLists.txt b/Tests/RunCMake/TargetPolicies/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/TargetPolicies/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-result.txt b/Tests/RunCMake/TargetPolicies/PolicyList-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPolicies/PolicyList-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt new file mode 100644 index 000000000..6533b75d8 --- /dev/null +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -0,0 +1,13 @@ + Error evaluating generator expression: + + \$<TARGET_POLICY:NOT_A_POLICY> + + \$<TARGET_POLICY:prop> may only be used with a limited number of policies. + Currently it may be used with the following policies: + + \* CMP0003 + \* CMP0004 + \* CMP0008 + \* CMP0020 + \* CMP0021 + \* CMP0022 diff --git a/Tests/RunCMake/TargetPolicies/PolicyList.cmake b/Tests/RunCMake/TargetPolicies/PolicyList.cmake new file mode 100644 index 000000000..c290b65a6 --- /dev/null +++ b/Tests/RunCMake/TargetPolicies/PolicyList.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(empty empty.cpp) +target_compile_definitions(empty + PRIVATE + $<$<TARGET_POLICY:NOT_A_POLICY>:SOME_DEFINE> +) diff --git a/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake b/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake new file mode 100644 index 000000000..7a9463050 --- /dev/null +++ b/Tests/RunCMake/TargetPolicies/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(PolicyList) diff --git a/Tests/RunCMake/TargetPolicies/empty.cpp b/Tests/RunCMake/TargetPolicies/empty.cpp new file mode 100644 index 000000000..7279c5e0b --- /dev/null +++ b/Tests/RunCMake/TargetPolicies/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty(void) +{ + return 0; +} diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt index 3b3bab07d..3adf73ea0 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt @@ -1,8 +1,8 @@ CMake Error at BadNonTarget.cmake:7 \(include_directories\): Error evaluating generator expression: - \$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES> + \$<TARGET_PROPERTY:NonExistent,INCLUDE_DIRECTORIES> - Target "NonExistant" not found. + Target "NonExistent" not found. Call Stack \(most recent call first\): CMakeLists.txt:8 \(include\)$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake index b020c0821..97d81e9f1 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake @@ -4,4 +4,4 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" add_executable(TargetPropertyGeneratorExpressions "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -include_directories("$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>") +include_directories("$<TARGET_PROPERTY:NonExistent,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt index 22577da4a..90afc127e 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} CXX) # MSVC creates extra targets which pollute the stderr unless we set this. diff --git a/Tests/RunCMake/VisibilityPreset/CMakeLists.txt b/Tests/RunCMake/VisibilityPreset/CMakeLists.txt new file mode 100644 index 000000000..90afc127e --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/CMakeLists.txt @@ -0,0 +1,8 @@ + +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} CXX) + +# MSVC creates extra targets which pollute the stderr unless we set this. +set(CMAKE_SUPPRESS_REGENERATION TRUE) + +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt new file mode 100644 index 000000000..ca8c33f36 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo-stderr.txt @@ -0,0 +1 @@ +CMake Error: Target visibility_preset uses unsupported value \"hiden\" for CXX_VISIBILITY_PRESET diff --git a/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake b/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake new file mode 100644 index 000000000..03c0ed9a2 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/PropertyTypo.cmake @@ -0,0 +1,3 @@ + +add_library(visibility_preset SHARED lib.cpp) +set_property(TARGET visibility_preset PROPERTY CXX_VISIBILITY_PRESET hiden) diff --git a/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake b/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake new file mode 100644 index 000000000..2d7883208 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(PropertyTypo) diff --git a/Tests/RunCMake/VisibilityPreset/lib.cpp b/Tests/RunCMake/VisibilityPreset/lib.cpp new file mode 100644 index 000000000..06b3472f2 --- /dev/null +++ b/Tests/RunCMake/VisibilityPreset/lib.cpp @@ -0,0 +1,5 @@ + +int foo(void) +{ + return 42; +} diff --git a/Tests/RunCMake/add_dependencies/CMakeLists.txt b/Tests/RunCMake/add_dependencies/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/add_dependencies/CMakeLists.txt +++ b/Tests/RunCMake/add_dependencies/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/alias_targets/CMakeLists.txt b/Tests/RunCMake/alias_targets/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/alias_targets/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/alias_targets/RunCMakeTest.cmake b/Tests/RunCMake/alias_targets/RunCMakeTest.cmake new file mode 100644 index 000000000..9a5eaaf1c --- /dev/null +++ b/Tests/RunCMake/alias_targets/RunCMakeTest.cmake @@ -0,0 +1,20 @@ +include(RunCMake) + +run_cmake(no-targets) +run_cmake(multiple-targets) +run_cmake(exclude-from-all) +run_cmake(imported) +run_cmake(invalid-name) +run_cmake(invalid-target) +run_cmake(imported-target) +run_cmake(alias-target) +run_cmake(set_property) +run_cmake(set_target_properties) +run_cmake(target_link_libraries) +run_cmake(target_include_directories) +run_cmake(export) +run_cmake(install-export) +run_cmake(name-conflict) +run_cmake(add_dependencies) +run_cmake(add_executable-library) +run_cmake(add_library-executable) diff --git a/Tests/RunCMake/alias_targets/add_dependencies-result.txt b/Tests/RunCMake/alias_targets/add_dependencies-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_dependencies-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/add_dependencies-stderr.txt b/Tests/RunCMake/alias_targets/add_dependencies-stderr.txt new file mode 100644 index 000000000..53f248741 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_dependencies-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at add_dependencies.cmake:9 \(add_dependencies\): + Cannot add target-level dependencies to alias target "alias". + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/add_dependencies.cmake b/Tests/RunCMake/alias_targets/add_dependencies.cmake new file mode 100644 index 000000000..7436371a2 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_dependencies.cmake @@ -0,0 +1,9 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) +add_library(bar empty.cpp) + +add_library(alias ALIAS foo) + +add_dependencies(alias bar) diff --git a/Tests/RunCMake/alias_targets/add_executable-library-result.txt b/Tests/RunCMake/alias_targets/add_executable-library-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_executable-library-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/add_executable-library-stderr.txt b/Tests/RunCMake/alias_targets/add_executable-library-stderr.txt new file mode 100644 index 000000000..eb22b3dbe --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_executable-library-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at add_executable-library.cmake:6 \(add_executable\): + add_executable cannot create ALIAS target "alias" because target "foo" is + not an executable. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/add_executable-library.cmake b/Tests/RunCMake/alias_targets/add_executable-library.cmake new file mode 100644 index 000000000..e30f112d8 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_executable-library.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_executable(alias ALIAS foo) diff --git a/Tests/RunCMake/alias_targets/add_library-executable-result.txt b/Tests/RunCMake/alias_targets/add_library-executable-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_library-executable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/add_library-executable-stderr.txt b/Tests/RunCMake/alias_targets/add_library-executable-stderr.txt new file mode 100644 index 000000000..ee290e441 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_library-executable-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at add_library-executable.cmake:6 \(add_library\): + add_library cannot create ALIAS target "alias" because target "foo" is not + a library. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/add_library-executable.cmake b/Tests/RunCMake/alias_targets/add_library-executable.cmake new file mode 100644 index 000000000..22457a9b7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/add_library-executable.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_executable(foo empty.cpp) + +add_library(alias ALIAS foo) diff --git a/Tests/RunCMake/alias_targets/alias-target-result.txt b/Tests/RunCMake/alias_targets/alias-target-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/alias-target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/alias-target-stderr.txt b/Tests/RunCMake/alias_targets/alias-target-stderr.txt new file mode 100644 index 000000000..eae227a25 --- /dev/null +++ b/Tests/RunCMake/alias_targets/alias-target-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at alias-target.cmake:8 \(add_library\): + add_library cannot create ALIAS target "next_alias" because target "alias" + is itself an ALIAS. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/alias-target.cmake b/Tests/RunCMake/alias_targets/alias-target.cmake new file mode 100644 index 000000000..0b8da6014 --- /dev/null +++ b/Tests/RunCMake/alias_targets/alias-target.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS foo) + +add_library(next_alias ALIAS alias) diff --git a/Tests/RunCMake/alias_targets/empty.cpp b/Tests/RunCMake/alias_targets/empty.cpp new file mode 100644 index 000000000..bfbbddeb9 --- /dev/null +++ b/Tests/RunCMake/alias_targets/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/alias_targets/exclude-from-all-result.txt b/Tests/RunCMake/alias_targets/exclude-from-all-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/exclude-from-all-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/exclude-from-all-stderr.txt b/Tests/RunCMake/alias_targets/exclude-from-all-stderr.txt new file mode 100644 index 000000000..fce15d384 --- /dev/null +++ b/Tests/RunCMake/alias_targets/exclude-from-all-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at exclude-from-all.cmake:6 \(add_library\): + add_library EXCLUDE_FROM_ALL with ALIAS makes no sense. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/exclude-from-all.cmake b/Tests/RunCMake/alias_targets/exclude-from-all.cmake new file mode 100644 index 000000000..0091918fe --- /dev/null +++ b/Tests/RunCMake/alias_targets/exclude-from-all.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS EXCLUDE_FROM_ALL foo) diff --git a/Tests/RunCMake/alias_targets/export-result.txt b/Tests/RunCMake/alias_targets/export-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/export-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/export-stderr.txt b/Tests/RunCMake/alias_targets/export-stderr.txt new file mode 100644 index 000000000..848b9840c --- /dev/null +++ b/Tests/RunCMake/alias_targets/export-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at export.cmake:8 \(export\): + export given ALIAS target "alias" which may not be exported. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/export.cmake b/Tests/RunCMake/alias_targets/export.cmake new file mode 100644 index 000000000..dd84a80da --- /dev/null +++ b/Tests/RunCMake/alias_targets/export.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS foo) + +export(TARGETS alias FILE someFile.cmake) diff --git a/Tests/RunCMake/alias_targets/imported-result.txt b/Tests/RunCMake/alias_targets/imported-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/imported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/imported-stderr.txt b/Tests/RunCMake/alias_targets/imported-stderr.txt new file mode 100644 index 000000000..b905847f2 --- /dev/null +++ b/Tests/RunCMake/alias_targets/imported-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at imported.cmake:2 \(add_library\): + add_library IMPORTED with ALIAS is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/imported-target-result.txt b/Tests/RunCMake/alias_targets/imported-target-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/imported-target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/imported-target-stderr.txt b/Tests/RunCMake/alias_targets/imported-target-stderr.txt new file mode 100644 index 000000000..bbff29a80 --- /dev/null +++ b/Tests/RunCMake/alias_targets/imported-target-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at imported-target.cmake:6 \(add_library\): + add_library cannot create ALIAS target "alias" because target "foo" is + IMPORTED. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/imported-target.cmake b/Tests/RunCMake/alias_targets/imported-target.cmake new file mode 100644 index 000000000..7259ab091 --- /dev/null +++ b/Tests/RunCMake/alias_targets/imported-target.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo SHARED IMPORTED) + +add_library(alias ALIAS foo) diff --git a/Tests/RunCMake/alias_targets/imported.cmake b/Tests/RunCMake/alias_targets/imported.cmake new file mode 100644 index 000000000..6a605911a --- /dev/null +++ b/Tests/RunCMake/alias_targets/imported.cmake @@ -0,0 +1,2 @@ + +add_library(alias IMPORTED ALIAS) diff --git a/Tests/RunCMake/alias_targets/install-export-result.txt b/Tests/RunCMake/alias_targets/install-export-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/install-export-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/install-export-stderr.txt b/Tests/RunCMake/alias_targets/install-export-stderr.txt new file mode 100644 index 000000000..3c3c0edd6 --- /dev/null +++ b/Tests/RunCMake/alias_targets/install-export-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at install-export.cmake:8 \(install\): + install TARGETS given target "alias" which is an alias. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/install-export.cmake b/Tests/RunCMake/alias_targets/install-export.cmake new file mode 100644 index 000000000..b1c6a4f4d --- /dev/null +++ b/Tests/RunCMake/alias_targets/install-export.cmake @@ -0,0 +1,9 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS foo) + +install(TARGETS alias EXPORT theTargets DESTINATION prefix) +install(EXPORT theTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/alias_targets/invalid-name-result.txt b/Tests/RunCMake/alias_targets/invalid-name-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/invalid-name-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/invalid-name-stderr.txt b/Tests/RunCMake/alias_targets/invalid-name-stderr.txt new file mode 100644 index 000000000..d33b57c10 --- /dev/null +++ b/Tests/RunCMake/alias_targets/invalid-name-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at invalid-name.cmake:6 \(add_library\): + add_library Invalid name for ALIAS: invalid\$name +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/invalid-name.cmake b/Tests/RunCMake/alias_targets/invalid-name.cmake new file mode 100644 index 000000000..bbd39e3b6 --- /dev/null +++ b/Tests/RunCMake/alias_targets/invalid-name.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(invalid$name ALIAS foo) diff --git a/Tests/RunCMake/alias_targets/invalid-target-result.txt b/Tests/RunCMake/alias_targets/invalid-target-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/invalid-target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/invalid-target-stderr.txt b/Tests/RunCMake/alias_targets/invalid-target-stderr.txt new file mode 100644 index 000000000..342d488b9 --- /dev/null +++ b/Tests/RunCMake/alias_targets/invalid-target-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at invalid-target.cmake:2 \(add_library\): + add_library cannot create ALIAS target "alias" because target "foo" does + not already exist. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/invalid-target.cmake b/Tests/RunCMake/alias_targets/invalid-target.cmake new file mode 100644 index 000000000..c43da6162 --- /dev/null +++ b/Tests/RunCMake/alias_targets/invalid-target.cmake @@ -0,0 +1,2 @@ + +add_library(alias ALIAS foo) diff --git a/Tests/RunCMake/alias_targets/multiple-targets-result.txt b/Tests/RunCMake/alias_targets/multiple-targets-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/multiple-targets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/multiple-targets-stderr.txt b/Tests/RunCMake/alias_targets/multiple-targets-stderr.txt new file mode 100644 index 000000000..596f404e4 --- /dev/null +++ b/Tests/RunCMake/alias_targets/multiple-targets-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at multiple-targets.cmake:7 \(add_library\): + add_library ALIAS requires exactly one target argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/multiple-targets.cmake b/Tests/RunCMake/alias_targets/multiple-targets.cmake new file mode 100644 index 000000000..811eb7a53 --- /dev/null +++ b/Tests/RunCMake/alias_targets/multiple-targets.cmake @@ -0,0 +1,7 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) +add_library(bar empty.cpp) + +add_library(alias ALIAS foo bar) diff --git a/Tests/RunCMake/alias_targets/name-conflict-result.txt b/Tests/RunCMake/alias_targets/name-conflict-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/name-conflict-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/name-conflict-stderr.txt b/Tests/RunCMake/alias_targets/name-conflict-stderr.txt new file mode 100644 index 000000000..3c0faa9df --- /dev/null +++ b/Tests/RunCMake/alias_targets/name-conflict-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at name-conflict.cmake:8 \(add_library\): + add_library cannot create target "bar" because an alias with the same name + already exists. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/name-conflict.cmake b/Tests/RunCMake/alias_targets/name-conflict.cmake new file mode 100644 index 000000000..d21a09248 --- /dev/null +++ b/Tests/RunCMake/alias_targets/name-conflict.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(bar ALIAS foo) + +add_library(bar empty.cpp) diff --git a/Tests/RunCMake/alias_targets/no-targets-result.txt b/Tests/RunCMake/alias_targets/no-targets-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/no-targets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/no-targets-stderr.txt b/Tests/RunCMake/alias_targets/no-targets-stderr.txt new file mode 100644 index 000000000..cdf7e577c --- /dev/null +++ b/Tests/RunCMake/alias_targets/no-targets-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at no-targets.cmake:4 \(add_library\): + add_library ALIAS requires exactly one target argument. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/no-targets.cmake b/Tests/RunCMake/alias_targets/no-targets.cmake new file mode 100644 index 000000000..a5c5ee501 --- /dev/null +++ b/Tests/RunCMake/alias_targets/no-targets.cmake @@ -0,0 +1,4 @@ + +enable_language(CXX) + +add_library(alias ALIAS) diff --git a/Tests/RunCMake/alias_targets/set_property-result.txt b/Tests/RunCMake/alias_targets/set_property-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/set_property-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/set_property-stderr.txt b/Tests/RunCMake/alias_targets/set_property-stderr.txt new file mode 100644 index 000000000..e85aa568c --- /dev/null +++ b/Tests/RunCMake/alias_targets/set_property-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at set_property.cmake:8 \(set_property\): + set_property can not be used on an ALIAS target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/set_property.cmake b/Tests/RunCMake/alias_targets/set_property.cmake new file mode 100644 index 000000000..1f5e475c4 --- /dev/null +++ b/Tests/RunCMake/alias_targets/set_property.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS foo) + +set_property(TARGET alias PROPERTY ANYTHING 1) diff --git a/Tests/RunCMake/alias_targets/set_target_properties-result.txt b/Tests/RunCMake/alias_targets/set_target_properties-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/set_target_properties-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/set_target_properties-stderr.txt b/Tests/RunCMake/alias_targets/set_target_properties-stderr.txt new file mode 100644 index 000000000..8922c0d3e --- /dev/null +++ b/Tests/RunCMake/alias_targets/set_target_properties-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at set_target_properties.cmake:8 \(set_target_properties\): + set_target_properties can not be used on an ALIAS target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/set_target_properties.cmake b/Tests/RunCMake/alias_targets/set_target_properties.cmake new file mode 100644 index 000000000..ee44d4595 --- /dev/null +++ b/Tests/RunCMake/alias_targets/set_target_properties.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS foo) + +set_target_properties(alias PROPERTIES ANYTHING 1) diff --git a/Tests/RunCMake/alias_targets/target_include_directories-result.txt b/Tests/RunCMake/alias_targets/target_include_directories-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/target_include_directories-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/target_include_directories-stderr.txt b/Tests/RunCMake/alias_targets/target_include_directories-stderr.txt new file mode 100644 index 000000000..b8903b245 --- /dev/null +++ b/Tests/RunCMake/alias_targets/target_include_directories-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at target_include_directories.cmake:8 \(target_include_directories\): + target_include_directories can not be used on an ALIAS target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/target_include_directories.cmake b/Tests/RunCMake/alias_targets/target_include_directories.cmake new file mode 100644 index 000000000..c26830e11 --- /dev/null +++ b/Tests/RunCMake/alias_targets/target_include_directories.cmake @@ -0,0 +1,8 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) + +add_library(alias ALIAS foo) + +target_include_directories(alias PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) diff --git a/Tests/RunCMake/alias_targets/target_link_libraries-result.txt b/Tests/RunCMake/alias_targets/target_link_libraries-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/alias_targets/target_link_libraries-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/alias_targets/target_link_libraries-stderr.txt b/Tests/RunCMake/alias_targets/target_link_libraries-stderr.txt new file mode 100644 index 000000000..2d7ff20da --- /dev/null +++ b/Tests/RunCMake/alias_targets/target_link_libraries-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at target_link_libraries.cmake:9 \(target_link_libraries\): + target_link_libraries can not be used on an ALIAS target. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/alias_targets/target_link_libraries.cmake b/Tests/RunCMake/alias_targets/target_link_libraries.cmake new file mode 100644 index 000000000..b7b9e6018 --- /dev/null +++ b/Tests/RunCMake/alias_targets/target_link_libraries.cmake @@ -0,0 +1,9 @@ + +enable_language(CXX) + +add_library(foo empty.cpp) +add_library(bar empty.cpp) + +add_library(alias ALIAS foo) + +target_link_libraries(alias bar) diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt index f6e84c04d..73e6a785a 100644 --- a/Tests/RunCMake/build_command/CMakeLists.txt +++ b/Tests/RunCMake/build_command/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) if(NOT NoProject) project(${RunCMake_TEST} NONE) endif() diff --git a/Tests/RunCMake/find_package/CMakeLists.txt b/Tests/RunCMake/find_package/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/find_package/CMakeLists.txt +++ b/Tests/RunCMake/find_package/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_filename_component/CMakeLists.txt b/Tests/RunCMake/get_filename_component/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake new file mode 100644 index 000000000..9d7cf9079 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake @@ -0,0 +1,38 @@ +macro(check desc actual expect) + if(NOT "x${actual}" STREQUAL "x${expect}") + message(SEND_ERROR "${desc}: got \"${actual}\", not \"${expect}\"") + endif() +endmacro() + +set(filename "/path/to/filename.ext.in") +set(expect_DIRECTORY "/path/to") +set(expect_NAME "filename.ext.in") +set(expect_EXT ".ext.in") +set(expect_NAME_WE "filename") +set(expect_PATH "/path/to") +foreach(c DIRECTORY NAME EXT NAME_WE PATH) + get_filename_component(actual_${c} "${filename}" ${c}) + check("${c}" "${actual_${c}}" "${expect_${c}}") +endforeach() + +get_filename_component(test_slashes "c:\\path\\to\\filename.ext.in" DIRECTORY) +check("DIRECTORY from backslashes" "${test_slashes}" "c:/path/to") + +get_filename_component(test_winroot "c:\\filename.ext.in" DIRECTORY) +check("DIRECTORY in windows root" "${test_winroot}" "c:/") + +get_filename_component(test_absolute "/path/to/a/../filename.ext.in" ABSOLUTE) +check("ABSOLUTE" "${test_absolute}" "/path/to/filename.ext.in") + +get_filename_component(test_absolute "/../path/to/filename.ext.in" ABSOLUTE) +check("ABSOLUTE .. in root" "${test_absolute}" "/path/to/filename.ext.in") +get_filename_component(test_absolute "c:/../path/to/filename.ext.in" ABSOLUTE) +check("ABSOLUTE .. in windows root" "${test_absolute}" "c:/path/to/filename.ext.in") + +get_filename_component(test_cache "/path/to/filename.ext.in" DIRECTORY CACHE) +check("CACHE 1" "${test_cache}" "/path/to") +get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE) +check("CACHE 2" "${test_cache}" "/path/to") +unset(test_cache CACHE) +get_filename_component(test_cache "/path/to/other/filename.ext.in" DIRECTORY CACHE) +check("CACHE 3" "${test_cache}" "/path/to/other") diff --git a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake new file mode 100644 index 000000000..156fc8f3c --- /dev/null +++ b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(KnownComponents) +run_cmake(UnknownComponent) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-result.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt new file mode 100644 index 000000000..b146e5b4b --- /dev/null +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): + get_filename_component unknown component BOGUS +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake new file mode 100644 index 000000000..06abc51e6 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake @@ -0,0 +1 @@ +get_filename_component(var "/path/to/filename.ext.in" BOGUS) diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/if/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/if/IsDirectory-stdout.txt b/Tests/RunCMake/if/IsDirectory-stdout.txt new file mode 100644 index 000000000..b89446a65 --- /dev/null +++ b/Tests/RunCMake/if/IsDirectory-stdout.txt @@ -0,0 +1 @@ +CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash diff --git a/Tests/RunCMake/if/IsDirectory.cmake b/Tests/RunCMake/if/IsDirectory.cmake new file mode 100644 index 000000000..23d126dd4 --- /dev/null +++ b/Tests/RunCMake/if/IsDirectory.cmake @@ -0,0 +1,5 @@ +if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/") + message(STATUS "CMAKE_CURRENT_SOURCE_DIR exists, tested with trailing slash") +else() + message(FATAL_ERROR "CMAKE_CURRENT_SOURCE_DIR does not exist!") +endif() diff --git a/Tests/RunCMake/if/IsDirectoryLong-stdout.txt b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt new file mode 100644 index 000000000..5e6275429 --- /dev/null +++ b/Tests/RunCMake/if/IsDirectoryLong-stdout.txt @@ -0,0 +1 @@ +Directory path with length 94208 correctly does not exist. diff --git a/Tests/RunCMake/if/IsDirectoryLong.cmake b/Tests/RunCMake/if/IsDirectoryLong.cmake new file mode 100644 index 000000000..0e93be744 --- /dev/null +++ b/Tests/RunCMake/if/IsDirectoryLong.cmake @@ -0,0 +1,10 @@ +set(d "/long/path/to/directory") +foreach(i RANGE 11) + set(d "${d}${d}") +endforeach() +string(LENGTH "${d}" dl) +if(IS_DIRECTORY "${d}/") + message(FATAL_ERROR "Directory should not exist!") +else() + message(STATUS "Directory path with length ${dl} correctly does not exist.") +endif() diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake new file mode 100644 index 000000000..6b6b74b54 --- /dev/null +++ b/Tests/RunCMake/if/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(IsDirectory) +run_cmake(IsDirectoryLong) diff --git a/Tests/RunCMake/include/CMakeLists.txt b/Tests/RunCMake/include/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/include/CMakeLists.txt +++ b/Tests/RunCMake/include/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_directories/CMP0021-result.txt b/Tests/RunCMake/include_directories/CMP0021-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/CMP0021-stderr.txt b/Tests/RunCMake/include_directories/CMP0021-stderr.txt new file mode 100644 index 000000000..c0781e7cf --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021-stderr.txt @@ -0,0 +1,4 @@ +CMake Error in CMakeLists.txt: + Found relative path while evaluating include directories of "userTarget": + + "foo" diff --git a/Tests/RunCMake/include_directories/CMP0021.cmake b/Tests/RunCMake/include_directories/CMP0021.cmake new file mode 100644 index 000000000..f18666b07 --- /dev/null +++ b/Tests/RunCMake/include_directories/CMP0021.cmake @@ -0,0 +1,9 @@ +enable_language(CXX) + +cmake_policy(SET CMP0021 NEW) + +add_library(testTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") +set_property(TARGET testTarget PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<1:foo>") + +add_library(userTarget "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp") +target_include_directories(userTarget PRIVATE $<TARGET_PROPERTY:testTarget,INTERFACE_INCLUDE_DIRECTORIES>) diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/include_directories/CMakeLists.txt +++ b/Tests/RunCMake/include_directories/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt index 63aec9052..71e6456f3 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt +++ b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt @@ -42,3 +42,12 @@ CMake Debug Log at DebugIncludes.cmake:30 \(target_link_libraries\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) ++ +CMake Debug Log at DebugIncludes.cmake:55 \(set_property\): + Used includes for target lll: + + \* .*/Tests/RunCMake/include_directories/nine + \* .*/Tests/RunCMake/include_directories/ten + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/include_directories/DebugIncludes.cmake b/Tests/RunCMake/include_directories/DebugIncludes.cmake index de3689956..bbc9e4602 100644 --- a/Tests/RunCMake/include_directories/DebugIncludes.cmake +++ b/Tests/RunCMake/include_directories/DebugIncludes.cmake @@ -45,3 +45,11 @@ function(some_function) endfunction() some_function() + +add_library(bar "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp") +target_include_directories(bar + INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/nine" + "${CMAKE_CURRENT_SOURCE_DIR}/ten" +) +set_property(TARGET lll APPEND PROPERTY LINK_LIBRARIES bar) diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index f5160860d..f0704f462 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -8,3 +8,5 @@ run_cmake(BinaryDirectoryInInterface) run_cmake(RelativePathInInterface) run_cmake(ImportedTarget) run_cmake(RelativePathInGenex) +run_cmake(CMP0021) +run_cmake(install_config) diff --git a/Tests/RunCMake/include_directories/install_config-result.txt b/Tests/RunCMake/include_directories/install_config-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/include_directories/install_config-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/install_config-stderr.txt b/Tests/RunCMake/include_directories/install_config-stderr.txt new file mode 100644 index 000000000..ac7b7b0ec --- /dev/null +++ b/Tests/RunCMake/include_directories/install_config-stderr.txt @@ -0,0 +1,5 @@ +CMake Error in CMakeLists.txt: + Target "foo" is installed with INCLUDES DESTINATION set to a context + sensitive path. Paths which depend on the configuration, policy values or + the link interface are not supported. Consider using + target_include_directories instead. diff --git a/Tests/RunCMake/include_directories/install_config.cmake b/Tests/RunCMake/include_directories/install_config.cmake new file mode 100644 index 000000000..46c626c70 --- /dev/null +++ b/Tests/RunCMake/include_directories/install_config.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_executable(foo empty.cpp) +install(TARGETS foo EXPORT fooTargets DESTINATION . INCLUDES DESTINATION include/$<CONFIGURATION>) +install(EXPORT fooTargets DESTINATION lib/cmake) diff --git a/Tests/RunCMake/include_external_msproject/CMakeLists.txt b/Tests/RunCMake/include_external_msproject/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/include_external_msproject/CMakeLists.txt +++ b/Tests/RunCMake/include_external_msproject/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/list/CMakeLists.txt b/Tests/RunCMake/list/CMakeLists.txt index e8db6b05b..12cd3c775 100644 --- a/Tests/RunCMake/list/CMakeLists.txt +++ b/Tests/RunCMake/list/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.4) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-result.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt new file mode 100644 index 000000000..d27686d4b --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt @@ -0,0 +1,16 @@ +CMake Error at CMP0023-NEW-2.cmake:11 \(target_link_libraries\): + Policy CMP0023 is not set: Plain and keyword target_link_libraries + signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The plain signature for target_link_libraries has already been used with + the target "foo". All uses of target_link_libraries with a target must be + either all-keyword or all-plain. + + The uses of the plain signature are here: + + \* CMP0023-NEW-2.cmake:10 \(target_link_libraries\) + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake new file mode 100644 index 000000000..f8b354690 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2.cmake @@ -0,0 +1,11 @@ + +project(CMP0022-WARN) + +cmake_policy(SET CMP0023 NEW) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +add_library(bat SHARED empty_vs6_3.cpp) + +target_link_libraries(foo bar) +target_link_libraries(foo LINK_PRIVATE bat) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-result.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt new file mode 100644 index 000000000..d7be0ff38 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt @@ -0,0 +1,16 @@ +CMake Error at CMP0023-NEW.cmake:11 \(target_link_libraries\): + Policy CMP0023 is not set: Plain and keyword target_link_libraries + signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The plain signature for target_link_libraries has already been used with + the target "foo". All uses of target_link_libraries with a target must be + either all-keyword or all-plain. + + The uses of the plain signature are here: + + \* CMP0023-NEW.cmake:10 \(target_link_libraries\) + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake new file mode 100644 index 000000000..f0aa63fbd --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW.cmake @@ -0,0 +1,11 @@ + +project(CMP0022-WARN) + +cmake_policy(SET CMP0023 NEW) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +add_library(bat SHARED empty_vs6_3.cpp) + +target_link_libraries(foo bar) +target_link_libraries(foo PRIVATE bat) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt new file mode 100644 index 000000000..514786154 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt @@ -0,0 +1,16 @@ +CMake Warning \(dev\) at CMP0023-WARN-2.cmake:9 \(target_link_libraries\): + Policy CMP0023 is not set: Plain and keyword target_link_libraries + signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The plain signature for target_link_libraries has already been used with + the target "foo". All uses of target_link_libraries with a target should + be either all-keyword or all-plain. + + The uses of the plain signature are here: + + \* CMP0023-WARN-2.cmake:8 \(target_link_libraries\) + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake new file mode 100644 index 000000000..2e9cba82c --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake @@ -0,0 +1,9 @@ + +project(CMP0022-WARN) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +add_library(bat SHARED empty_vs6_3.cpp) + +target_link_libraries(foo bar) +target_link_libraries(foo LINK_PRIVATE bat) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt new file mode 100644 index 000000000..a7474fac9 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt @@ -0,0 +1,16 @@ +CMake Warning \(dev\) at CMP0023-WARN.cmake:9 \(target_link_libraries\): + Policy CMP0023 is not set: Plain and keyword target_link_libraries + signatures cannot be mixed. Run "cmake --help-policy CMP0023" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The plain signature for target_link_libraries has already been used with + the target "foo". All uses of target_link_libraries with a target should + be either all-keyword or all-plain. + + The uses of the plain signature are here: + + \* CMP0023-WARN.cmake:8 \(target_link_libraries\) + +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake new file mode 100644 index 000000000..fcc8da03e --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake @@ -0,0 +1,9 @@ + +project(CMP0022-WARN) + +add_library(foo SHARED empty_vs6_1.cpp) +add_library(bar SHARED empty_vs6_2.cpp) +add_library(bat SHARED empty_vs6_3.cpp) + +target_link_libraries(foo bar) +target_link_libraries(foo PRIVATE bat) diff --git a/Tests/RunCMake/target_link_libraries/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/target_link_libraries/MixedSignature-result.txt b/Tests/RunCMake/target_link_libraries/MixedSignature-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/MixedSignature-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt new file mode 100644 index 000000000..a0c66dbe2 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at MixedSignature.cmake:6 \(target_link_libraries\): + The PUBLIC or PRIVATE option must appear as the second argument, just after + the target name. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/target_link_libraries/MixedSignature.cmake b/Tests/RunCMake/target_link_libraries/MixedSignature.cmake new file mode 100644 index 000000000..fa7068584 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/MixedSignature.cmake @@ -0,0 +1,6 @@ + +add_library(foo empty_vs6_1.cpp) +add_library(bar empty_vs6_2.cpp) +add_library(bat empty_vs6_3.cpp) + +target_link_libraries(foo LINK_PUBLIC bar PRIVATE bat) diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake new file mode 100644 index 000000000..f97022e1b --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(CMP0023-WARN) +run_cmake(CMP0023-NEW) +run_cmake(CMP0023-WARN-2) +run_cmake(CMP0023-NEW-2) +run_cmake(MixedSignature) +run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses) diff --git a/Tests/RunCMake/target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses-result.txt b/Tests/RunCMake/target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses-result.txt new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses.cmake b/Tests/RunCMake/target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses.cmake new file mode 100644 index 000000000..e32891d6d --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/Separate-PRIVATE-LINK_PRIVATE-uses.cmake @@ -0,0 +1,9 @@ + +enable_language(CXX) + +add_library(foo empty_vs6_1.cpp) +add_library(bar empty_vs6_2.cpp) +add_library(bat empty_vs6_3.cpp) + +target_link_libraries(foo LINK_PRIVATE bar) +target_link_libraries(foo PRIVATE bat) diff --git a/Tests/RunCMake/target_link_libraries/empty.cpp b/Tests/RunCMake/target_link_libraries/empty.cpp new file mode 100644 index 000000000..bfbbddeb9 --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/target_link_libraries/empty_vs6_1.cpp b/Tests/RunCMake/target_link_libraries/empty_vs6_1.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/empty_vs6_1.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/target_link_libraries/empty_vs6_2.cpp b/Tests/RunCMake/target_link_libraries/empty_vs6_2.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/empty_vs6_2.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/target_link_libraries/empty_vs6_3.cpp b/Tests/RunCMake/target_link_libraries/empty_vs6_3.cpp new file mode 100644 index 000000000..7efedabfa --- /dev/null +++ b/Tests/RunCMake/target_link_libraries/empty_vs6_3.cpp @@ -0,0 +1 @@ +#include "empty.cpp" diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt b/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadLinkLibraries-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt new file mode 100644 index 000000000..eceffecc8 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadLinkLibraries-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at BadLinkLibraries.cmake:2 \(try_compile\): + Only libraries may be used as try_compile IMPORTED LINK_LIBRARIES. Got + not_a_library of type UTILITY. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/BadLinkLibraries.cmake b/Tests/RunCMake/try_compile/BadLinkLibraries.cmake new file mode 100644 index 000000000..e8b5add87 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadLinkLibraries.cmake @@ -0,0 +1,3 @@ +add_custom_target(not_a_library) +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + LINK_LIBRARIES not_a_library) diff --git a/Tests/RunCMake/try_compile/BadSources1-result.txt b/Tests/RunCMake/try_compile/BadSources1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadSources1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/BadSources1-stderr.txt b/Tests/RunCMake/try_compile/BadSources1-stderr.txt new file mode 100644 index 000000000..864a2942c --- /dev/null +++ b/Tests/RunCMake/try_compile/BadSources1-stderr.txt @@ -0,0 +1,12 @@ +CMake Error at BadSources1.cmake:1 \(try_compile\): + Unknown extension ".c" for file + + .*/Tests/RunCMake/try_compile/src.c + + try_compile\(\) works only for enabled languages. Currently these are: + + NONE + + See project\(\) command to enable other languages. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/BadSources1.cmake b/Tests/RunCMake/try_compile/BadSources1.cmake new file mode 100644 index 000000000..aa4dc5ee5 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadSources1.cmake @@ -0,0 +1 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.c) diff --git a/Tests/RunCMake/try_compile/BadSources2-result.txt b/Tests/RunCMake/try_compile/BadSources2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadSources2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/BadSources2-stderr.txt b/Tests/RunCMake/try_compile/BadSources2-stderr.txt new file mode 100644 index 000000000..3313f9933 --- /dev/null +++ b/Tests/RunCMake/try_compile/BadSources2-stderr.txt @@ -0,0 +1,12 @@ +CMake Error at BadSources2.cmake:2 \(try_compile\): + Unknown extension ".cxx" for file + + .*/Tests/RunCMake/try_compile/src.cxx + + try_compile\(\) works only for enabled languages. Currently these are: + + C NONE( RC)? + + See project\(\) command to enable other languages. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/BadSources2.cmake b/Tests/RunCMake/try_compile/BadSources2.cmake new file mode 100644 index 000000000..ed2b0364d --- /dev/null +++ b/Tests/RunCMake/try_compile/BadSources2.cmake @@ -0,0 +1,5 @@ +enable_language(C) +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} + SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.c + ${CMAKE_CURRENT_SOURCE_DIR}/src.cxx + ) diff --git a/Tests/RunCMake/try_compile/CMakeLists.txt b/Tests/RunCMake/try_compile/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/try_compile/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-result.txt b/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-stderr.txt b/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-stderr.txt new file mode 100644 index 000000000..5d09c0c61 --- /dev/null +++ b/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at CopyFileErrorNoCopyFile.cmake:1 \(try_compile\): + COPY_FILE_ERROR may be used only with COPY_FILE +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile.cmake b/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile.cmake new file mode 100644 index 000000000..8d7cb0e7f --- /dev/null +++ b/Tests/RunCMake/try_compile/CopyFileErrorNoCopyFile.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE_ERROR _copied) diff --git a/Tests/RunCMake/try_compile/NoArgs-result.txt b/Tests/RunCMake/try_compile/NoArgs-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoArgs-stderr.txt b/Tests/RunCMake/try_compile/NoArgs-stderr.txt new file mode 100644 index 000000000..8808fd19a --- /dev/null +++ b/Tests/RunCMake/try_compile/NoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoArgs.cmake:1 \(try_compile\): + try_compile unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoArgs.cmake b/Tests/RunCMake/try_compile/NoArgs.cmake new file mode 100644 index 000000000..8f751d9a2 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoArgs.cmake @@ -0,0 +1 @@ +try_compile() diff --git a/Tests/RunCMake/try_compile/NoCopyFile-result.txt b/Tests/RunCMake/try_compile/NoCopyFile-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt new file mode 100644 index 000000000..d65d94883 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoCopyFile.cmake:1 \(try_compile\): + COPY_FILE must be followed by a file path +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoCopyFile.cmake b/Tests/RunCMake/try_compile/NoCopyFile.cmake new file mode 100644 index 000000000..8c648ff32 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE) diff --git a/Tests/RunCMake/try_compile/NoCopyFile2-result.txt b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt new file mode 100644 index 000000000..e88952475 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoCopyFile2.cmake:1 \(try_compile\): + COPY_FILE must be followed by a file path +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoCopyFile2.cmake b/Tests/RunCMake/try_compile/NoCopyFile2.cmake new file mode 100644 index 000000000..04b7f6882 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFile2.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE CMAKE_FLAGS -DA=B) diff --git a/Tests/RunCMake/try_compile/NoCopyFileError-result.txt b/Tests/RunCMake/try_compile/NoCopyFileError-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFileError-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoCopyFileError-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFileError-stderr.txt new file mode 100644 index 000000000..ed552fd8e --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFileError-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoCopyFileError.cmake:1 \(try_compile\): + COPY_FILE_ERROR must be followed by a variable name +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoCopyFileError.cmake b/Tests/RunCMake/try_compile/NoCopyFileError.cmake new file mode 100644 index 000000000..d4d69ee01 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoCopyFileError.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/copied.bin COPY_FILE_ERROR) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-result.txt b/Tests/RunCMake/try_compile/NoOutputVariable-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt new file mode 100644 index 000000000..18ad751cf --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoOutputVariable.cmake:1 \(try_compile\): + OUTPUT_VARIABLE must be followed by a variable name +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable.cmake b/Tests/RunCMake/try_compile/NoOutputVariable.cmake new file mode 100644 index 000000000..3b9cb345b --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + OUTPUT_VARIABLE) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt new file mode 100644 index 000000000..8b2cc254c --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoOutputVariable2.cmake:1 \(try_compile\): + OUTPUT_VARIABLE must be followed by a variable name +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2.cmake b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake new file mode 100644 index 000000000..ad9ac9ac5 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c + OUTPUT_VARIABLE CMAKE_FLAGS -DA=B) diff --git a/Tests/RunCMake/try_compile/NoSources-result.txt b/Tests/RunCMake/try_compile/NoSources-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoSources-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NoSources-stderr.txt b/Tests/RunCMake/try_compile/NoSources-stderr.txt new file mode 100644 index 000000000..023032b60 --- /dev/null +++ b/Tests/RunCMake/try_compile/NoSources-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NoSources.cmake:1 \(try_compile\): + SOURCES must be followed by at least one source file +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NoSources.cmake b/Tests/RunCMake/try_compile/NoSources.cmake new file mode 100644 index 000000000..8a73af42c --- /dev/null +++ b/Tests/RunCMake/try_compile/NoSources.cmake @@ -0,0 +1 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} SOURCES) diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt new file mode 100644 index 000000000..025e65868 --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\): + COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake new file mode 100644 index 000000000..8eb0d47a0 --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj + TestProject COMPILE_DEFINITIONS DEF) diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt b/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt new file mode 100644 index 000000000..f5893e19f --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at NonSourceCopyFile.cmake:1 \(try_compile\): + COPY_FILE specified on a srcdir type TRY_COMPILE +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake b/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake new file mode 100644 index 000000000..c44192f9e --- /dev/null +++ b/Tests/RunCMake/try_compile/NonSourceCopyFile.cmake @@ -0,0 +1,2 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/proj + TestProject COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/result) diff --git a/Tests/RunCMake/try_compile/OneArg-result.txt b/Tests/RunCMake/try_compile/OneArg-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/OneArg-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/OneArg-stderr.txt b/Tests/RunCMake/try_compile/OneArg-stderr.txt new file mode 100644 index 000000000..12835bed6 --- /dev/null +++ b/Tests/RunCMake/try_compile/OneArg-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at OneArg.cmake:1 \(try_compile\): + try_compile unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/OneArg.cmake b/Tests/RunCMake/try_compile/OneArg.cmake new file mode 100644 index 000000000..e60a46207 --- /dev/null +++ b/Tests/RunCMake/try_compile/OneArg.cmake @@ -0,0 +1 @@ +try_compile(RESULT) diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake new file mode 100644 index 000000000..c93445876 --- /dev/null +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +run_cmake(CopyFileErrorNoCopyFile) +run_cmake(NoArgs) +run_cmake(OneArg) +run_cmake(TwoArgs) +run_cmake(NoCopyFile) +run_cmake(NoCopyFile2) +run_cmake(NoCopyFileError) +run_cmake(NoOutputVariable) +run_cmake(NoOutputVariable2) +run_cmake(NoSources) +run_cmake(BadLinkLibraries) +run_cmake(BadSources1) +run_cmake(BadSources2) +run_cmake(NonSourceCopyFile) +run_cmake(NonSourceCompileDefinitions) diff --git a/Tests/RunCMake/try_compile/TwoArgs-result.txt b/Tests/RunCMake/try_compile/TwoArgs-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/try_compile/TwoArgs-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/TwoArgs-stderr.txt b/Tests/RunCMake/try_compile/TwoArgs-stderr.txt new file mode 100644 index 000000000..b9c08fc9d --- /dev/null +++ b/Tests/RunCMake/try_compile/TwoArgs-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at TwoArgs.cmake:1 \(try_compile\): + try_compile unknown error. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/TwoArgs.cmake b/Tests/RunCMake/try_compile/TwoArgs.cmake new file mode 100644 index 000000000..7f2212d62 --- /dev/null +++ b/Tests/RunCMake/try_compile/TwoArgs.cmake @@ -0,0 +1 @@ +try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Tests/RunCMake/try_compile/proj/CMakeLists.txt b/Tests/RunCMake/try_compile/proj/CMakeLists.txt new file mode 100644 index 000000000..78a87c016 --- /dev/null +++ b/Tests/RunCMake/try_compile/proj/CMakeLists.txt @@ -0,0 +1,2 @@ +cmake_minimum_required(VERSION 2.8.10) +project(TestProject NONE) diff --git a/Tests/RunCMake/try_compile/src.c b/Tests/RunCMake/try_compile/src.c new file mode 100644 index 000000000..78f2de106 --- /dev/null +++ b/Tests/RunCMake/try_compile/src.c @@ -0,0 +1 @@ +int main(void) { return 0; } diff --git a/Tests/RunCMake/variable_watch/CMakeLists.txt b/Tests/RunCMake/variable_watch/CMakeLists.txt new file mode 100644 index 000000000..12cd3c775 --- /dev/null +++ b/Tests/RunCMake/variable_watch/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt new file mode 100644 index 000000000..3ff96fcc3 --- /dev/null +++ b/Tests/RunCMake/variable_watch/ModifiedAccess-stderr.txt @@ -0,0 +1,4 @@ +CMake Debug Log at ModifiedAccess.cmake:3 \(set\): + Variable "b" was accessed using MODIFIED_ACCESS with value "b". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/variable_watch/ModifiedAccess.cmake b/Tests/RunCMake/variable_watch/ModifiedAccess.cmake new file mode 100644 index 000000000..87943b39f --- /dev/null +++ b/Tests/RunCMake/variable_watch/ModifiedAccess.cmake @@ -0,0 +1,3 @@ +set(b "a") +variable_watch(b) +set(b "b") diff --git a/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt new file mode 100644 index 000000000..d2994297d --- /dev/null +++ b/Tests/RunCMake/variable_watch/NoWatcher-stderr.txt @@ -0,0 +1,5 @@ +my_func +CMake Debug Log at NoWatcher.cmake:8 \(set\): + Variable "b" was accessed using MODIFIED_ACCESS with value "". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/variable_watch/NoWatcher.cmake b/Tests/RunCMake/variable_watch/NoWatcher.cmake new file mode 100644 index 000000000..8a68efbe4 --- /dev/null +++ b/Tests/RunCMake/variable_watch/NoWatcher.cmake @@ -0,0 +1,8 @@ +function(my_func) + message("my_func") +endfunction() +variable_watch(a my_func) +set(a "") + +variable_watch(b) +set(b "") diff --git a/Tests/RunCMake/variable_watch/RunCMakeTest.cmake b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake new file mode 100644 index 000000000..9becb4cd7 --- /dev/null +++ b/Tests/RunCMake/variable_watch/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(ModifiedAccess) +run_cmake(NoWatcher) +run_cmake(WatchTwice) diff --git a/Tests/RunCMake/variable_watch/WatchTwice-stderr.txt b/Tests/RunCMake/variable_watch/WatchTwice-stderr.txt new file mode 100644 index 000000000..fa7d3472a --- /dev/null +++ b/Tests/RunCMake/variable_watch/WatchTwice-stderr.txt @@ -0,0 +1,2 @@ +From watch1 +From watch2 diff --git a/Tests/RunCMake/variable_watch/WatchTwice.cmake b/Tests/RunCMake/variable_watch/WatchTwice.cmake new file mode 100644 index 000000000..540cfc160 --- /dev/null +++ b/Tests/RunCMake/variable_watch/WatchTwice.cmake @@ -0,0 +1,11 @@ +function (watch1) + message("From watch1") +endfunction () + +function (watch2) + message("From watch2") +endfunction () + +variable_watch(watched watch1) +variable_watch(watched watch2) +set(access "${watched}") |