0027040: IVtk does not compile after configuring with CMake
authoribs <ibs@opencascade.com>
Mon, 28 Dec 2015 09:11:39 +0000 (12:11 +0300)
committerabv <abv@opencascade.com>
Mon, 11 Jan 2016 22:55:36 +0000 (01:55 +0300)
hardcoded C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x64/d3d9.lib is removed from any vtk toolkit

adm/cmake/vtk.cmake
dox/dev_guides/building/cmake/cmake.md

index d49f30f..2efb662 100644 (file)
@@ -73,6 +73,8 @@ if (VTK_FOUND)
     set (3RDPARTY_VTK_LIBRARY_DIRS)
     set (3RDPARTY_VTK_DLL_DIRS)
 
     set (3RDPARTY_VTK_LIBRARY_DIRS)
     set (3RDPARTY_VTK_DLL_DIRS)
 
+    set (HARDCODED_D3D9_LIB "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x64/d3d9.lib")
+
     foreach (VTK_LIBRARY ${VTK_LIBRARIES})
       string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
       if (IS_VTK_LIBRARY)
     foreach (VTK_LIBRARY ${VTK_LIBRARIES})
       string (REGEX MATCH "^vtk" IS_VTK_LIBRARY ${VTK_LIBRARY})
       if (IS_VTK_LIBRARY)
@@ -93,7 +95,7 @@ if (VTK_FOUND)
         endif()
 
         # get paths from corresponding properties
         endif()
 
         # get paths from corresponding properties
-        get_property (TARGET_VTK_IMPORT_CONFS TARGET ${VTK_LIBRARY} PROPERTY IMPORTED_CONFIGURATIONS)
+        get_target_property (TARGET_VTK_IMPORT_CONFS ${VTK_LIBRARY} IMPORTED_CONFIGURATIONS)
 
         if (TARGET_VTK_IMPORT_CONFS)
           list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
 
         if (TARGET_VTK_IMPORT_CONFS)
           list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
@@ -104,13 +106,24 @@ if (VTK_FOUND)
           #  endforeach()
           #endif()
 
           #  endforeach()
           #endif()
 
-          get_property (TARGET_PROPERTY_IMP_PATH TARGET ${VTK_LIBRARY} PROPERTY IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
+          get_target_property (TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${VTK_LIBRARY} IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF})
+          if(TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES)
+            list (FIND TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES "${HARDCODED_D3D9_LIB}" D3D9_INDEX)
+            if (NOT D3D9_INDEX EQUAL -1)
+              message (STATUS "Warning: ${HARDCODED_D3D9_LIB} has been removed from ${VTK_LIBRARY}")
+              
+              list (REMOVE_AT TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES ${D3D9_INDEX})
+              set_target_properties (${VTK_LIBRARY} PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES_${CHOSEN_IMPORT_CONF} "${TARGET_PROPERTY_IMP_LINK_INTERFACE_LIBRARIES}")
+            endif()            
+          endif()
+
+          get_target_property (TARGET_PROPERTY_IMP_PATH ${VTK_LIBRARY} IMPORTED_IMPLIB_${CHOSEN_IMPORT_CONF})
           if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
             get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
             list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
           endif()
 
           if(TARGET_PROPERTY_IMP_PATH AND EXISTS "${TARGET_PROPERTY_IMP_PATH}")
             get_filename_component (TARGET_PROPERTY_IMP_DIR "${TARGET_PROPERTY_IMP_PATH}" PATH)
             list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_IMP_DIR}")
           endif()
 
-          get_property (TARGET_PROPERTY_LOCATION_PATH TARGET ${VTK_LIBRARY} PROPERTY IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
+          get_target_property (TARGET_PROPERTY_LOCATION_PATH ${VTK_LIBRARY} IMPORTED_LOCATION_${CHOSEN_IMPORT_CONF})
           if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
             get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
 
           if(TARGET_PROPERTY_LOCATION_PATH AND EXISTS "${TARGET_PROPERTY_LOCATION_PATH}")
             get_filename_component (TARGET_PROPERTY_LOCATION_DIR "${TARGET_PROPERTY_LOCATION_PATH}" PATH)
 
index a9d85bc..9c28bba 100644 (file)
@@ -3,7 +3,7 @@ Building with CMake {#occt_dev_guides__building_cmake}
 
 @tableofcontents
 
 
 @tableofcontents
 
-This article describes **CMake**-based build process which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 3.0 or later*.
+This article describes **CMake**-based build process which is now suggested as a standard way to produce the binaries of Open CASCADE Technology from sources. *OCCT requires CMake version 2.8.12 or later*.
 
 **Note**: Comparing to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.0 comes with a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive which is a significant advantage over the legacy WOK utilities.
 
 
 **Note**: Comparing to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.0 comes with a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive which is a significant advantage over the legacy WOK utilities.