From: ski Date: Tue, 26 Apr 2016 08:05:46 +0000 (+0300) Subject: 0027212: Make cmake configurator flexible concerning option BUILD_WITH_DEBUG X-Git-Tag: V7_0_winwerth~77 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=e13e5f39c5adf53c9d876e33a5db46e6e26341ce;p=occt-copy.git 0027212: Make cmake configurator flexible concerning option BUILD_WITH_DEBUG Added flexible behaviour for option BUILD_WITH_DEBUG. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index db60f336d0..34ea0ed19d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,9 +65,16 @@ if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration ge endif() # enable extended messages of many OCCT algorithms -set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}") +if ((SINGLE_GENERATOR AND "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") OR NOT SINGLE_GENERATOR) + if (NOT BUILD_WITH_DEBUG) + set (BUILD_WITH_DEBUG OFF CACHE BOOL "${BUILD_WITH_DEBUG_DESCR}") + endif() +else() + OCCT_CHECK_AND_UNSET (BUILD_WITH_DEBUG) +endif() + if (BUILD_WITH_DEBUG) - add_definitions (-DOCCT_DEBUG) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$:OCCT_DEBUG>) endif() # copy samples to install directory diff --git a/adm/cmake/vardescr.cmake b/adm/cmake/vardescr.cmake index 0c49d40c5a..baa6481770 100644 --- a/adm/cmake/vardescr.cmake +++ b/adm/cmake/vardescr.cmake @@ -19,8 +19,9 @@ ExprIntrp functionality are generated automatically with Flex/Bison. Checking th leads to automatic search of Flex/Bison binaries and regeneration of the mentioned files") set (BUILD_WITH_DEBUG_DESCR -"Enables extended messages of many OCCT algorithms, usually printed to cout. -These include messages on internal errors and special cases encountered, timing etc") +"Enables extended messages of many OCCT algorithms, usually printed to cout. +These include messages on internal errors and special cases encountered, timing etc. +Applies only for Debug configuration.") set (BUILD_SHARED_LIBRARY_NAME_POSTFIX_DESCR "Append the postfix to names of output libraries")