From 494f6e8d5b9f2e556a2b2db2c165a56c01fd1827 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 25 Jan 2015 08:09:10 -0500 Subject: Tests: Shorten paths in CompileDefinitions Shorten the add_definitions command test directory and target names to avoid creating really long paths that fail with some tools on Windows. While at it, remove unnecessary project() command calls. --- Tests/CompileDefinitions/CMakeLists.txt | 6 ++---- Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt | 12 ++++++++++++ .../add_def_cmd_tprop/CMakeLists.txt | 16 ++++++++++++++++ .../add_definitions_command/CMakeLists.txt | 15 --------------- .../CMakeLists.txt | 19 ------------------- 5 files changed, 30 insertions(+), 38 deletions(-) create mode 100644 Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt create mode 100644 Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt delete mode 100644 Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt delete mode 100644 Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt index 930d220..13d1b01 100644 --- a/Tests/CompileDefinitions/CMakeLists.txt +++ b/Tests/CompileDefinitions/CMakeLists.txt @@ -1,6 +1,4 @@ - cmake_minimum_required(VERSION 2.8) - project(CompileDefinitions) if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6") @@ -19,8 +17,8 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "BUILD_CONFIG_NAME=\"$\"" ) -add_subdirectory(add_definitions_command) +add_subdirectory(add_def_cmd) add_subdirectory(target_prop) -add_subdirectory(add_definitions_command_with_target_prop) +add_subdirectory(add_def_cmd_tprop) add_executable(CompileDefinitions runtest.c) diff --git a/Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt b/Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt new file mode 100644 index 0000000..2bce602 --- /dev/null +++ b/Tests/CompileDefinitions/add_def_cmd/CMakeLists.txt @@ -0,0 +1,12 @@ +add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun") +if (NOT NO_SPACES_IN_DEFINE_VALUES) + add_definitions(-DCMAKE_IS_REALLY="Very Fun") +endif() +add_definitions(-DCMAKE_IS_="Fun") +if (NOT NO_SPACES_IN_DEFINE_VALUES) + add_definitions(-DCMAKE_IS_REALLY="Very Fun") +endif() +add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) +add_definitions(-DBUILD_IS_DEBUG=$ -DBUILD_IS_NOT_DEBUG=$>) + +add_executable(add_def_cmd_exe ../compiletest.cpp) diff --git a/Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt b/Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt new file mode 100644 index 0000000..4ef8a09 --- /dev/null +++ b/Tests/CompileDefinitions/add_def_cmd_tprop/CMakeLists.txt @@ -0,0 +1,16 @@ +add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) + +add_executable(add_def_cmd_tprop_exe ../compiletest.cpp) + +set_target_properties(add_def_cmd_tprop_exe PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_="Fun") + +if (NOT NO_SPACES_IN_DEFINE_VALUES) + set_property(TARGET add_def_cmd_tprop_exe APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun") +endif() + +add_definitions(-DCMAKE_IS_FUN) + +set_property(TARGET add_def_cmd_tprop_exe APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun CMAKE_IS_="Fun") + +add_definitions(-DBUILD_IS_DEBUG=$) +set_property(TARGET add_def_cmd_tprop_exe APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_NOT_DEBUG=$>) diff --git a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt deleted file mode 100644 index 23e0134..0000000 --- a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ - -project(add_definitions_command) - -add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun") -if (NOT NO_SPACES_IN_DEFINE_VALUES) - add_definitions(-DCMAKE_IS_REALLY="Very Fun") -endif() -add_definitions(-DCMAKE_IS_="Fun") -if (NOT NO_SPACES_IN_DEFINE_VALUES) - add_definitions(-DCMAKE_IS_REALLY="Very Fun") -endif() -add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) -add_definitions(-DBUILD_IS_DEBUG=$ -DBUILD_IS_NOT_DEBUG=$>) - -add_executable(add_definitions_command_executable ../compiletest.cpp) diff --git a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt deleted file mode 100644 index 55108db..0000000 --- a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -project(add_definitions_command_with_target_prop) - -add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) - -add_executable(add_definitions_command_with_target_prop_executable ../compiletest.cpp) - -set_target_properties(add_definitions_command_with_target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_="Fun") - -if (NOT NO_SPACES_IN_DEFINE_VALUES) - set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun") -endif() - -add_definitions(-DCMAKE_IS_FUN) - -set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun CMAKE_IS_="Fun") - -add_definitions(-DBUILD_IS_DEBUG=$) -set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS BUILD_IS_NOT_DEBUG=$>) -- cgit v0.12 From 539c5c252ef679d15f3af828da304ad9313640e2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 25 Jan 2015 08:09:10 -0500 Subject: Tests: Shorten paths in RunCMake.CompileFeatures Shorten the NotAFeature_OriginDebug_target_compile_features case name to avoid creating really long paths that fail with some tools on Windows. --- .../CompileFeatures/NotAFeature_OriginDebugCommand-result.txt | 1 + .../CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt | 5 +++++ Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake | 4 ++++ .../NotAFeature_OriginDebug_target_compile_features-result.txt | 1 - .../NotAFeature_OriginDebug_target_compile_features-stderr.txt | 5 ----- .../NotAFeature_OriginDebug_target_compile_features.cmake | 4 ---- Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-result.txt create mode 100644 Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt create mode 100644 Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake delete mode 100644 Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt delete mode 100644 Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt delete mode 100644 Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt new file mode 100644 index 0000000..1f2c113 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand-stderr.txt @@ -0,0 +1,5 @@ +CMake Error at NotAFeature_OriginDebugCommand.cmake:4 \(target_compile_features\): + target_compile_features specified unknown feature "not_a_feature" for + target "somelib". +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake new file mode 100644 index 0000000..467d9a1 --- /dev/null +++ b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebugCommand.cmake @@ -0,0 +1,4 @@ + +set(CMAKE_DEBUG_TARGET_PROPERTIES COMPILE_FEATURES) +add_library(somelib STATIC empty.cpp) +target_compile_features(somelib PRIVATE not_a_feature) diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt deleted file mode 100644 index d00491f..0000000 --- a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt deleted file mode 100644 index d819d15..0000000 --- a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -CMake Error at NotAFeature_OriginDebug_target_compile_features.cmake:4 \(target_compile_features\): - target_compile_features specified unknown feature "not_a_feature" for - target "somelib". -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake b/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake deleted file mode 100644 index 467d9a1..0000000 --- a/Tests/RunCMake/CompileFeatures/NotAFeature_OriginDebug_target_compile_features.cmake +++ /dev/null @@ -1,4 +0,0 @@ - -set(CMAKE_DEBUG_TARGET_PROPERTIES COMPILE_FEATURES) -add_library(somelib STATIC empty.cpp) -target_compile_features(somelib PRIVATE not_a_feature) diff --git a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake index 1892a5c..376f75a 100644 --- a/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileFeatures/RunCMakeTest.cmake @@ -6,7 +6,7 @@ run_cmake(NotAFeatureTransitive) run_cmake(NotAFeature_OriginDebug) run_cmake(NotAFeature_OriginDebugGenex) run_cmake(NotAFeature_OriginDebugTransitive) -run_cmake(NotAFeature_OriginDebug_target_compile_features) +run_cmake(NotAFeature_OriginDebugCommand) run_cmake(generate_feature_list) file(READ -- cgit v0.12 From 70c50962fb405cfb89637f24aa38c3e0fd5cbd87 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 27 Jan 2015 08:57:35 -0500 Subject: Tests: Shorten paths in ExternalProjectLocal Use a shorter name for the external project base directory to allow longer CMake build tree directory names on Windows. --- Tests/ExternalProjectLocal/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt index 9476ab4..e1a67db 100644 --- a/Tests/ExternalProjectLocal/CMakeLists.txt +++ b/Tests/ExternalProjectLocal/CMakeLists.txt @@ -15,7 +15,7 @@ endif() set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakePredefinedTargets-in-ExternalProjectTest") -set(base "${CMAKE_BINARY_DIR}/CMakeExternals") +set(base "${CMAKE_BINARY_DIR}/Ext") set(binary_base "${base}/Build") set_property(DIRECTORY PROPERTY EP_BASE ${base}) set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test) -- cgit v0.12