mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +00:00
Update CMake
This commit is contained in:
+37
-1
@@ -79,6 +79,7 @@ option(IFCXML_SUPPORT "Build IfcParse with ifcXML support (requires libxml2)." O
|
||||
option(USD_SUPPORT "Build IfcConvert with USD support (requires pixar's USD library)." OFF)
|
||||
option(CITYJSON_SUPPORT "Build IfcConvert with CityJSON support (requires CityJSON library)." OFF)
|
||||
option(WITH_RELATIONSHIP_VALIDATION "Build IfcConvert with option to validate geometrical relationships." OFF)
|
||||
option(WITH_ROCKSDB "Support a RocksDB key-value store as a file backend in IfcOpenShell" OFF)
|
||||
|
||||
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
|
||||
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, warning results in many rebuilds, requires git" OFF)
|
||||
@@ -297,6 +298,40 @@ if(USD_SUPPORT)
|
||||
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_USD)
|
||||
endif(USD_SUPPORT)
|
||||
|
||||
if (WITH_ROCKSDB)
|
||||
UNIFY_ENVVARS_AND_CACHE(ROCKSDB_INCLUDE_DIR)
|
||||
UNIFY_ENVVARS_AND_CACHE(ROCKSDB_LIBRARY_DIR)
|
||||
|
||||
if("${ROCKSDB_INCLUDE_DIR}" STREQUAL "")
|
||||
find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
REQUIRED
|
||||
)
|
||||
if(ROCKSDB_INCLUDE_DIR)
|
||||
message(STATUS "Found rocksdb include files in: ${ROCKSDB_INCLUDE_DIR}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to find rocksdb include directory, specify ROCKSDB_INCLUDE_DIR manually.")
|
||||
endif()
|
||||
else()
|
||||
set(ROCKSDB_INCLUDE_DIR ${ROCKSDB_INCLUDE_DIR} CACHE FILEPATH "rocksdb header files")
|
||||
message(STATUS "Looking for rocksdb include files in: ${ROCKSDB_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
find_library(ROCKSDB_LIBRARY
|
||||
NAMES rocksdb
|
||||
PATHS ${ROCKSDB_LIBRARY_DIR})
|
||||
if(ROCKSDB_LIBRARY)
|
||||
message(STATUS "rocksdb library ${ROCKSDB_LIBRARY} found in: ${ROCKSDB_LIBRARY_DIR}")
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to find rocksdb library in: ${ROCKSDB_LIBRARY_DIR}")
|
||||
endif()
|
||||
|
||||
add_definitions(-DWITH_ROCKSDB)
|
||||
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_ROCKSDB)
|
||||
endif()
|
||||
|
||||
# Find Boost: On win32 the (hardcoded) default is to use static libraries and
|
||||
# runtime, when doing running conda-build we pick what conda prepared for us.
|
||||
if(WIN32 AND("$ENV{CONDA_BUILD}" STREQUAL ""))
|
||||
@@ -776,7 +811,7 @@ endif(MSVC)
|
||||
include_directories(${INCLUDE_DIRECTORIES} ${OCC_INCLUDE_DIR} ${OPENCOLLADA_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR} ${JSON_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}
|
||||
${EIGEN_DIR} ${CGAL_INCLUDE_DIR} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR} ${USD_INCLUDE_DIR}
|
||||
${TBB_INCLUDE_DIR}
|
||||
${TBB_INCLUDE_DIR} ${ROCKSDB_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if(NOT SCHEMA_VERSIONS)
|
||||
@@ -932,6 +967,7 @@ endforeach()
|
||||
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
||||
|
||||
add_library(IfcParse ${IFCPARSE_FILES})
|
||||
target_link_libraries(IfcParse ${ROCKSDB_LIBRARY})
|
||||
set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIFC_PARSE_EXPORTS VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
|
||||
|
||||
if(WASM_BUILD)
|
||||
|
||||
Reference in New Issue
Block a user