diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 7468926b6..93d1abbb8 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -1,6 +1,7 @@ # # Create exe. # +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS") ADD_EXECUTABLE(complex complex) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 6607d7de7..adde525d0 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -132,7 +132,10 @@ int main() { cmPassed("Call to file2 function returned 1."); } - +#ifndef TEST_CXX_FLAGS + cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!"); +#else + cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); // ---------------------------------------------------------------------- // Test ADD_DEFINITIONS diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index 19cb6cd3f..b3c402c1e 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources) # SOURCE_FILES(SharedLibrarySources sharedFile) ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources) - +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) # diff --git a/Tests/Complex/Library/testConly.c b/Tests/Complex/Library/testConly.c index 05ec1076c..35d6a399c 100644 --- a/Tests/Complex/Library/testConly.c +++ b/Tests/Complex/Library/testConly.c @@ -2,5 +2,11 @@ int CsharedFunction() { +#ifndef TEST_C_FLAGS + printf("TEST_C_FLAGS failed\n"); + return 0; +#else + printf("Passed: TEST_C_FLAGS passed\n"); +#endif return 1; } diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 7468926b6..93d1abbb8 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -1,6 +1,7 @@ # # Create exe. # +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS") ADD_EXECUTABLE(complex complex) diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 6607d7de7..adde525d0 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -132,7 +132,10 @@ int main() { cmPassed("Call to file2 function returned 1."); } - +#ifndef TEST_CXX_FLAGS + cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!"); +#else + cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); // ---------------------------------------------------------------------- // Test ADD_DEFINITIONS diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index 19cb6cd3f..b3c402c1e 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources) # SOURCE_FILES(SharedLibrarySources sharedFile) ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources) - +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) # diff --git a/Tests/ComplexOneConfig/Library/testConly.c b/Tests/ComplexOneConfig/Library/testConly.c index 05ec1076c..35d6a399c 100644 --- a/Tests/ComplexOneConfig/Library/testConly.c +++ b/Tests/ComplexOneConfig/Library/testConly.c @@ -2,5 +2,11 @@ int CsharedFunction() { +#ifndef TEST_C_FLAGS + printf("TEST_C_FLAGS failed\n"); + return 0; +#else + printf("Passed: TEST_C_FLAGS passed\n"); +#endif return 1; } diff --git a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt index 7468926b6..93d1abbb8 100644 --- a/Tests/ComplexRelativePaths/Executable/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/Executable/CMakeLists.txt @@ -1,6 +1,7 @@ # # Create exe. # +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") SET_SOURCE_FILES_PROPERTIES(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS") ADD_EXECUTABLE(complex complex) diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index 6607d7de7..adde525d0 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -132,7 +132,10 @@ int main() { cmPassed("Call to file2 function returned 1."); } - +#ifndef TEST_CXX_FLAGS + cmFailed("CMake CMAKE_CXX_FLAGS is not being passed to the compiler!"); +#else + cmPassed("CMake CMAKE_CXX_FLAGS is being passed to the compiler."); // ---------------------------------------------------------------------- // Test ADD_DEFINITIONS diff --git a/Tests/ComplexRelativePaths/Library/CMakeLists.txt b/Tests/ComplexRelativePaths/Library/CMakeLists.txt index 19cb6cd3f..b3c402c1e 100644 --- a/Tests/ComplexRelativePaths/Library/CMakeLists.txt +++ b/Tests/ComplexRelativePaths/Library/CMakeLists.txt @@ -25,7 +25,7 @@ ADD_LIBRARY(CMakeTestLibrary LibrarySources) # SOURCE_FILES(SharedLibrarySources sharedFile) ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources) - +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) # diff --git a/Tests/ComplexRelativePaths/Library/testConly.c b/Tests/ComplexRelativePaths/Library/testConly.c index 05ec1076c..35d6a399c 100644 --- a/Tests/ComplexRelativePaths/Library/testConly.c +++ b/Tests/ComplexRelativePaths/Library/testConly.c @@ -2,5 +2,11 @@ int CsharedFunction() { +#ifndef TEST_C_FLAGS + printf("TEST_C_FLAGS failed\n"); + return 0; +#else + printf("Passed: TEST_C_FLAGS passed\n"); +#endif return 1; }