use CMAKE_BUILD_TYPE to differ between debug and release. (cherry picked from commit...
authorSebastian Sauer <sebsauer@kdab.net>
Mon, 27 Apr 2009 15:06:37 +0000 (17:06 +0200)
committerunknown <Administrator@.(none)>
Mon, 30 Nov 2009 10:09:22 +0000 (11:09 +0100)
cmake/CMakeLists.txt

index d63c40b..f79295c 100644 (file)
@@ -360,23 +360,21 @@ if (WIN32)
 endif(WIN32)
 
 if (MSVC_IDE)
-       if (test_debug)
-               set(test_debug TRUE CACHE TYPE STRING FORCE)
+    if(CMAKE_BUILD_TYPE MATCHES Debug)
                set(IDE_BIN Debug/ )
                message(STATUS)
-               message(STATUS "Using Visual Studio: test programs will only work with the 'Debug' configuration!")
-               message(STATUS "To run the tests with the 'Release' configuration use -Dtest_debug=0")
+               message(STATUS "Visual Studio: test programs will only work with 'Debug' configuration!")
+               message(STATUS "To run tests with 'Release' configuration use -DCMAKE_BUILD_TYPE=Release")
                message(STATUS "Add '..\\..\\test\\data' to the command line option of the test programs")
                message(STATUS)
-       else (test_debug)
-               set(test_debug FALSE CACHE TYPE STRING FORCE)
+    else(CMAKE_BUILD_TYPE MATCHES Debug)
                set(IDE_BIN Release/)
                message(STATUS)
-               message(STATUS "Using Visual Studio: test programs will only work with the 'Release' configuration!")
-               message(STATUS "To run the tests with the 'Debug' configuration use -Dtest_debug=1")
+               message(STATUS "Visual Studio: test programs will only work with 'Release' configuration!")
+               message(STATUS "To run tests with 'Debug' configuration use -DCMAKE_BUILD_TYPE=Debug")
                message(STATUS "Add '..\\..\\test\\data' to the command line option of the test programs")
                message(STATUS)
-       endif (test_debug)
+    endif(CMAKE_BUILD_TYPE MATCHES Debug)
        set (TEST_PATH_FORCE FORCE)
        FILE(REMOVE ${CMAKE_BINARY_DIR}/data/dbus-1/services)
 endif (MSVC_IDE)