0024331: CMake scripts improvements
[occt.git] / CMakeLists.txt
index 14750a3..8506681 100644 (file)
@@ -1,19 +1,19 @@
 cmake_minimum_required ( VERSION 2.6)
 
-if (NOT BUILD_TYPE)
-  set(BUILD_TYPE "Release" CACHE STRING "Build type of the OCCT" FORCE)
-  SET_PROPERTY(CACHE BUILD_TYPE PROPERTY STRINGS Release Debug)
+if (NOT BUILD_CONFIGURATION)
+  set(BUILD_CONFIGURATION "Release" CACHE STRING "Build type of OCCT" FORCE)
+  SET_PROPERTY(CACHE BUILD_CONFIGURATION PROPERTY STRINGS Release Debug RelWithDebInfo)
 endif()
 
-set(CMAKE_CONFIGURATION_TYPES ${BUILD_TYPE} CACHE INTERNAL "" FORCE)
+set(CMAKE_CONFIGURATION_TYPES ${BUILD_CONFIGURATION} CACHE INTERNAL "" FORCE)
 
 project(OCCT)
 
-set_property(GLOBAL PROPERTY 3RDPARTY_USE_FOLDERS ON)
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
 set(BUILD_SHARED_LIBS ON)
 
-IF("${BUILD_TYPE}" STREQUAL "${CMAKE_BUILD_TYPE}")
+IF("${BUILD_CONFIGURATION}" STREQUAL "${CMAKE_BUILD_TYPE}")
   SET(CHANGES_ARE_NEEDED OFF)
 ELSE()
   SET(CHANGES_ARE_NEEDED ON)
@@ -21,12 +21,12 @@ ENDIF()
 
 MATH(EXPR COMPILER_BITNESS "32 + 32*(${CMAKE_SIZEOF_VOID_P}/8)")
 
-SET( CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE INTERNAL "Build type of the OCCT" FORCE )
+SET( CMAKE_BUILD_TYPE ${BUILD_CONFIGURATION} CACHE INTERNAL "Build type of OCCT" FORCE )
 
-SET( INSTALL_DIR "" CACHE PATH "Directory contains install files of the OCCT" )
+SET( INSTALL_DIR "" CACHE PATH "Directory that will contain install files of OCCT" )
 SET( CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE )
 
-set (BUILD_TOOLKITS "" CACHE STRING "Toolkits are included in OCCT")
+set (BUILD_TOOLKITS "" CACHE STRING "Toolkits are also included in OCCT")
 separate_arguments(BUILD_TOOLKITS)
 
 include(adm/cmake/CMakeModules.txt)
@@ -37,6 +37,10 @@ else()
   set(SCRIPT_EXT sh)
 endif()
 
+if (MSVC)
+  add_definitions(/fp:precise)
+endif()
+
 # set compiler short name and choose SSE2 option for appropriate MSVC compilers
 if (DEFINED MSVC70)
   SET(COMPILER vc7)
@@ -117,14 +121,14 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/SHMessage" DESTINATION  "${INSTALL_DI
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Textures" DESTINATION  "${INSTALL_DIR}/src" )
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/Shaders" DESTINATION  "${INSTALL_DIR}/src" )
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSMessage" DESTINATION  "${INSTALL_DIR}/src" )
-install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/TObj" DESTINATION  "${INSTALL_DIR}/src" )
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XSTEPResource" DESTINATION  "${INSTALL_DIR}/src" )
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/src/XmlOcafResource" DESTINATION  "${INSTALL_DIR}/src" )
 
 install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Lexi_Expr.dat" DESTINATION  "${INSTALL_DIR}/src/UnitsAPI" )
 install(FILES "${CMAKE_SOURCE_DIR}/src/UnitsAPI/Units.dat"     DESTINATION  "${INSTALL_DIR}/src/UnitsAPI" )
+install(FILES "${CMAKE_SOURCE_DIR}/src/TObj/TObj.msg" DESTINATION  "${INSTALL_DIR}/src/TObj" )
 
-IF("${BUILD_TYPE}" STREQUAL "Release") 
+IF("${BUILD_CONFIGURATION}" STREQUAL "Release") 
   SET(BUILD_SUFFIX "")
 ELSE()
   SET(BUILD_SUFFIX "") # debug == release
@@ -195,13 +199,13 @@ SET(3RDPARTY_INCLUDE_DIRS "")
 SET(3RDPARTY_NOT_INCLUDED)
 
 IF(APPLE)
-  SET(3RDPARTY_USE_GLX OFF CACHE BOOL "whether use X11 OpenGL on OSX or not")
+  SET(USE_GLX OFF CACHE BOOL "whether use X11 OpenGL on OSX or not")
 ENDIF()
 
-SET(3RDPARTY_USE_GL2PS OFF CACHE BOOL "whether use gl2ps product or not")
-SET(3RDPARTY_USE_FREEIMAGE OFF CACHE BOOL "whether use freeimage product or not")
-SET(3RDPARTY_USE_TBB OFF CACHE BOOL "whether use tbb product or not")
-SET(3RDPARTY_USE_OPENCL OFF CACHE BOOL "whether use OpenCL or not")
+SET(USE_GL2PS OFF CACHE BOOL "whether use gl2ps product or not")
+SET(USE_FREEIMAGE OFF CACHE BOOL "whether use freeimage product or not")
+SET(USE_TBB OFF CACHE BOOL "whether use tbb product or not")
+SET(USE_OPENCL OFF CACHE BOOL "whether use OpenCL or not")
 
 SET(INSTALL_TESTS OFF CACHE BOOL "Is tests copy to install directory")
 
@@ -228,12 +232,12 @@ MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
     ENDIF()
     
     IF("${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND")
-      SET(3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Directory contains library of the ${PRODUCT_NAME} product" FORCE)
+      SET(3RDPARTY_${PRODUCT_NAME}_LIBRARY "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND" CACHE FILEPATH "Path to library of the ${PRODUCT_NAME} product" FORCE)
       FIND_LIBRARY(3RDPARTY_${PRODUCT_NAME}_LIBRARY ${LIBRARY_NAME}  PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/lib" NO_DEFAULT_PATH)
     ENDIF()
     
     IF("${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_DLL}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND")
-      SET(3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Directory contains shared library of the ${PRODUCT_NAME} product" FORCE)
+      SET(3RDPARTY_${PRODUCT_NAME}_DLL "3RDPARTY_${PRODUCT_NAME}_DLL-NOTFOUND" CACHE FILEPATH "Path to shared library of the ${PRODUCT_NAME} product" FORCE)
       FIND_FILE(3RDPARTY_${PRODUCT_NAME}_DLL "${DLL_SO_PREFIX}${LIBRARY_NAME}.${DLL_SO}"  PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/${DLL_SO_FOLDER}" NO_DEFAULT_PATH)
     ENDIF()
     
@@ -288,28 +292,37 @@ MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
 ENDMACRO()
 
 # TCL
+INCLUDE(adm/templates/tcl.cmake)
 
-#tcl85 - win; tcl8.5 - lin
-IF(WIN32)
-  SET(TCL_SEP "")
-ELSE()
-  SET(TCL_SEP ".")
-ENDIF()
+#install tcltk
+IF(INSTALL_TCL)
+  GET_FILENAME_COMPONENT(3RDPARTY_TCL_LIB_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
+  GET_FILENAME_COMPONENT(3RDPARTY_TCL_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
   
-THIRDPARTY_PRODUCT("TCL" "tcl.h" "tcl8${TCL_SEP}5")
+  IF (IS_TCL_VERSION_FOUND)
+    SET (TCL_VERSION ${TCL_MAJOR_VERSION}${TCL_SEP}${TCL_MINOR_VERSION})
+    SET (TCL_FOLDER_VERSION ${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION})
+  ELSE()
+    SET (TCL_VERSION "")
 
-#install tk and libs
-IF(INSTALL_TCL)
-  GET_FILENAME_COMPONENT(3RDPARTY_TK_LIB_DIR "${3RDPARTY_TCL_LIBRARY}" PATH)
-  GET_FILENAME_COMPONENT(3RDPARTY_TK_DLL_DIR "${3RDPARTY_TCL_DLL}" PATH)
+    #TODO SEARCH tclX.X & tkX.X subdirs
+    SET (TCL_FOLDER_VERSION "")
+  ENDIF()
+  
+  INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR}/${DLL_SO_PREFIX}tcl${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
+  INSTALL(FILES "${3RDPARTY_TCL_DLL_DIR}/${DLL_SO_PREFIX}tk${TCL_VERSION}.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
   
-  INSTALL(FILES "${3RDPARTY_TK_DLL_DIR}/${DLL_SO_PREFIX}tk8${TCL_SEP}5.${DLL_SO}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
-  INSTALL(DIRECTORY "${3RDPARTY_TK_LIB_DIR}/tcl8.5" DESTINATION "${INSTALL_DIR}/lib")
-  INSTALL(DIRECTORY "${3RDPARTY_TK_LIB_DIR}/tk8.5" DESTINATION "${INSTALL_DIR}/lib")
+  IF (IS_TCL_VERSION_FOUND)
+    INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR}/tcl${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib")
+    INSTALL(DIRECTORY "${3RDPARTY_TCL_LIB_DIR}/tk${TCL_FOLDER_VERSION}" DESTINATION "${INSTALL_DIR}/lib")
+  ELSE()
+    MESSAGE(STATUS "\nWarning: tclX.X and tkX.X subdirs won't be copyied during the installation process.")
+    MESSAGE(STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.")
+  ENDIF()
 ENDIF()
 
 # GLX
-IF(3RDPARTY_USE_GLX)
+IF(USE_GLX)
   ADD_DEFINITIONS(-DMACOSX_USE_GLX)
   
   IF(NOT DEFINED 3RDPARTY_GLX_DIR)
@@ -349,7 +362,7 @@ ELSEIF(EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2/")
 ENDIF()
 
 # FREEIMAGE
-IF(3RDPARTY_USE_FREEIMAGE)
+IF(USE_FREEIMAGE)
   ADD_DEFINITIONS(-DHAVE_FREEIMAGE) 
 
   THIRDPARTY_PRODUCT("FREEIMAGE" "FreeImage.h" "freeimage${BUILD_SUFFIX}")
@@ -365,13 +378,13 @@ IF(3RDPARTY_USE_FREEIMAGE)
 ENDIF()
 
 # GL2PS
-IF(3RDPARTY_USE_GL2PS)
+IF(USE_GL2PS)
   ADD_DEFINITIONS(-DHAVE_GL2PS)
   THIRDPARTY_PRODUCT("GL2PS" "gl2ps.h" "gl2ps${BUILD_SUFFIX}")
 ENDIF()
 
 # OPENCL
-IF(3RDPARTY_USE_OPENCL)
+IF(USE_OPENCL)
   ADD_DEFINITIONS(-DHAVE_OPENCL) 
   
   SET (3RDPARTY_OPENCL_ADDITIONAL_PATH_FOR_HEADER $ENV{AMDAPPSDKROOT}/include
@@ -401,117 +414,11 @@ IF(3RDPARTY_USE_OPENCL)
 ENDIF()
 
 # TBB
-IF (3RDPARTY_USE_TBB)
+IF (USE_TBB)
   ADD_DEFINITIONS(-DHAVE_TBB)
 
-  IF(${COMPILER_BITNESS} STREQUAL 32)
-    SET (TBB_ARCH_NAME ia32)
-  ELSE()
-    SET (TBB_ARCH_NAME intel64)
-  ENDIF()
-  
-  IF(NOT DEFINED 3RDPARTY_TBB_DIR)
-    SET(3RDPARTY_TBB_DIR "" CACHE PATH "Directory contains tbb product")
-  ENDIF()
-  
-  SET(3RDPARTY_TBB_DIR_NAME "")
-  IF(3RDPARTY_DIR AND ("${3RDPARTY_TBB_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED))
-    FIND_PRODUCT_DIR("${3RDPARTY_DIR}" "TBB" 3RDPARTY_TBB_DIR_NAME)
-    IF("${3RDPARTY_TBB_DIR_NAME}" STREQUAL "")
-      MESSAGE(STATUS "TBB DON'T FIND")
-    ELSE()
-      SET(3RDPARTY_TBB_DIR "${3RDPARTY_DIR}/${3RDPARTY_TBB_DIR_NAME}" CACHE PATH "Directory contains tbb product" FORCE)
-    ENDIF()
-  ENDIF()
-  
-  SET(INSTALL_TBB OFF CACHE BOOL "Is tbb lib copy to install directory")
-
-  IF(3RDPARTY_TBB_DIR)
-    IF("${3RDPARTY_TBB_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED)
-      SET(3RDPARTY_TBB_INCLUDE_DIR "3RDPARTY_TBB_INCLUDE_DIR-NOTFOUND" CACHE PATH "Directory contains headers of the tbb product" FORCE)
-      FIND_PATH(3RDPARTY_TBB_INCLUDE_DIR tbb/tbb.h PATHS "${3RDPARTY_TBB_DIR}/include")
-    ENDIF()
-
-    SET(TBB_DEBUG_POSTFIX "")
-    if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-      SET(TBB_DEBUG_POSTFIX "") # _debug postfix removed
-    ENDIF()
-    
-    IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
-      SET(3RDPARTY_TBB_LIBRARY "3RDPARTY_TBB_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb product" FORCE)
-      FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
-      
-      IF("${3RDPARTY_TBB_LIBRARY}" STREQUAL "3RDPARTY_TBB_LIBRARY-NOTFOUND")
-        FIND_LIBRARY(3RDPARTY_TBB_LIBRARY tbb${TBB_DEBUG_POSTFIX})
-      ENDIF()
-    ENDIF()
-
-    IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
-      SET(3RDPARTY_TBB_MALLOC_LIBRARY "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND" CACHE PATH "Directory contains library of the tbb malloc product" FORCE)
-      FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX} PATHS "${3RDPARTY_TBB_DIR}/lib/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
-      
-      IF("${3RDPARTY_TBB_MALLOC_LIBRARY}" STREQUAL "3RDPARTY_TBB_MALLOC_LIBRARY-NOTFOUND")
-        FIND_LIBRARY(3RDPARTY_TBB_MALLOC_LIBRARY tbbmalloc${TBB_DEBUG_POSTFIX})
-      ENDIF()
-    ENDIF()
-    
-    
-    
-    IF("${3RDPARTY_TBB_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
-      SET(3RDPARTY_TBB_DLL "3RDPARTY_TBB_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb product" FORCE)
-      FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
-      
-      IF("${3RDPARTY_TBB_DLL}" STREQUAL "3RDPARTY_TBB_DLL-NOTFOUND")
-        FIND_FILE(3RDPARTY_TBB_DLL "${DLL_SO_PREFIX}tbb${TBB_DEBUG_POSTFIX}.${DLL_SO}")
-      ENDIF()
-    ENDIF()
-    
-    IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "" OR CHANGES_ARE_NEEDED)
-      SET(3RDPARTY_TBB_MALLOC_DLL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND" CACHE PATH "Directory contains shared library of the tbb malloc product" FORCE)
-      FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}" PATHS "${3RDPARTY_TBB_DIR}/${DLL_SO_FOLDER}/${TBB_ARCH_NAME}/${COMPILER}" NO_DEFAULT_PATH)
-      
-      IF("${3RDPARTY_TBB_MALLOC_DLL}" STREQUAL "3RDPARTY_TBB_MALLOC_DLL-NOTFOUND")
-        FIND_FILE(3RDPARTY_TBB_MALLOC_DLL "${DLL_SO_PREFIX}tbbmalloc${TBB_DEBUG_POSTFIX}.${DLL_SO}")
-      ENDIF()
-    ENDIF()
-
-    MARK_AS_ADVANCED(3RDPARTY_TBB_DIR_NAME)
-  ELSE()
-    LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DIR)
-  ENDIF()
-
-  IF(3RDPARTY_TBB_INCLUDE_DIR)
-    SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_TBB_INCLUDE_DIR}")
-  ELSE()
-    LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_INCLUDE_DIR)
-  ENDIF()
-
-  IF(3RDPARTY_TBB_LIBRARY)
-    GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_LIBRARY}" PATH)
-    SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
-  ELSE()
-    LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_LIBRARY)
-  ENDIF()
-  
-  IF(3RDPARTY_TBB_MALLOC_LIBRARY)
-    GET_FILENAME_COMPONENT(3RDPARTY_TBB_LIBRARY_DIR "${3RDPARTY_TBB_MALLOC_LIBRARY}" PATH)
-    SET(3RDPARTY_LIBRARY_DIRS "${3RDPARTY_LIBRARY_DIRS};${3RDPARTY_TBB_LIBRARY_DIR}")
-  ELSE()
-    LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_LIBRARY)
-  ENDIF()
+  INCLUDE(adm/templates/tbb.cmake)
   
-  IF(3RDPARTY_TBB_DLL)
-    #
-  ELSE()
-    LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_DLL)
-  ENDIF()
-  
-  IF(3RDPARTY_TBB_MALLOC_DLL)
-    #
-  ELSE()
-    LIST(APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_TBB_MALLOC_DLL)
-  ENDIF()
-
   IF(INSTALL_TBB)
     INSTALL(FILES "${3RDPARTY_TBB_DLL}" "${3RDPARTY_TBB_MALLOC_DLL}" DESTINATION "${INSTALL_DIR}/${DLL_SO_FOLDER}")
 
@@ -557,15 +464,15 @@ ELSE()
   ENDIF()
 
   # DRAW.BAT or DRAW.SH
-  install(FILES "${CMAKE_SOURCE_DIR}/adm/cmake/draw.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" PERMISSIONS  OWNER_READ OWNER_WRITE OWNER_EXECUTE 
+  install(FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" PERMISSIONS  OWNER_READ OWNER_WRITE OWNER_EXECUTE 
                                                                               GROUP_READ GROUP_WRITE GROUP_EXECUTE 
                                                                               WORLD_READ WORLD_WRITE WORLD_EXECUTE)
 
-  configure_file("${CMAKE_SOURCE_DIR}/adm/cmake/env.${SCRIPT_EXT}.in" env.${SCRIPT_EXT} @ONLY)
+  configure_file("${CMAKE_SOURCE_DIR}/adm/templates/env.${SCRIPT_EXT}.in" env.${SCRIPT_EXT} @ONLY)
   install(FILES "${OCCT_BINARY_DIR}/env.${SCRIPT_EXT}" DESTINATION  "${INSTALL_DIR}" )
 ENDIF()
 
-IF(MSVC AND "${BUILD_TYPE}" STREQUAL "Debug")
+IF(MSVC AND "${BUILD_CONFIGURATION}" STREQUAL "Debug")
   SET(RUN_PROJECT "start OCCT.sln")
   SET(BIN_DIR_POSTFIX "out\\bin\\Debug")
   SET(RESOURCE_DIR_PREFIX "%CASROOT%\\src")