Salome HOME
RNV: win32 building.
[modules/kernel.git] / salome_adm / cmake_files / SalomeSetupPlatform.cmake
index 7c511fa6b26c7ff995290d49c460adef6e075288..317be31c51792556b722f59eaad40b5fcc71fb65 100644 (file)
@@ -39,6 +39,13 @@ IF(NOT CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE Release)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 
+## Define the log level according to the build type
+IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "Debug")
+  SET(PYLOGLEVEL DEBUG)
+ELSE()
+  SET(PYLOGLEVEL WARNING)
+ENDIF()
+
 ## Make all warnings errors on non-windows platforms
 #  CURRENTLY DISABLED
 IF(NOT (WIN32 OR APPLE))
@@ -98,10 +105,14 @@ ELSE()
   SET(PLATFORM_LIBS dl)    # Dynamic loading (dlopen, dlsym)
 ENDIF()
 
+## define _DEBUG_ macro
+IF(NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
+  ADD_DEFINITIONS(-D_DEBUG_)
+ENDIF()
+
 ## Apple specific:
 IF(APPLE)
   SET(CMAKE_C_COMPILER gcc)
   SET(CMAKE_CXX_COMPILER g++)
   # because default is clang(llvm) with mountain lion at least
 ENDIF()
-