diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/COnly/conly.c | 3 | ||||
-rw-r--r-- | Tests/SimpleInstall/CMakeLists.txt | 22 | ||||
-rw-r--r-- | Tests/SimpleInstallS2/CMakeLists.txt | 22 |
3 files changed, 40 insertions, 7 deletions
diff --git a/Tests/COnly/conly.c b/Tests/COnly/conly.c index e8280ec..7214fe1 100644 --- a/Tests/COnly/conly.c +++ b/Tests/COnly/conly.c @@ -7,6 +7,7 @@ int main () { + int class = 0; if ( LibC1Func() != 2.0 ) { printf("Problem with libc1\n"); @@ -17,6 +18,6 @@ int main () printf("Problem with libc2\n"); return 1; } - printf("Foo: %s\n", foo); + printf("Foo: %s %d\n", foo, class); return 0; } diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index aa9dfe4..c2de5b1 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -72,6 +72,14 @@ IF(STAGE2) MESSAGE(SEND_ERROR "test1 not found in lib/static!") ENDIF("${TEST1_LIBRARY}" MATCHES "static") + # Check for failure of configuration-specific installation. + IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!") + ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") + ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + # Make sure the test executable can run from the install tree. SET_TARGET_PROPERTIES(SimpleInstallS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) @@ -105,9 +113,9 @@ ELSE(STAGE2) ADD_DEPENDENCIES(test4 test2) INSTALL(TARGETS SimpleInstall test1 test2 test3 - RUNTIME DESTINATION MyTest/bin # .exe, .dll - LIBRARY DESTINATION MyTest/lib # .so, module.dll, ... - ARCHIVE DESTINATION MyTest/lib/static # .a, .lib + RUNTIME DESTINATION MyTest/bin COMPONENT Runtime # .exe, .dll + LIBRARY DESTINATION MyTest/lib COMPONENT Runtime # .so, mod.dll + ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib ) INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE RUNTIME DESTINATION MyTest/bin @@ -122,6 +130,14 @@ ELSE(STAGE2) ) INSTALL_FILES(/MyTest/include FILES lib3.h) + # Test configuration-specific installation. + INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release + DESTINATION MyTest/include/Release + ) + INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug + DESTINATION MyTest/include/Debug + ) + # Test user-specified install scripts. INSTALL( SCRIPT InstallScript1.cmake diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index aa9dfe4..c2de5b1 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -72,6 +72,14 @@ IF(STAGE2) MESSAGE(SEND_ERROR "test1 not found in lib/static!") ENDIF("${TEST1_LIBRARY}" MATCHES "static") + # Check for failure of configuration-specific installation. + IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!") + ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") + ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + # Make sure the test executable can run from the install tree. SET_TARGET_PROPERTIES(SimpleInstallS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) @@ -105,9 +113,9 @@ ELSE(STAGE2) ADD_DEPENDENCIES(test4 test2) INSTALL(TARGETS SimpleInstall test1 test2 test3 - RUNTIME DESTINATION MyTest/bin # .exe, .dll - LIBRARY DESTINATION MyTest/lib # .so, module.dll, ... - ARCHIVE DESTINATION MyTest/lib/static # .a, .lib + RUNTIME DESTINATION MyTest/bin COMPONENT Runtime # .exe, .dll + LIBRARY DESTINATION MyTest/lib COMPONENT Runtime # .so, mod.dll + ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib ) INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE RUNTIME DESTINATION MyTest/bin @@ -122,6 +130,14 @@ ELSE(STAGE2) ) INSTALL_FILES(/MyTest/include FILES lib3.h) + # Test configuration-specific installation. + INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release + DESTINATION MyTest/include/Release + ) + INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug + DESTINATION MyTest/include/Debug + ) + # Test user-specified install scripts. INSTALL( SCRIPT InstallScript1.cmake |