1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

Configuration - Extend support Ubuntu packages #118

Draco, vtk and openvr now can be used from ubuntu packages
Fixed issue for Clang with msvc lib detection
This commit is contained in:
dpasukhi 2024-10-26 21:59:54 +01:00
parent 72415a8313
commit 9f685bf453
4 changed files with 24 additions and 9 deletions

View File

@ -101,8 +101,9 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_CSF_NAME LIBRARY_NAME
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
string(TOLOWER ${PRODUCT_NAME} LOW_CASE_PRODUCT_NAME)
find_path (3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR NAMES ${HEADER_NAME}
PATH_SUFFIXES include inc headers
PATH_SUFFIXES include inc headers ${LOW_CASE_PRODUCT_NAME}
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()

View File

@ -51,6 +51,11 @@ if (NOT 3RDPARTY_DRACO_INCLUDE_DIR OR NOT EXISTS "${3RDPARTY_DRACO_INCLUDE_DIR}"
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH
NO_DEFAULT_PATH)
else()
find_path (3RDPARTY_DRACO_INCLUDE_DIR NAMES ${HEADER_NAMES}
PATHS ${3RDPARTY_DRACO_DIR}
PATH_SUFFIXES "include"
CMAKE_FIND_ROOT_PATH_BOTH)
endif()
endif()

View File

@ -173,6 +173,17 @@ function (OCCT_ORIGIN_AND_PATCHED_FILES RELATIVE_PATH SEARCH_TEMPLATE RESULT)
set (${RESULT} ${FOUND_FILES} PARENT_SCOPE)
endfunction()
function (FILLUP_PRODUCT_SEARCH_TEMPLATE PRODUCT_NAME COMPILER COMPILER_BITNESS SEARCH_TEMPLATES)
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
set (SEARCH_TEMPLATES ${SEARCH_TEMPLATES} PARENT_SCOPE)
endfunction()
function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
OCCT_MAKE_COMPILER_SHORT_NAME()
OCCT_MAKE_COMPILER_BITNESS()
@ -184,13 +195,11 @@ function (FIND_PRODUCT_DIR ROOT_DIR PRODUCT_NAME RESULT)
elseif ("${lower_PRODUCT_NAME}" STREQUAL "tbb")
list (APPEND SEARCH_TEMPLATES "^.*${lower_PRODUCT_NAME}.*")
else()
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[a-zA-Z]*[0-9]*-${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER}.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*.*${COMPILER_BITNESS}")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*[0-9.]+")
list (APPEND SEARCH_TEMPLATES "^[^a-zA-Z]*${lower_PRODUCT_NAME}[^a-zA-Z]*")
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} ${COMPILER} ${COMPILER_BITNESS} SEARCH_TEMPLATES)
if (WIN32 AND "${COMPILER}" STREQUAL "clang")
# for clang on Windows, search for "vc" as well
FILLUP_PRODUCT_SEARCH_TEMPLATE(${lower_PRODUCT_NAME} "vc" ${COMPILER_BITNESS} SEARCH_TEMPLATES)
endif()
endif()
SUBDIRECTORY_NAMES ("${ROOT_DIR}" SUBDIR_NAME_LIST)

View File

@ -200,7 +200,7 @@ endif()
if (3RDPARTY_VTK_INCLUDE_DIR AND EXISTS "${3RDPARTY_VTK_INCLUDE_DIR}")
list (APPEND 3RDPARTY_INCLUDE_DIRS ${3RDPARTY_VTK_INCLUDE_DIR})
else()
elseif (NOT VTK_FOUND)
list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_VTK_INCLUDE_DIR)
endif()