From f0a1065393a57f503bc2c86f432f50dd4b8d5bbd Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 22 Aug 2012 13:03:56 +0200 Subject: Rename files from main.cpp to more meaningful names. Because the main file for the dummy-executable and the actual compile test were both called main.cpp, they were overwriting each other during in-source builds. --- Tests/CompileDefinitions/CMakeLists.txt | 4 +-- .../add_definitions_command/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- Tests/CompileDefinitions/compiletest.cpp | 33 ++++++++++++++++++++++ Tests/CompileDefinitions/main.cpp | 33 ---------------------- .../CompileDefinitions/target_prop/CMakeLists.txt | 2 +- 6 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 Tests/CompileDefinitions/compiletest.cpp delete mode 100644 Tests/CompileDefinitions/main.cpp diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt index 337aeb1..e7d91bf 100644 --- a/Tests/CompileDefinitions/CMakeLists.txt +++ b/Tests/CompileDefinitions/CMakeLists.txt @@ -11,6 +11,6 @@ add_subdirectory(add_definitions_command) add_subdirectory(target_prop) add_subdirectory(add_definitions_command_with_target_prop) -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" "int main(int, char **) { return 0; }\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummyexecutable.cpp" "int main(int, char **) { return 0; }\n") -add_executable(CompileDefinitions "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +add_executable(CompileDefinitions "${CMAKE_CURRENT_BINARY_DIR}/dummyexecutable.cpp") diff --git a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt index 4ca269d..a6372af 100644 --- a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt +++ b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt @@ -4,4 +4,4 @@ project(add_definitions_command) add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun") add_definitions(-DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun" -DCMAKE_IS_FUN -DCMAKE_IS=Fun) -add_executable(add_definitions_command_executable ../main.cpp) +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 index 4161ed6..e415390 100644 --- a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt @@ -3,7 +3,7 @@ project(add_definitions_command_with_target_prop) add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun) -add_executable(add_definitions_command_with_target_prop_executable ../main.cpp) +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") diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp new file mode 100644 index 0000000..6db6f3f --- /dev/null +++ b/Tests/CompileDefinitions/compiletest.cpp @@ -0,0 +1,33 @@ + +#ifndef CMAKE_IS_FUN +#error Expect CMAKE_IS_FUN definition +#endif + +#if CMAKE_IS != Fun +#error Expect CMAKE_IS=Fun definition +#endif + + +template +struct CMakeStaticAssert; + +template<> +struct CMakeStaticAssert {}; + +static const char fun_string[] = CMAKE_IS_; +#ifndef NO_SPACES_IN_DEFINE_VALUES +static const char very_fun_string[] = CMAKE_IS_REALLY; +#endif + +enum { + StringLiteralTest1 = sizeof(CMakeStaticAssert) +#ifndef NO_SPACES_IN_DEFINE_VALUES + , + StringLiteralTest2 = sizeof(CMakeStaticAssert) +#endif +}; + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/Tests/CompileDefinitions/main.cpp b/Tests/CompileDefinitions/main.cpp deleted file mode 100644 index 6db6f3f..0000000 --- a/Tests/CompileDefinitions/main.cpp +++ /dev/null @@ -1,33 +0,0 @@ - -#ifndef CMAKE_IS_FUN -#error Expect CMAKE_IS_FUN definition -#endif - -#if CMAKE_IS != Fun -#error Expect CMAKE_IS=Fun definition -#endif - - -template -struct CMakeStaticAssert; - -template<> -struct CMakeStaticAssert {}; - -static const char fun_string[] = CMAKE_IS_; -#ifndef NO_SPACES_IN_DEFINE_VALUES -static const char very_fun_string[] = CMAKE_IS_REALLY; -#endif - -enum { - StringLiteralTest1 = sizeof(CMakeStaticAssert) -#ifndef NO_SPACES_IN_DEFINE_VALUES - , - StringLiteralTest2 = sizeof(CMakeStaticAssert) -#endif -}; - -int main(int argc, char **argv) -{ - return 0; -} diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt index 6dbee9a..e2b6ba9 100644 --- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -1,7 +1,7 @@ project(target_prop) -add_executable(target_prop_executable ../main.cpp) +add_executable(target_prop_executable ../compiletest.cpp) set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_FUN) -- cgit v0.12