OCCT static libraries build directories #558
-
|
Hi, I am trying compare build directories of OCCT they are different in each operating system. I hardcode each path for cmake, is there a way to set one common folder for all OS? # Set platform-specific hardcoded paths for OCCT libraries
if(NOT OCCT_LIB_DIR)
if(WIN32)
set(OCCT_LIB_DIR "${OCCT_BUILD_DIR}/win64/vc14/lib" CACHE PATH "Path to OCCT libraries" FORCE)
elseif(APPLE)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(OCCT_LIB_DIR "${OCCT_BUILD_DIR}/mac64/clang/lib" CACHE PATH "Path to OCCT libraries" FORCE)
else()
set(OCCT_LIB_DIR "${OCCT_BUILD_DIR}/macx86_64/clang/lib" CACHE PATH "Path to OCCT libraries" FORCE)
endif()
else() # Linux
set(OCCT_LIB_DIR "${OCCT_BUILD_DIR}/lin64/gcc/lib" CACHE PATH "Path to OCCT libraries" FORCE)
endif()
endif()
message(STATUS "---------------------- OCCT_LIB_DIR: ${OCCT_LIB_DIR}")
message(STATUS "---------------------- OCCT_INCLUDE_DIR: ${OCCT_INCLUDE_DIR}")
# Generate the library targets list using OCCT_LIB_DIR already set for each platform
set(OCCT_LIB_TARGETS "")
set(OCCT_MODULES TKBool TKFillet TKOffset TKFeat TKPrim TKBO TKMesh TKHLR TKShHealing TKTopAlgo TKGeomAlgo TKBRep TKGeomBase TKG3d TKG2d TKMath TKernel)
foreach(MODULE ${OCCT_MODULES})
list(APPEND OCCT_LIB_TARGETS "${OCCT_LIB_DIR}/${LIB_PREFIX}${MODULE}${LIB_EXT}")
endforeach()
# Always create OCCT targets for dependency tracking
add_custom_target(occt_ext)
set(OCCT_TARGET occt_ext)
if(NOT OCCT_ALREADY_BUILT)
ExternalProject_Add(
occt_download
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_9_0.zip
PREFIX ${OCCT_PREFIX}
SOURCE_DIR ${OCCT_SRC_DIR}
BINARY_DIR ${OCCT_BUILD_DIR}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${OCCT_INSTALL_DIR}
-DCMAKE_BUILD_TYPE=Release
-DBUILD_LIBRARY_TYPE=Static
-DBUILD_MODULE_Draw=OFF
-DBUILD_MODULE_ApplicationFramework=OFF
-DBUILD_MODULE_DataExchange=OFF
-DBUILD_MODULE_Visualization=OFF
-DBUILD_SAMPLES_QT=OFF
-DBUILD_MODULE_Modeling=ON
-DBUILD_USE_PCH=OFF
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -j2
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --config Release --component Development
BUILD_BYPRODUCTS ${OCCT_LIB_TARGETS}
)
add_dependencies(external_downloads occt_download)
add_dependencies(occt_ext occt_download)
set(OCCT_ALREADY_BUILT TRUE CACHE BOOL "Flag to indicate if OCCT has been built" FORCE)
endif() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
You can specify the installation folder by providing them as an parameters for configuration Available: Also you can specify LAYOUT (Windows or Unix). Unix is common one |
Beta Was this translation helpful? Give feedback.
You can specify the installation folder by providing them as an parameters for configuration
Available:
INSTALL_DIR_BIN (example win64/clang/bin)
INSTALL_DIR_LIB (example win64/clang/lib)
INSTALL_DIR_INCLUDE (example inc)
Also you can specify LAYOUT (Windows or Unix). Unix is common one
INSTALL_DIR_LAYOUT (example Windows)