mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-04 18:06:22 +03:00
0026993: Configuration, CMake - use the abstraction level of VTK instead CSF_VTK for their libraries
CSF_VTK removed from CMake meta-projects (this variable is left in EXTERNLIB because it is used by genproj.tcl) USE_VTK shown if toolkits using VTK involved in the solution VTK_DIR removed from the advanced variables Warning messages 'Warning. .../a.hxx~ is not involved into .../FILES' renamed with 'Warning: File .../a.hxx~ is not listed in .../FILES'
This commit is contained in:
parent
dfadf64138
commit
a687470889
@ -72,8 +72,6 @@ if (WIN32)
|
||||
set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}")
|
||||
endif()
|
||||
|
||||
set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
|
||||
|
||||
# include occt macros
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
@ -94,11 +92,6 @@ endif()
|
||||
# Overview
|
||||
set (BUILD_DOC_OcctOverview OFF CACHE BOOL "${BUILD_DOC_OcctOverview_DESCR}")
|
||||
|
||||
if (NOT USE_VTK)
|
||||
list (REMOVE_ITEM Visualization_TOOLKITS TKIVtk)
|
||||
list (REMOVE_ITEM Draw_TOOLKITS TKIVtkDraw)
|
||||
endif()
|
||||
|
||||
if (NOT USE_D3D)
|
||||
list (REMOVE_ITEM Visualization_TOOLKITS TKD3DHost)
|
||||
endif()
|
||||
@ -134,6 +127,20 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_defs_flags")
|
||||
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/3rdparty_macro")
|
||||
|
||||
# search for TKIVtk and TKIVtkDraw in BUILD_TOOLKITS
|
||||
list (FIND BUILD_TOOLKITS TKIVtk CAN_USE_VTK)
|
||||
if (CAN_USE_VTK EQUAL -1)
|
||||
list (FIND BUILD_TOOLKITS TKIVtkDraw CAN_USE_VTK)
|
||||
endif()
|
||||
|
||||
if (NOT CAN_USE_VTK EQUAL -1)
|
||||
if (NOT DEFINED USE_VTK)
|
||||
set (USE_VTK OFF CACHE BOOL "${USE_VTK_DESCR}")
|
||||
endif()
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET (USE_VTK)
|
||||
endif()
|
||||
|
||||
# Rebuild *.yacc and *.lex files that are contained by TKMath toolkit
|
||||
list (FIND BUILD_TOOLKITS TKMath CAN_REBUILD_PDC_FOR_TKMATH)
|
||||
list (FIND BUILD_TOOLKITS StepFile CAN_REBUILD_PDC_FOR_STEPFILE)
|
||||
@ -185,7 +192,13 @@ if (USE_VTK)
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk")
|
||||
else()
|
||||
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK")
|
||||
#OCCT_CHECK_AND_UNSET ("INSTALL_VTK")
|
||||
|
||||
if (NOT CAN_USE_VTK EQUAL -1)
|
||||
message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled")
|
||||
|
||||
list (REMOVE_ITEM BUILD_TOOLKITS TKIVtk)
|
||||
list (REMOVE_ITEM BUILD_TOOLKITS TKIVtkDraw)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# D3D
|
||||
@ -317,7 +330,7 @@ endif()
|
||||
if (3RDPARTY_INCLUDE_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
|
||||
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
|
||||
message (STATUS "The directories containing 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
|
||||
message (STATUS "Info: The directories of 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
|
||||
include_directories (${3RDPARTY_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
@ -327,7 +340,7 @@ include_directories (${CMAKE_BINARY_DIR}/inc)
|
||||
if (3RDPARTY_LIBRARY_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
|
||||
string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
|
||||
message (STATUS "The directories containing 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
|
||||
message (STATUS "Info: The directories of 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
|
||||
link_directories (${3RDPARTY_LIBRARY_DIRS})
|
||||
endif()
|
||||
|
||||
|
@ -12,20 +12,16 @@ endif()
|
||||
|
||||
if (USE_TCL)
|
||||
if ("${3RDPARTY_TCL_LIBRARY_VERSION}" STREQUAL "")
|
||||
message (STATUS "Warning. TCL version has not been specified by CSF_TclLibs defining thus it will be used as 8.6")
|
||||
message (STATUS "Warning: TCL version has not been specified by CSF_TclLibs defining thus it will be used as 8.6")
|
||||
set (3RDPARTY_TCL_LIBRARY_VERSION "8.6")
|
||||
endif()
|
||||
|
||||
if ("${3RDPARTY_TK_LIBRARY_VERSION}" STREQUAL "")
|
||||
message (STATUS "Warning. TK version has not been specified by CSF_TclTkLibs defining thus it will be used as 8.6")
|
||||
message (STATUS "Warning: TK version has not been specified by CSF_TclTkLibs defining thus it will be used as 8.6")
|
||||
set (3RDPARTY_TK_LIBRARY_VERSION "8.6")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (USE_VTK AND NOT 3RDPARTY_VTK_REQUIRED_LIBRARIES)
|
||||
message (WARNING "CSF_VTK specification: VTK libraries are not defined")
|
||||
endif()
|
||||
|
||||
if (USE_TBB)
|
||||
set (CSF_TBB "tbb tbbmalloc")
|
||||
else()
|
||||
@ -45,12 +41,6 @@ if (WIN32)
|
||||
set (CSF_TclTkLibs "tk${3RDPARTY_TK_LIBRARY_VERSION}.lib")
|
||||
endif()
|
||||
|
||||
if (USE_VTK)
|
||||
set (CSF_VTK "${3RDPARTY_VTK_REQUIRED_LIBRARIES}")
|
||||
else()
|
||||
set (CSF_VTK)
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
if (APPLE)
|
||||
@ -113,10 +103,4 @@ else()
|
||||
set (CSF_GL2PS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (USE_VTK)
|
||||
set (CSF_VTK "${3RDPARTY_VTK_REQUIRED_LIBRARIES}")
|
||||
else()
|
||||
set (CSF_VTK)
|
||||
endif()
|
||||
endif()
|
@ -37,41 +37,41 @@ endif()
|
||||
# remove _WINDOWS flag if it exists
|
||||
string (REGEX MATCH "/D_WINDOWS" IS_WINDOWSFLAG "${CMAKE_CXX_FLAGS}")
|
||||
if (IS_WINDOWSFLAG)
|
||||
message (STATUS "/D_WINDOWS has been removed from CMAKE_CXX_FLAGS")
|
||||
message (STATUS "Info: /D_WINDOWS has been removed from CMAKE_CXX_FLAGS")
|
||||
string (REGEX REPLACE "/D_WINDOWS" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
# remove WIN32 flag if it exists
|
||||
string (REGEX MATCH "/DWIN32" IS_WIN32FLAG "${CMAKE_CXX_FLAGS}")
|
||||
if (IS_WIN32FLAG)
|
||||
message (STATUS "/DWIN32 has been removed from CMAKE_CXX_FLAGS")
|
||||
message (STATUS "Info: /DWIN32 has been removed from CMAKE_CXX_FLAGS")
|
||||
string (REGEX REPLACE "/DWIN32" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
# remove _WINDOWS flag if it exists
|
||||
string (REGEX MATCH "/D_WINDOWS" IS_WINDOWSFLAG "${CMAKE_C_FLAGS}")
|
||||
if (IS_WINDOWSFLAG)
|
||||
message (STATUS "/D_WINDOWS has been removed from CMAKE_C_FLAGS")
|
||||
message (STATUS "Info: /D_WINDOWS has been removed from CMAKE_C_FLAGS")
|
||||
string (REGEX REPLACE "/D_WINDOWS" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
# remove WIN32 flag if it exists
|
||||
string (REGEX MATCH "/DWIN32" IS_WIN32FLAG "${CMAKE_C_FLAGS}")
|
||||
if (IS_WIN32FLAG)
|
||||
message (STATUS "/DWIN32 has been removed from CMAKE_C_FLAGS")
|
||||
message (STATUS "Info: /DWIN32 has been removed from CMAKE_C_FLAGS")
|
||||
string (REGEX REPLACE "/DWIN32" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
||||
endif()
|
||||
|
||||
# remove DEBUG flag if it exists
|
||||
string (REGEX MATCH "-DDEBUG" IS_DEBUG_CXX "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
if (IS_DEBUG_CXX)
|
||||
message (STATUS "-DDEBUG has been removed from CMAKE_CXX_FLAGS_DEBUG")
|
||||
message (STATUS "Info: -DDEBUG has been removed from CMAKE_CXX_FLAGS_DEBUG")
|
||||
string (REGEX REPLACE "-DDEBUG" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
string (REGEX MATCH "-DDEBUG" IS_DEBUG_C "${CMAKE_C_FLAGS_DEBUG}")
|
||||
if (IS_DEBUG_C)
|
||||
message (STATUS "-DDEBUG has been removed from CMAKE_C_FLAGS_DEBUG")
|
||||
message (STATUS "Info: -DDEBUG has been removed from CMAKE_C_FLAGS_DEBUG")
|
||||
string (REGEX REPLACE "-DDEBUG" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
|
||||
endif()
|
||||
# enable parallel compilation on MSVC 9 and above
|
||||
|
@ -206,7 +206,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
set (OCCT_HEADER_FILE_WITH_PROPER_NAMES)
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "Info. \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) Compare FILES with files in package directories...")
|
||||
|
||||
foreach (OCCT_PACKAGE ${OCCT_USED_PACKAGES})
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
||||
@ -252,7 +252,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
endforeach()
|
||||
|
||||
if (NOT OCCT_FILE_IN_DIR_STATUS)
|
||||
message (STATUS "Warning. ${OCCT_FILE_IN_DIR} is not involved into ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
||||
message (STATUS "Warning. File ${OCCT_FILE_IN_DIR} is not listed in ${CMAKE_SOURCE_DIR}/src/${OCCT_PACKAGE}/FILES")
|
||||
|
||||
string (REGEX MATCH ".+\\.[hlg]xx|.+\\.h$" IS_HEADER_FOUND "${OCCT_FILE_NAME}")
|
||||
if (IS_HEADER_FOUND)
|
||||
@ -267,7 +267,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
|
||||
# create new file including found header
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "Info. \(${CURRENT_TIME}\) Create header-links in inc folder...")
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) Create header-links in inc folder...")
|
||||
|
||||
foreach (OCCT_HEADER_FILE ${OCCT_HEADER_FILES_COMPLETE})
|
||||
get_filename_component (HEADER_FILE_NAME ${OCCT_HEADER_FILE} NAME)
|
||||
@ -277,7 +277,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO
|
||||
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/inc")
|
||||
|
||||
string(TIMESTAMP CURRENT_TIME "%H:%M:%S")
|
||||
message (STATUS "Info. \(${CURRENT_TIME}\) Checking headers in inc folder...")
|
||||
message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...")
|
||||
|
||||
file (GLOB OCCT_HEADER_FILES_OLD "${ROOT_TARGET_OCCT_DIR}/inc/*")
|
||||
foreach (OCCT_HEADER_FILE_OLD ${OCCT_HEADER_FILES_OLD})
|
||||
|
@ -93,7 +93,7 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
|
||||
foreach(HEADER_FILE ${HEADER_FILES})
|
||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
message (STATUS "Info: consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
list (APPEND USED_INCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
SOURCE_GROUP ("Header Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${HEADER_FILE}")
|
||||
else()
|
||||
@ -104,7 +104,7 @@ foreach (OCCT_PACKAGE ${USED_PACKAGES})
|
||||
|
||||
foreach(SOURCE_FILE ${SOURCE_FILES})
|
||||
if (APPLY_OCCT_PATCH_DIR AND EXISTS "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
message (STATUS "Info. consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
message (STATUS "Info: consider patched file: ${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
list (APPEND USED_SRCFILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
SOURCE_GROUP ("Source Files\\${OCCT_PACKAGE}" FILES "${APPLY_OCCT_PATCH_DIR}/src/${OCCT_PACKAGE}/${SOURCE_FILE}")
|
||||
else()
|
||||
@ -184,19 +184,24 @@ set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT)
|
||||
# parce EXTERNLIB file
|
||||
FILE_TO_LIST ("src/${PROJECT_NAME}/EXTERNLIB" USED_EXTERNLIB_AND_TOOLKITS)
|
||||
foreach (USED_ITEM ${USED_EXTERNLIB_AND_TOOLKITS})
|
||||
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
|
||||
if (NOT "${TK_FOUND}" STREQUAL "")
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
|
||||
else()
|
||||
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
|
||||
if ("${CSF_FOUND}" STREQUAL "")
|
||||
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
|
||||
else() # get CSF_ value
|
||||
set (CURRENT_CSF ${${USED_ITEM}})
|
||||
if (NOT "${CURRENT_CSF}" STREQUAL "")
|
||||
# prepare a list from a string with whitespaces
|
||||
separate_arguments (CURRENT_CSF)
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
|
||||
string (REGEX MATCH "^ *#" COMMENT_FOUND ${USED_ITEM})
|
||||
if (NOT COMMENT_FOUND)
|
||||
string (REGEX MATCH "^TK" TK_FOUND ${USED_ITEM})
|
||||
string (REGEX MATCH "^vtk" VTK_FOUND ${USED_ITEM})
|
||||
|
||||
if (NOT "${TK_FOUND}" STREQUAL "" OR NOT "${VTK_FOUND}" STREQUAL "")
|
||||
list (APPEND USED_TOOLKITS_BY_CURRENT_PROJECT ${USED_ITEM})
|
||||
else()
|
||||
string (REGEX MATCH "^CSF_" CSF_FOUND ${USED_ITEM})
|
||||
if ("${CSF_FOUND}" STREQUAL "")
|
||||
message (STATUS "Info: ${USED_ITEM} from ${PROJECT_NAME} skipped due to it is empty")
|
||||
else() # get CSF_ value
|
||||
set (CURRENT_CSF ${${USED_ITEM}})
|
||||
if (NOT "${CURRENT_CSF}" STREQUAL "")
|
||||
# prepare a list from a string with whitespaces
|
||||
separate_arguments (CURRENT_CSF)
|
||||
list (APPEND USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT ${CURRENT_CSF})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -207,7 +212,7 @@ if (APPLE)
|
||||
if (NOT ${IS_X11_FOUND} EQUAL -1)
|
||||
find_package (X11 COMPONENTS X11 Xext Xmu Xi)
|
||||
if (NOT X11_FOUND)
|
||||
message (STATUS "Warning. X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
|
||||
message (STATUS "Warning: X11 is not found. It's required to install The XQuartz project: http://www.xquartz.org")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@ -255,7 +255,7 @@ if (TK_FOUND AND 3RDPARTY_TCL_DIR)
|
||||
|
||||
if (${THE_SAME_FOLDER} EQUAL 0)
|
||||
set (3RDPARTY_TCLTK_DIR "${3RDPARTY_TCL_DIR}")
|
||||
message (STATUS "Info. TK is used from TCL folder: ${3RDPARTY_TCLTK_DIR}")
|
||||
message (STATUS "Info: TK is used from TCL folder: ${3RDPARTY_TCLTK_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -9,21 +9,6 @@ if (NOT DEFINED 3RDPARTY_VTK_DIR)
|
||||
set (3RDPARTY_VTK_DIR "" CACHE PATH "The directory containing VTK")
|
||||
endif()
|
||||
|
||||
set (3RDPARTY_VTK_REQUIRED_LIBRARIES vtkCommonCore
|
||||
vtkCommonDataModel
|
||||
vtkCommonExecutionModel
|
||||
vtkCommonMath
|
||||
vtkCommonTransforms
|
||||
vtkRenderingCore
|
||||
vtkRenderingFreeType
|
||||
vtkRenderingFreeTypeOpenGL
|
||||
vtkRenderingOpenGL
|
||||
vtkFiltersGeneral
|
||||
vtkIOCore
|
||||
vtkIOImage
|
||||
vtkImagingCore
|
||||
vtkInteractionStyle)
|
||||
|
||||
# include occt macros. compiler_bitness, os_wiht_bit, compiler
|
||||
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros")
|
||||
|
||||
@ -82,97 +67,84 @@ if (VTK_FOUND)
|
||||
# add compiler flags, preprocessor definitions, include and link dirs
|
||||
include (${VTK_USE_FILE})
|
||||
|
||||
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND ON)
|
||||
if (VTK_LIBRARIES)
|
||||
|
||||
set (3RDPARTY_VTK_INCLUDE_DIRS)
|
||||
set (3RDPARTY_VTK_LIBRARY_DIRS)
|
||||
set (3RDPARTY_VTK_DLL_DIRS)
|
||||
|
||||
foreach (VTK_REQUIRED_LIBRARY ${3RDPARTY_VTK_REQUIRED_LIBRARIES})
|
||||
list (FIND VTK_LIBRARIES ${VTK_REQUIRED_LIBRARY} FOUND_INDEX)
|
||||
if (${FOUND_INDEX} EQUAL -1)
|
||||
message (WARNING "VTK: required ${VTK_REQUIRED_LIBRARY} library is not found")
|
||||
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND OFF)
|
||||
else()
|
||||
# get paths from corresponding variables
|
||||
if (${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_REQUIRED_LIBRARY}_INCLUDE_DIRS}")
|
||||
foreach (VTK_LIBRARY ${VTK_LIBRARIES})
|
||||
# get paths from corresponding variables
|
||||
if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_LIBRARY_DIRS}")
|
||||
endif()
|
||||
|
||||
if (${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
if (NOT WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# get paths from corresponding properties
|
||||
get_property (TARGET_VTK_IMPORT_CONFS TARGET ${VTK_LIBRARY} PROPERTY IMPORTED_CONFIGURATIONS)
|
||||
|
||||
if (TARGET_VTK_IMPORT_CONFS)
|
||||
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
|
||||
# todo: choose configuration in connection with the build type
|
||||
#if (CMAKE_BUILD_TYPE)
|
||||
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
|
||||
# endforeach()
|
||||
#endif()
|
||||
|
||||
get_property (TARGET_PROPERTY_IMP_PATH TARGET ${VTK_LIBRARY} PROPERTY 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 (${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_REQUIRED_LIBRARY}_LIBRARY_DIRS}")
|
||||
endif()
|
||||
get_property (TARGET_PROPERTY_LOCATION_PATH TARGET ${VTK_LIBRARY} PROPERTY 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 (${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS AND EXISTS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
if (NOT WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${${VTK_REQUIRED_LIBRARY}_RUNTIME_LIBRARY_DIRS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# get paths from corresponding properties
|
||||
get_property (TARGET_VTK_IMPORT_CONFS TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY IMPORTED_CONFIGURATIONS)
|
||||
|
||||
if (TARGET_VTK_IMPORT_CONFS)
|
||||
list (GET TARGET_VTK_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
|
||||
|
||||
# todo: choose configuration in connection with the build type
|
||||
#if (CMAKE_BUILD_TYPE)
|
||||
# foreach (IMPORT_CONF ${TARGET_VTK_IMPORT_CONFS})
|
||||
# endforeach()
|
||||
#endif()
|
||||
|
||||
get_property (TARGET_PROPERTY_IMP_PATH TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY 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()
|
||||
|
||||
get_property (TARGET_PROPERTY_LOCATION_PATH TARGET ${VTK_REQUIRED_LIBRARY} PROPERTY 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 (WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
||||
endif()
|
||||
if (WIN32)
|
||||
list (APPEND 3RDPARTY_VTK_DLL_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
||||
else()
|
||||
list (APPEND 3RDPARTY_VTK_LIBRARY_DIRS "${TARGET_PROPERTY_LOCATION_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endforeach()
|
||||
else()
|
||||
set (ALL_REQUIRED_VTK_LIBRARIES_FOUND OFF)
|
||||
endif()
|
||||
|
||||
if (ALL_REQUIRED_VTK_LIBRARIES_FOUND)
|
||||
if (3RDPARTY_VTK_INCLUDE_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_INCLUDE_DIRS)
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIRS})
|
||||
|
||||
if (3RDPARTY_VTK_INCLUDE_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_INCLUDE_DIRS)
|
||||
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIRS})
|
||||
list (GET 3RDPARTY_VTK_INCLUDE_DIRS 0 3RDPARTY_VTK_INCLUDE_DIR)
|
||||
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_INCLUDE_DIR}" CACHE PATH "The directory containing headers of VTK" FORCE)
|
||||
endif()
|
||||
|
||||
list (GET 3RDPARTY_VTK_INCLUDE_DIRS 0 3RDPARTY_VTK_INCLUDE_DIR)
|
||||
set (3RDPARTY_VTK_INCLUDE_DIR "${3RDPARTY_VTK_INCLUDE_DIR}" CACHE PATH "The directory containing headers of VTK" FORCE)
|
||||
endif()
|
||||
if (3RDPARTY_VTK_LIBRARY_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_LIBRARY_DIRS)
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS ${3RDPARTY_VTK_LIBRARY_DIRS})
|
||||
|
||||
if (3RDPARTY_VTK_LIBRARY_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_LIBRARY_DIRS)
|
||||
list (APPEND 3RDPARTY_LIBRARY_DIRS ${3RDPARTY_VTK_LIBRARY_DIRS})
|
||||
list (GET 3RDPARTY_VTK_LIBRARY_DIRS 0 3RDPARTY_VTK_LIBRARY_DIR)
|
||||
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_LIBRARY_DIR}" CACHE PATH "The directory containing VTK libraries" FORCE)
|
||||
endif()
|
||||
|
||||
list (GET 3RDPARTY_VTK_LIBRARY_DIRS 0 3RDPARTY_VTK_LIBRARY_DIR)
|
||||
set (3RDPARTY_VTK_LIBRARY_DIR "${3RDPARTY_VTK_LIBRARY_DIR}" CACHE PATH "The directory containing VTK libraries" FORCE)
|
||||
endif()
|
||||
if (WIN32)
|
||||
if (3RDPARTY_VTK_DLL_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_DLL_DIRS)
|
||||
list (APPEND 3RDPARTY_DLL_DIRS ${3RDPARTY_VTK_DLL_DIRS})
|
||||
|
||||
if (WIN32)
|
||||
if (3RDPARTY_VTK_DLL_DIRS)
|
||||
list (REMOVE_DUPLICATES 3RDPARTY_VTK_DLL_DIRS)
|
||||
list (APPEND 3RDPARTY_DLL_DIRS ${3RDPARTY_VTK_DLL_DIRS})
|
||||
|
||||
list (GET 3RDPARTY_VTK_DLL_DIRS 0 3RDPARTY_VTK_DLL_DIR)
|
||||
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DLL_DIR}" CACHE PATH "The directory containing VTK shared libraries" FORCE)
|
||||
endif()
|
||||
list (GET 3RDPARTY_VTK_DLL_DIRS 0 3RDPARTY_VTK_DLL_DIR)
|
||||
set (3RDPARTY_VTK_DLL_DIR "${3RDPARTY_VTK_DLL_DIR}" CACHE PATH "The directory containing VTK shared libraries" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
@ -204,4 +176,6 @@ else()
|
||||
set (USED_3RDPARTY_VTK_DIR ${3RDPARTY_VTK_LIBRARY_DIR})
|
||||
endif()
|
||||
|
||||
mark_as_advanced (VTK_INCLUDE_DIRS VTK_LIBRARY_DIRS VTK_DIR)
|
||||
OCCT_CHECK_AND_UNSET (VTK_INCLUDE_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (VTK_LIBRARY_DIRS)
|
||||
OCCT_CHECK_AND_UNSET (VTK_DIR)
|
||||
|
@ -10,3 +10,10 @@ TKMesh
|
||||
TKService
|
||||
TKTopAlgo
|
||||
TKV3d
|
||||
vtkCommonCore
|
||||
vtkRenderingCore
|
||||
vtkRenderingOpenGL
|
||||
vtkRenderingFreeType
|
||||
vtkRenderingFreeTypeOpenGL
|
||||
vtkFiltersGeneral
|
||||
vtkInteractionStyle
|
||||
|
@ -16,4 +16,6 @@ TKTopAlgo
|
||||
TKV3d
|
||||
TKOpenGl
|
||||
TKIVtk
|
||||
|
||||
vtkIOImage
|
||||
vtkImagingCore
|
||||
vtkInteractionStyle
|
||||
|
Loading…
x
Reference in New Issue
Block a user