0029266: CMake install does not copy pdb files in Debug mode due to the changes in...
[occt.git] / adm / cmake / occt_toolkit_tool.cmake
index 24c9a2c..13a8f07 100644 (file)
@@ -23,11 +23,6 @@ endif()
 
 SET (RCC_FILES)
 foreach (OCCT_PACKAGE ${USED_PACKAGES})
-  file (STRINGS "${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/FILES" SOURCE_FILES_C REGEX ".+[.]c")
-
-  #message("Sources are ${SOURCE_FILES_C}")
-  FIND_AND_WRAP_MOC_FILES("${SOURCE_FILES_C}")
-
   #message("Dir is ${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${OCCT_PACKAGE}.qrc")
   FIND_AND_WRAP_RESOURCE_FILE("${CMAKE_SOURCE_DIR}/${PACKAGE_PREFIX_DIR}/${OCCT_PACKAGE}/${OCCT_PACKAGE}.qrc" RCC_FILES)
 endforeach()
@@ -37,6 +32,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
@@ -170,17 +168,20 @@ foreach (OCCT_MODULE ${OCCT_TOOLS})
   endif()
 endforeach()
 
-if (NOT SINGLE_GENERATOR)
+if (WIN32)
   OCCT_INSERT_CODE_FOR_TARGET ()
 endif()
 
+FIND_AND_WRAP_MOC_FILES("${USED_INCFILES}" "${PROJECT_NAME}_MOC_FILES")
+#message("MOC files: ${${PROJECT_NAME}_MOC_FILES}")
+
 if ("${PROJECT_NAME}" STREQUAL TInspectorEXE)
-  add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RCC_FILES})
+  add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RCC_FILES} ${${PROJECT_NAME}_MOC_FILES})
 
   install (TARGETS ${PROJECT_NAME}
            DESTINATION "${INSTALL_DIR_BIN}\${OCCT_INSTALL_BIN_LETTER}")
 else()
-  add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RCC_FILES})
+  add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE} ${RCC_FILES} ${${PROJECT_NAME}_MOC_FILES})
 
   if (MSVC)
     install (FILES  ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin\${OCCT_INSTALL_BIN_LETTER}/${PROJECT_NAME}.pdb
@@ -245,6 +246,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 "")