0029266: CMake install does not copy pdb files in Debug mode due to the changes in...
[occt.git] / adm / cmake / occt_toolkit.cmake
index 06901e9..1702611 100644 (file)
@@ -11,6 +11,9 @@ set (PRECOMPILED_DEFS)
 
 if (NOT BUILD_SHARED_LIBS)
   list (APPEND PRECOMPILED_DEFS "-DOCCT_NO_PLUGINS")
+  if (WIN32)
+    list (APPEND PRECOMPILED_DEFS "-DHAVE_NO_DLL")
+  endif()
 endif()
 
 # Get all used packages from toolkit
@@ -139,7 +142,7 @@ foreach (OCCT_MODULE ${OCCT_MODULES})
   endif()
 endforeach()
 
-if (NOT SINGLE_GENERATOR)
+if (WIN32)
   OCCT_INSERT_CODE_FOR_TARGET ()
 endif()
 
@@ -152,8 +155,8 @@ else()
   add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE})
 
   if (MSVC)
-    install (FILES  ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb
-             CONFIGURATIONS Debug
+    install (FILES  ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
+             CONFIGURATIONS Debug RelWithDebInfo
              DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
   endif()
 
@@ -213,6 +216,9 @@ foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
     
     if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
       list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
+      if (NOT "${VTK_FOUND}" STREQUAL "" AND BUILD_SHARED_LIBS AND INSTALL_VTK AND COMMAND OCCT_INSTALL_VTK)
+        OCCT_INSTALL_VTK(${USED_ITEM})
+      endif()
     else()
       string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
       if ("${CSF_FOUND}" STREQUAL "")
@@ -278,15 +284,33 @@ if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
       list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT ${VTK_EXCLUDE_LIBRARY})
       if (${VTK_EXCLUDE_LIBRARY} STREQUAL vtkRenderingOpenGL)
         list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingOpenGL2)
+        if(VTK_MAJOR_VERSION GREATER 6)
+          list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT vtkRenderingGL2PSOpenGL2)
+        endif()
       endif()
     endif()
   endforeach()
+else()
+  if(VTK_MAJOR_VERSION EQUAL 6 AND VTK_MINOR_VERSION GREATER 2 OR VTK_MAJOR_VERSION GREATER 6)
+    list (FIND USED_TOOLKITS_BY_CURRENT_PROJECT "vtkRenderingFreeTypeOpenGL" IS_VTK_RENDER_FREETYPE_FOUND)
+    if (NOT ${IS_VTK_RENDER_FREETYPE_FOUND} EQUAL -1)
+      list (REMOVE_ITEM USED_TOOLKITS_BY_CURRENT_PROJECT "vtkRenderingFreeTypeOpenGL")
+    endif()
+  endif()
 endif()
 
 if (BUILD_SHARED_LIBS)
   target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
 endif()
 
+# suppress deprecation warnings inside OCCT itself for old gcc versions with unavailable Standard_DISABLE_DEPRECATION_WARNINGS
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+  if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.0)
+    add_definitions("-DOCCT_NO_DEPRECATED")
+    message (STATUS "Warning: internal deprecation warnings by Standard_DEPRECATED have been disabled due to old gcc version being used")
+  endif()
+endif()
+
 # use Cotire to accelerate build via usage of precompiled headers
 if (BUILD_USE_PCH)
   if (WIN32)
@@ -308,6 +332,7 @@ if (BUILD_USE_PCH)
 
   # workaround for old gcc
   if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+    add_definitions("-D__STDC_CONSTANT_MACROS")
     add_definitions("-D__STDC_FORMAT_MACROS")
   endif()