diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-09-23 22:10:32 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-09-23 22:10:32 +0200 |
commit | 13cbc751c92248e0dfa969bfe5f5060773ac9972 (patch) | |
tree | 9787f640c112a3a5e7a89546c6e345c5523531e3 /cmake | |
parent | 421feea3b2ca7d1b4c8af567c282519f293ce38f (diff) |
bug #880: automatically preserves buildtool flags when modifying DartConfiguration.tcl file.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/EigenConfigureTesting.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/EigenConfigureTesting.cmake b/cmake/EigenConfigureTesting.cmake index 190509958..05c8c1466 100644 --- a/cmake/EigenConfigureTesting.cmake +++ b/cmake/EigenConfigureTesting.cmake @@ -23,7 +23,12 @@ set(EIGEN_TEST_BUILD_FLAGS "" CACHE STRING "Options passed to the build command # Recall that our unit tests are not in the "all" target, so we have to explicitely ask ctest to build our custom 'buildtests' target. # At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable. file(READ "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE) -string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config '' -- -i ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType" +# try to grab the default flags +string(REGEX MATCH "MakeCommand:.*-- (.*)DefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE}) +if(NOT CMAKE_MATCH_1) +string(REGEX MATCH "MakeCommand:.*gmake (.*)DefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE}) +endif() +string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config \"\${CTEST_CONFIGURATION_TYPE}\" -- ${CMAKE_MATCH_1} ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType" EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE}) file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" ${EIGEN_DART_CONFIG_FILE2}) |