diff options
author | Brad King <brad.king@kitware.com> | 2009-07-11 14:10:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-07-11 14:10:51 (GMT) |
commit | 3621e073a88433af4408a8d7d58974b4e8254b54 (patch) | |
tree | 770cb042e07ef712ce4ec395985881f7735e096e /Tests/ExportImport/CMakeLists.txt | |
parent | 28b1912aa3eba8427cc3d0a4954f7366fcb338b9 (diff) | |
download | CMake-3621e073a88433af4408a8d7d58974b4e8254b54.zip CMake-3621e073a88433af4408a8d7d58974b4e8254b54.tar.gz CMake-3621e073a88433af4408a8d7d58974b4e8254b54.tar.bz2 |
ENH: Test export/import of link interface languages
This extends the ExportImport test. The Export project creates a C++
static library and exports it. Then the Import project links the
library into a C executable. On most platforms the executable will link
only if the C++ linker is chosen correctly.
Diffstat (limited to 'Tests/ExportImport/CMakeLists.txt')
-rw-r--r-- | Tests/ExportImport/CMakeLists.txt | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt index 3b54e9d..af28fd9 100644 --- a/Tests/ExportImport/CMakeLists.txt +++ b/Tests/ExportImport/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 2.6) -project(ExportImport C) +cmake_minimum_required (VERSION 2.7.20090711) +project(ExportImport C CXX) # Wipe out the install tree to make sure the exporter works. add_custom_command( @@ -22,6 +22,21 @@ else(CMAKE_CONFIGURATION_TYPES) endif(CMAKE_BUILD_TYPE) endif(CMAKE_CONFIGURATION_TYPES) +set(SAME_COMPILER + -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} + -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} + -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} + -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} + -DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL} + -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} + -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS} + -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG} + -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE} + -DCMAKE_CXX_FLAGS_MINSIZEREL:STRING=${CMAKE_CXX_FLAGS_MINSIZEREL} + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO} + ) + # Build and install the exporter. add_custom_command( OUTPUT ${ExportImport_BINARY_DIR}/ExportProject @@ -34,13 +49,7 @@ add_custom_command( --build-target install --build-generator ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-options - -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} - -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} - -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} - -DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL} - -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} + --build-options ${SAME_COMPILER} -DCMAKE_INSTALL_PREFIX:STRING=${ExportImport_BINARY_DIR}/Root -DCMAKE_SKIP_RPATH:BOOL=ON ) @@ -62,13 +71,7 @@ add_custom_command( --build-project Import --build-generator ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-options - -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} - -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS} - -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG} - -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE} - -DCMAKE_C_FLAGS_MINSIZEREL:STRING=${CMAKE_C_FLAGS_MINSIZEREL} - -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} + --build-options ${SAME_COMPILER} -DCMAKE_INSTALL_PREFIX:STRING=${ExportImport_BINARY_DIR}/Root -DCMAKE_SKIP_RPATH:BOOL=ON ) |