mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 15:56:18 +00:00
format cmake files
This commit is contained in:
+105
-66
@@ -18,16 +18,16 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.21)
|
cmake_minimum_required(VERSION 3.21)
|
||||||
if (NOT DEFINED CMAKE_CXX_STANDARD)
|
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
endif()
|
endif()
|
||||||
if (CMAKE_CXX_STANDARD LESS 17)
|
if(CMAKE_CXX_STANDARD LESS 17)
|
||||||
message(FATAL_ERROR "C++17 or newer is required.")
|
message(FATAL_ERROR "C++17 or newer is required.")
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged
|
set(CMAKE_CXX_STANDARD_REQUIRED ON) # not necessary, but encouraged
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
if (VERSION_OVERRIDE)
|
if(VERSION_OVERRIDE)
|
||||||
file(READ "../VERSION" "RELEASE_VERSION_")
|
file(READ "../VERSION" "RELEASE_VERSION_")
|
||||||
string(STRIP "${RELEASE_VERSION_}" RELEASE_VERSION)
|
string(STRIP "${RELEASE_VERSION_}" RELEASE_VERSION)
|
||||||
message(STATUS "Detected version '${RELEASE_VERSION}'")
|
message(STATUS "Detected version '${RELEASE_VERSION}'")
|
||||||
@@ -40,7 +40,7 @@ project(IfcOpenShell VERSION ${RELEASE_VERSION})
|
|||||||
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
|
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
|
||||||
|
|
||||||
if(POLICY CMP0141) # 3.25+
|
if(POLICY CMP0141) # 3.25+
|
||||||
cmake_policy(SET CMP0141 NEW) # Support for `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT`.
|
cmake_policy(SET CMP0141 NEW) # Support for `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT`.
|
||||||
endif()
|
endif()
|
||||||
if(POLICY CMP0144) # 3.27
|
if(POLICY CMP0144) # 3.27
|
||||||
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables.
|
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables.
|
||||||
@@ -64,7 +64,11 @@ endif()
|
|||||||
option(MINIMAL_BUILD "The build is to make a minimal version of IFC converter from OCCT into IFC." OFF)
|
option(MINIMAL_BUILD "The build is to make a minimal version of IFC converter from OCCT into IFC." OFF)
|
||||||
option(WASM_BUILD "Build a WebAssembly binary." OFF)
|
option(WASM_BUILD "Build a WebAssembly binary." OFF)
|
||||||
|
|
||||||
option(ENABLE_BUILD_OPTIMIZATIONS "Enable certain compiler and linker optimizations on RelWithDebInfo and Release builds." OFF)
|
option(
|
||||||
|
ENABLE_BUILD_OPTIMIZATIONS
|
||||||
|
"Enable certain compiler and linker optimizations on RelWithDebInfo and Release builds."
|
||||||
|
OFF
|
||||||
|
)
|
||||||
option(BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." OFF)
|
option(BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." OFF)
|
||||||
option(MSVC_PARALLEL_BUILD "Multi-threaded compilation in Microsoft Visual Studio (/MP)" OFF)
|
option(MSVC_PARALLEL_BUILD "Multi-threaded compilation in Microsoft Visual Studio (/MP)" OFF)
|
||||||
option(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF)
|
option(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF)
|
||||||
@@ -83,9 +87,11 @@ option(BUILD_PACKAGE "" OFF)
|
|||||||
# Most users probably need just common schemas,
|
# Most users probably need just common schemas,
|
||||||
# but we're keeping it `OFF` by default to avoid disruption
|
# but we're keeping it `OFF` by default to avoid disruption
|
||||||
# (e.g. all Python distribution would need to adapt this option to be set).
|
# (e.g. all Python distribution would need to adapt this option to be set).
|
||||||
option(BUILD_ONLY_COMMON_SCHEMAS
|
option(
|
||||||
|
BUILD_ONLY_COMMON_SCHEMAS
|
||||||
"Build only common IFC schemas (2x3, 4, 4x3_add2). By default all schemas will be built."
|
"Build only common IFC schemas (2x3, 4, 4x3_add2). By default all schemas will be built."
|
||||||
OFF)
|
OFF
|
||||||
|
)
|
||||||
option(SCHEMA_VERSIONS "Explicitly specify schemas to build." "")
|
option(SCHEMA_VERSIONS "Explicitly specify schemas to build." "")
|
||||||
|
|
||||||
option(WITH_OPENCASCADE "Enable geometry interpretation using Open CASCADE" ON)
|
option(WITH_OPENCASCADE "Enable geometry interpretation using Open CASCADE" ON)
|
||||||
@@ -103,12 +109,16 @@ option(WITH_ZSTD "Use Zstd compression in RocksDB writes" OFF)
|
|||||||
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
|
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
|
||||||
option(USE_DEBUG_PYTHON "Use debug binaries when building Debug IfcPython on Windows." OFF)
|
option(USE_DEBUG_PYTHON "Use debug binaries when building Debug IfcPython on Windows." OFF)
|
||||||
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, requires git" OFF)
|
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, requires git" OFF)
|
||||||
option(VERSION_OVERRIDE "Override the version defined in buildinfo.cpp with the file VERSION in the repository root" OFF)
|
option(
|
||||||
|
VERSION_OVERRIDE
|
||||||
|
"Override the version defined in buildinfo.cpp with the file VERSION in the repository root"
|
||||||
|
OFF
|
||||||
|
)
|
||||||
option(USE_CCACHE "Enable use of ccache if it's available from PATH." ON)
|
option(USE_CCACHE "Enable use of ccache if it's available from PATH." ON)
|
||||||
|
|
||||||
set(
|
set(PYTHON_MODULE_INSTALL_DIR
|
||||||
PYTHON_MODULE_INSTALL_DIR
|
""
|
||||||
"" CACHE PATH
|
CACHE PATH
|
||||||
"Directory to install IfcPython package to. By default package is installed in found Python's site-packages."
|
"Directory to install IfcPython package to. By default package is installed in found Python's site-packages."
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -127,7 +137,7 @@ if(MINIMAL_BUILD)
|
|||||||
set(USD_SUPPORT OFF)
|
set(USD_SUPPORT OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if((BUILD_CONVERT OR BUILD_GEOMSERVER OR BUILD_IFCPYTHON) AND(NOT BUILD_IFCGEOM))
|
if((BUILD_CONVERT OR BUILD_GEOMSERVER OR BUILD_IFCPYTHON) AND (NOT BUILD_IFCGEOM))
|
||||||
message(STATUS "'IfcGeom' is required with current outputs")
|
message(STATUS "'IfcGeom' is required with current outputs")
|
||||||
set(BUILD_IFCGEOM ON)
|
set(BUILD_IFCGEOM ON)
|
||||||
endif()
|
endif()
|
||||||
@@ -142,14 +152,8 @@ if(USE_CCACHE AND CCACHE_FOUND)
|
|||||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
|
||||||
# Not needed for Ninja.
|
# Not needed for Ninja.
|
||||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
file(COPY_FILE
|
file(COPY_FILE ${CCACHE_FOUND} ${CMAKE_BINARY_DIR}/cl.exe ONLY_IF_DIFFERENT)
|
||||||
${CCACHE_FOUND} ${CMAKE_BINARY_DIR}/cl.exe
|
set(CMAKE_VS_GLOBALS "CLToolExe=cl.exe" "CLToolPath=${CMAKE_BINARY_DIR}" "UseMultiToolTask=true")
|
||||||
ONLY_IF_DIFFERENT)
|
|
||||||
set(CMAKE_VS_GLOBALS
|
|
||||||
"CLToolExe=cl.exe"
|
|
||||||
"CLToolPath=${CMAKE_BINARY_DIR}"
|
|
||||||
"UseMultiToolTask=true"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@@ -183,7 +187,10 @@ endif()
|
|||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
add_definitions(-DIFC_SHARED_BUILD)
|
add_definitions(-DIFC_SHARED_BUILD)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
message(WARNING "Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed.")
|
message(
|
||||||
|
WARNING
|
||||||
|
"Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed."
|
||||||
|
)
|
||||||
# C4521: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
|
# C4521: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
|
||||||
# There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
|
# There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
|
||||||
add_definitions(-wd4251)
|
add_definitions(-wd4251)
|
||||||
@@ -206,7 +213,6 @@ foreach(option_flag IN LISTS option_flags)
|
|||||||
convert_env_var_to_bool("${option_flag}")
|
convert_env_var_to_bool("${option_flag}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
if(BUILD_IFCGEOM AND WITH_OPENCASCADE)
|
if(BUILD_IFCGEOM AND WITH_OPENCASCADE)
|
||||||
find_package(OpenCASCADE REQUIRED)
|
find_package(OpenCASCADE REQUIRED)
|
||||||
add_definitions(-DIFOPSH_WITH_OPENCASCADE)
|
add_definitions(-DIFOPSH_WITH_OPENCASCADE)
|
||||||
@@ -230,7 +236,7 @@ if(USD_SUPPORT)
|
|||||||
endif(USD_SUPPORT)
|
endif(USD_SUPPORT)
|
||||||
|
|
||||||
set(ROCKSDB_LIBRARIES "")
|
set(ROCKSDB_LIBRARIES "")
|
||||||
if (WITH_ROCKSDB)
|
if(WITH_ROCKSDB)
|
||||||
# Temporaily mess with CMAKE_FIND_PACKAGE_PREFER_CONFIG to help RocksDB
|
# Temporaily mess with CMAKE_FIND_PACKAGE_PREFER_CONFIG to help RocksDB
|
||||||
# find it's zstd dependency on Windows.
|
# find it's zstd dependency on Windows.
|
||||||
# Only do it on Windows, otherwise it might create problems as
|
# Only do it on Windows, otherwise it might create problems as
|
||||||
@@ -250,9 +256,12 @@ if (WITH_ROCKSDB)
|
|||||||
set(ROCKSDB_LIBRARIES "IFCOPENSHELL_RocksDB")
|
set(ROCKSDB_LIBRARIES "IFCOPENSHELL_RocksDB")
|
||||||
target_compile_definitions(IFCOPENSHELL_RocksDB INTERFACE IFOPSH_WITH_ROCKSDB)
|
target_compile_definitions(IFCOPENSHELL_RocksDB INTERFACE IFOPSH_WITH_ROCKSDB)
|
||||||
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_ROCKSDB)
|
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_ROCKSDB)
|
||||||
target_link_libraries(IFCOPENSHELL_RocksDB INTERFACE $<IF:$<TARGET_EXISTS:RocksDB::rocksdb-shared>,RocksDB::rocksdb-shared,RocksDB::rocksdb>)
|
target_link_libraries(
|
||||||
|
IFCOPENSHELL_RocksDB
|
||||||
|
INTERFACE $<IF:$<TARGET_EXISTS:RocksDB::rocksdb-shared>,RocksDB::rocksdb-shared,RocksDB::rocksdb>
|
||||||
|
)
|
||||||
|
|
||||||
if (WITH_ZSTD)
|
if(WITH_ZSTD)
|
||||||
# @todo do we actually need the zstd include dir or rather just pass
|
# @todo do we actually need the zstd include dir or rather just pass
|
||||||
# the libzstd.a along with the rocksdb library when needed and feature
|
# the libzstd.a along with the rocksdb library when needed and feature
|
||||||
# detect based on rocksdb API?
|
# detect based on rocksdb API?
|
||||||
@@ -262,8 +271,7 @@ if (WITH_ROCKSDB)
|
|||||||
target_link_libraries(IFCOPENSHELL_RocksDB INTERFACE zstd::libzstd_static)
|
target_link_libraries(IFCOPENSHELL_RocksDB INTERFACE zstd::libzstd_static)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS IFCOPENSHELL_RocksDB
|
install(TARGETS IFCOPENSHELL_RocksDB EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Find Boost: On win32 the (hardcoded) default is to use static libraries and
|
# Find Boost: On win32 the (hardcoded) default is to use static libraries and
|
||||||
@@ -299,7 +307,14 @@ if(WASM_BUILD)
|
|||||||
else()
|
else()
|
||||||
# @todo review this, shouldn't this be all possible header-only now?
|
# @todo review this, shouldn't this be all possible header-only now?
|
||||||
# ... or rewritten using C++17 features?
|
# ... or rewritten using C++17 features?
|
||||||
set(BOOST_COMPONENTS system program_options regex thread date_time iostreams)
|
set(BOOST_COMPONENTS
|
||||||
|
system
|
||||||
|
program_options
|
||||||
|
regex
|
||||||
|
thread
|
||||||
|
date_time
|
||||||
|
iostreams
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_MMAP)
|
if(USE_MMAP)
|
||||||
@@ -405,7 +420,7 @@ if(MSVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enforce standards-conformance on VS > 2015, older Boost versions fail to compile with this
|
# Enforce standards-conformance on VS > 2015, older Boost versions fail to compile with this
|
||||||
if(MSVC_VERSION GREATER 1900 AND(Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 66))
|
if(MSVC_VERSION GREATER 1900 AND (Boost_MAJOR_VERSION GREATER 1 OR Boost_MINOR_VERSION GREATER 66))
|
||||||
add_definitions(-permissive-)
|
add_definitions(-permissive-)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -424,11 +439,11 @@ if(MSVC)
|
|||||||
# endforeach()
|
# endforeach()
|
||||||
# endif()
|
# endif()
|
||||||
|
|
||||||
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
|
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
|
||||||
# See #5158.
|
# See #5158.
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.40)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.40)
|
||||||
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
|
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
add_definitions(-Wall -Wextra)
|
add_definitions(-Wall -Wextra)
|
||||||
|
|
||||||
@@ -438,7 +453,10 @@ else()
|
|||||||
add_definitions(-Wno-maybe-uninitialized)
|
add_definitions(-Wno-maybe-uninitialized)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 9.0))
|
if(
|
||||||
|
CMAKE_CXX_COMPILER_ID MATCHES "GNU"
|
||||||
|
AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 9.0)
|
||||||
|
)
|
||||||
# OpenCascade spews a lot of deprecated-copy warnings
|
# OpenCascade spews a lot of deprecated-copy warnings
|
||||||
add_definitions(-Wno-deprecated-copy)
|
add_definitions(-Wno-deprecated-copy)
|
||||||
endif()
|
endif()
|
||||||
@@ -449,16 +467,23 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
include_directories(${OPENCOLLADA_INCLUDE_DIRS}
|
include_directories(${OPENCOLLADA_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR})
|
||||||
${Boost_INCLUDE_DIRS} ${HDF5_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT SCHEMA_VERSIONS)
|
if(NOT SCHEMA_VERSIONS)
|
||||||
# `WASM_BUILD` - super arbitrarily try to keep size down at least a little bit
|
# `WASM_BUILD` - super arbitrarily try to keep size down at least a little bit
|
||||||
if(BUILD_ONLY_COMMON_SCHEMAS OR WASM_BUILD)
|
if(BUILD_ONLY_COMMON_SCHEMAS OR WASM_BUILD)
|
||||||
set(SCHEMA_VERSIONS "2x3" "4" "4x3_add2")
|
set(SCHEMA_VERSIONS "2x3" "4" "4x3_add2")
|
||||||
else()
|
else()
|
||||||
set(SCHEMA_VERSIONS "2x3" "4" "4x1" "4x2" "4x3" "4x3_tc1" "4x3_add1" "4x3_add2")
|
set(SCHEMA_VERSIONS
|
||||||
|
"2x3"
|
||||||
|
"4"
|
||||||
|
"4x1"
|
||||||
|
"4x2"
|
||||||
|
"4x3"
|
||||||
|
"4x3_tc1"
|
||||||
|
"4x3_add1"
|
||||||
|
"4x3_add2"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -477,7 +502,10 @@ if(COMPILE_SCHEMA)
|
|||||||
find_package(PythonInterp)
|
find_package(PythonInterp)
|
||||||
|
|
||||||
if(NOT PYTHONINTERP_FOUND)
|
if(NOT PYTHONINTERP_FOUND)
|
||||||
message(FATAL_ERROR "A Python interpreter is necessary when COMPILE_SCHEMA is enabled. Disable COMPILE_SCHEMA or fix Python paths to proceed.")
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"A Python interpreter is necessary when COMPILE_SCHEMA is enabled. Disable COMPILE_SCHEMA or fix Python paths to proceed."
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IFC_RELEASE_NOT_USED ${SCHEMA_VERSIONS})
|
set(IFC_RELEASE_NOT_USED ${SCHEMA_VERSIONS})
|
||||||
@@ -497,7 +525,10 @@ if(COMPILE_SCHEMA)
|
|||||||
|
|
||||||
if("${PYPARSING_FOUND}" STREQUAL "-1")
|
if("${PYPARSING_FOUND}" STREQUAL "-1")
|
||||||
message(STATUS "Installing pyparsing")
|
message(STATUS "Installing pyparsing")
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip "install" --user pyparsing RESULT_VARIABLE SUCCESS)
|
execute_process(
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} -m pip "install" --user pyparsing
|
||||||
|
RESULT_VARIABLE SUCCESS
|
||||||
|
)
|
||||||
|
|
||||||
if(NOT "${SUCCESS}" STREQUAL "0")
|
if(NOT "${SUCCESS}" STREQUAL "0")
|
||||||
execute_process(COMMAND pip "install" --user pyparsing RESULT_VARIABLE SUCCESS)
|
execute_process(COMMAND pip "install" --user pyparsing RESULT_VARIABLE SUCCESS)
|
||||||
@@ -512,19 +543,23 @@ if(COMPILE_SCHEMA)
|
|||||||
|
|
||||||
# Bootstrap the parser
|
# Bootstrap the parser
|
||||||
message(STATUS "Compiling schema, this will take a while...")
|
message(STATUS "Compiling schema, this will take a while...")
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} bootstrap.py express.bnf
|
execute_process(
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} bootstrap.py express.bnf
|
||||||
WORKING_DIRECTORY ../src/ifcexpressparser
|
WORKING_DIRECTORY ../src/ifcexpressparser
|
||||||
OUTPUT_FILE express_parser.py
|
OUTPUT_FILE express_parser.py
|
||||||
RESULT_VARIABLE SUCCESS)
|
RESULT_VARIABLE SUCCESS
|
||||||
|
)
|
||||||
|
|
||||||
if(NOT "${SUCCESS}" STREQUAL "0")
|
if(NOT "${SUCCESS}" STREQUAL "0")
|
||||||
message(FATAL_ERROR "Failed to bootstrap parser. Make sure pyparsing is installed")
|
message(FATAL_ERROR "Failed to bootstrap parser. Make sure pyparsing is installed")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Generate code
|
# Generate code
|
||||||
execute_process(COMMAND ${PYTHON_EXECUTABLE} ../ifcexpressparser/express_parser.py ../../${COMPILE_SCHEMA}
|
execute_process(
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ../ifcexpressparser/express_parser.py ../../${COMPILE_SCHEMA}
|
||||||
WORKING_DIRECTORY ../src/ifcparse
|
WORKING_DIRECTORY ../src/ifcparse
|
||||||
OUTPUT_VARIABLE COMPILED_SCHEMA_NAME)
|
OUTPUT_VARIABLE COMPILED_SCHEMA_NAME
|
||||||
|
)
|
||||||
|
|
||||||
# Prevent the schema that had just been compiled from being excluded
|
# Prevent the schema that had just been compiled from being excluded
|
||||||
foreach(schema ${SCHEMA_VERSIONS})
|
foreach(schema ${SCHEMA_VERSIONS})
|
||||||
@@ -568,8 +603,8 @@ if(ADD_COMMIT_SHA)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(GIT_FOUND)
|
if(GIT_FOUND)
|
||||||
if (VERSION_OVERRIDE)
|
if(VERSION_OVERRIDE)
|
||||||
set (git_branch ${RELEASE_VERSION})
|
set(git_branch ${RELEASE_VERSION})
|
||||||
else()
|
else()
|
||||||
message("git found: ${GIT_EXECUTABLE} with version ${GIT_VERSION_STRING}")
|
message("git found: ${GIT_EXECUTABLE} with version ${GIT_VERSION_STRING}")
|
||||||
execute_process(
|
execute_process(
|
||||||
@@ -581,8 +616,8 @@ if(ADD_COMMIT_SHA)
|
|||||||
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
|
string(REPLACE "\n" ";" git_branch_list "${git_branches}")
|
||||||
|
|
||||||
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
|
foreach(git_branch_candidate IN ITEMS ${git_branch_list})
|
||||||
string(REPLACE "*" "" git_branch_candidate_temp "${git_branch_candidate}")
|
string(REPLACE "*" "" git_branch_candidate_temp "${git_branch_candidate}")
|
||||||
string(STRIP "${git_branch_candidate_temp}" git_branch_candidate_2)
|
string(STRIP "${git_branch_candidate_temp}" git_branch_candidate_2)
|
||||||
if(NOT git_branch_candidate_2 MATCHES "^HEAD$")
|
if(NOT git_branch_candidate_2 MATCHES "^HEAD$")
|
||||||
string(REPLACE "/" ";" git_branch_candidate_2_list "${git_branch_candidate_2}")
|
string(REPLACE "/" ";" git_branch_candidate_2_list "${git_branch_candidate_2}")
|
||||||
list(GET git_branch_candidate_2_list -1 git_branch)
|
list(GET git_branch_candidate_2_list -1 git_branch)
|
||||||
@@ -600,13 +635,13 @@ if(ADD_COMMIT_SHA)
|
|||||||
message(STATUS "IfcOpenShell branch: \"${git_branch}\"")
|
message(STATUS "IfcOpenShell branch: \"${git_branch}\"")
|
||||||
message(STATUS "IfcOpenShell commit: \"${git_sha}\"")
|
message(STATUS "IfcOpenShell commit: \"${git_sha}\"")
|
||||||
|
|
||||||
if ("${git_branch}" STREQUAL "" OR "${git_sha}" STREQUAL "")
|
if("${git_branch}" STREQUAL "" OR "${git_sha}" STREQUAL "")
|
||||||
message(FATAL_ERROR "Unable to determine commit sha and/or branch")
|
message(FATAL_ERROR "Unable to determine commit sha and/or branch")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(IfcParse PRIVATE
|
target_compile_definitions(
|
||||||
-DIFCOPENSHELL_BRANCH=${git_branch}
|
IfcParse
|
||||||
-DIFCOPENSHELL_COMMIT=${git_sha}
|
PRIVATE -DIFCOPENSHELL_BRANCH=${git_branch} -DIFCOPENSHELL_COMMIT=${git_sha}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif(ADD_COMMIT_SHA)
|
endif(ADD_COMMIT_SHA)
|
||||||
@@ -649,23 +684,23 @@ if(NOT TARGET uninstall)
|
|||||||
configure_file(
|
configure_file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||||
IMMEDIATE @ONLY)
|
IMMEDIATE
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
add_custom_target(uninstall
|
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Packaging
|
# Packaging
|
||||||
list(APPEND CPACK_SOURCE_IGNORE_FILES
|
list(APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git" "/build/" "/.pytest_cache/" "/__pycache__/")
|
||||||
"/\\\\.git"
|
|
||||||
"/build/"
|
|
||||||
"/.pytest_cache/"
|
|
||||||
"/__pycache__/"
|
|
||||||
)
|
|
||||||
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}/..;/")
|
set(CPACK_SOURCE_INSTALLED_DIRECTORIES "${CMAKE_SOURCE_DIR}/..;/")
|
||||||
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}")
|
set(CPACK_PACKAGE_NAME
|
||||||
|
"${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}"
|
||||||
|
)
|
||||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}${EXTRA_VERSION}")
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}${EXTRA_VERSION}")
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}-${CMAKE_SYSTEM_NAME}")
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
|
"${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${EXTRA_VERSION}-${CMAKE_SYSTEM_NAME}"
|
||||||
|
)
|
||||||
set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/assets")
|
set(CPACK_PACKAGE_DIRECTORY "${PROJECT_BINARY_DIR}/assets")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IfcOpenShell")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IfcOpenShell")
|
||||||
set(CPACK_PACKAGE_DESCRIPTION "IfcOpenShell.")
|
set(CPACK_PACKAGE_DESCRIPTION "IfcOpenShell.")
|
||||||
@@ -686,12 +721,16 @@ endforeach(COMPONENT)
|
|||||||
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}")
|
set(CPACK_DEBIAN_PACKAGE_NAME "${PROJECT_NAME}")
|
||||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
|
||||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, libxml2, libocct-foundation-dev, libocct-modeling-algorithms-dev, libocct-modeling-data-dev, libocct-ocaf-dev, libocct-visualization-dev, libocct-data-exchange-dev, libhdf5-serial-dev, libpython3-dev, python3-pytest ${BOOST_DEPS}")
|
set(CPACK_DEBIAN_PACKAGE_DEPENDS
|
||||||
|
"python3, libxml2, libocct-foundation-dev, libocct-modeling-algorithms-dev, libocct-modeling-data-dev, libocct-ocaf-dev, libocct-visualization-dev, libocct-data-exchange-dev, libhdf5-serial-dev, libpython3-dev, python3-pytest ${BOOST_DEPS}"
|
||||||
|
)
|
||||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
|
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
|
||||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
|
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
|
||||||
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||||
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
|
set(CPACK_DEBIAN_PACKAGE_SECTION "science")
|
||||||
set(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${EXTRA_VERSION}")
|
set(CPACK_DEBIAN_PACKAGE_VERSION
|
||||||
|
"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}${EXTRA_VERSION}"
|
||||||
|
)
|
||||||
set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
|
set(CPACK_DEBIAN_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/cmake/debian/postinst")
|
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/cmake/debian/postinst")
|
||||||
|
|
||||||
|
|||||||
@@ -65,5 +65,4 @@ add_library(IFCOPENSHELL_CGAL INTERFACE)
|
|||||||
target_link_libraries(IFCOPENSHELL_CGAL INTERFACE CGAL::CGAL)
|
target_link_libraries(IFCOPENSHELL_CGAL INTERFACE CGAL::CGAL)
|
||||||
target_compile_definitions(IFCOPENSHELL_CGAL INTERFACE IFOPSH_WITH_CGAL)
|
target_compile_definitions(IFCOPENSHELL_CGAL INTERFACE IFOPSH_WITH_CGAL)
|
||||||
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_CGAL)
|
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_CGAL)
|
||||||
install(TARGETS IFCOPENSHELL_CGAL
|
install(TARGETS IFCOPENSHELL_CGAL EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ if(HDF5_LIBRARY_DIR)
|
|||||||
"${HDF5_LIBRARY_DIR}/libsz${debug_postfix}.${lib_ext}"
|
"${HDF5_LIBRARY_DIR}/libsz${debug_postfix}.${lib_ext}"
|
||||||
"${HDF5_LIBRARY_DIR}/libaec${debug_postfix}.${lib_ext}"
|
"${HDF5_LIBRARY_DIR}/libaec${debug_postfix}.${lib_ext}"
|
||||||
)
|
)
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "Packaging hdf5 and zlib for conda distribution")
|
message(STATUS "Packaging hdf5 and zlib for conda distribution")
|
||||||
|
|
||||||
|
|||||||
@@ -33,15 +33,15 @@ else()
|
|||||||
set_property(TARGET LibXml2::LibXml2 PROPERTY IMPORTED_LOCATION)
|
set_property(TARGET LibXml2::LibXml2 PROPERTY IMPORTED_LOCATION)
|
||||||
get_release_variant(LIBXML2_RELEASE_LIB "${LIBXML2_LIBRARIES}" "d")
|
get_release_variant(LIBXML2_RELEASE_LIB "${LIBXML2_LIBRARIES}" "d")
|
||||||
get_debug_variant(LIBXML2_DEBUG_LIB "${LIBXML2_LIBRARIES}" "d")
|
get_debug_variant(LIBXML2_DEBUG_LIB "${LIBXML2_LIBRARIES}" "d")
|
||||||
set_target_properties(LibXml2::LibXml2
|
set_target_properties(
|
||||||
|
LibXml2::LibXml2
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
IMPORTED_CONFIGURATIONS "Release;Debug"
|
IMPORTED_CONFIGURATIONS "Release;Debug"
|
||||||
IMPORTED_LOCATION_RELEASE "${LIBXML2_RELEASE_LIB}"
|
IMPORTED_LOCATION_RELEASE "${LIBXML2_RELEASE_LIB}"
|
||||||
IMPORTED_LOCATION_DEBUG "${LIBXML2_DEBUG_LIB}"
|
IMPORTED_LOCATION_DEBUG "${LIBXML2_DEBUG_LIB}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Restore module path.
|
# Restore module path.
|
||||||
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
|
list(PREPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
|
||||||
|
|||||||
+46
-27
@@ -22,7 +22,6 @@ if(OCC_LIBRARY_DIR)
|
|||||||
message(STATUS "Looking for Open CASCADE library files in: ${OCC_LIBRARY_DIR}")
|
message(STATUS "Looking for Open CASCADE library files in: ${OCC_LIBRARY_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(NOT OCC_INCLUDE_DIR AND NOT OCC_LIBRARY_DIR)
|
if(NOT OCC_INCLUDE_DIR AND NOT OCC_LIBRARY_DIR)
|
||||||
# OCE is not supported for find_package, because it's using a different name (`oce`)
|
# OCE is not supported for find_package, because it's using a different name (`oce`)
|
||||||
# and also has an odd directory structure (install/lib/oce-0.18/*.cmake).
|
# and also has an odd directory structure (install/lib/oce-0.18/*.cmake).
|
||||||
@@ -41,9 +40,7 @@ if(NOT OCC_INCLUDE_DIR AND NOT OCC_LIBRARY_DIR)
|
|||||||
|
|
||||||
if(OpenCASCADE_VERSION VERSION_LESS "7.7.0")
|
if(OpenCASCADE_VERSION VERSION_LESS "7.7.0")
|
||||||
# cmake configs < 7.7.0 were not adding include directories to targets automatically.
|
# cmake configs < 7.7.0 were not adding include directories to targets automatically.
|
||||||
set_target_properties(TKernel PROPERTIES
|
set_target_properties(TKernel PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${OpenCASCADE_INCLUDE_DIR}")
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenCASCADE_INCLUDE_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(OpenCASCADE_VERSION VERSION_LESS "7.9.0" AND WIN32)
|
if(OpenCASCADE_VERSION VERSION_LESS "7.9.0" AND WIN32)
|
||||||
@@ -62,17 +59,11 @@ if(OCC_INCLUDE_DIR AND OCC_LIBRARY_DIR)
|
|||||||
"and OCC_LIBRARY_DIR ('${OCC_LIBRARY_DIR}')."
|
"and OCC_LIBRARY_DIR ('${OCC_LIBRARY_DIR}')."
|
||||||
)
|
)
|
||||||
# Parse OCC_VERSION_STRING.
|
# Parse OCC_VERSION_STRING.
|
||||||
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAJOR
|
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAJOR REGEX "#define OCC_VERSION_MAJOR.*")
|
||||||
REGEX "#define OCC_VERSION_MAJOR.*"
|
|
||||||
)
|
|
||||||
string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
|
string(REGEX MATCH "[0-9]+" OCC_MAJOR ${OCC_MAJOR})
|
||||||
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MINOR
|
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MINOR REGEX "#define OCC_VERSION_MINOR.*")
|
||||||
REGEX "#define OCC_VERSION_MINOR.*"
|
|
||||||
)
|
|
||||||
string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
|
string(REGEX MATCH "[0-9]+" OCC_MINOR ${OCC_MINOR})
|
||||||
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAINT
|
file(STRINGS ${OCC_INCLUDE_DIR}/Standard_Version.hxx OCC_MAINT REGEX "#define OCC_VERSION_MAINTENANCE.*")
|
||||||
REGEX "#define OCC_VERSION_MAINTENANCE.*"
|
|
||||||
)
|
|
||||||
string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
|
string(REGEX MATCH "[0-9]+" OCC_MAINT ${OCC_MAINT})
|
||||||
set(OCC_VERSION_STRING "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
|
set(OCC_VERSION_STRING "${OCC_MAJOR}.${OCC_MINOR}.${OCC_MAINT}")
|
||||||
else()
|
else()
|
||||||
@@ -86,17 +77,37 @@ else()
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(
|
set(OpenCASCADE_LIBRARIES
|
||||||
OpenCASCADE_LIBRARIES
|
TKernel
|
||||||
TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO
|
TKMath
|
||||||
TKFillet TKXSBase TKOffset TKHLR
|
TKBRep
|
||||||
|
TKGeomBase
|
||||||
|
TKGeomAlgo
|
||||||
|
TKG3d
|
||||||
|
TKG2d
|
||||||
|
TKShHealing
|
||||||
|
TKTopAlgo
|
||||||
|
TKMesh
|
||||||
|
TKPrim
|
||||||
|
TKBool
|
||||||
|
TKBO
|
||||||
|
TKFillet
|
||||||
|
TKXSBase
|
||||||
|
TKOffset
|
||||||
|
TKHLR
|
||||||
# @todo investigate the exact conditions when this is necessary
|
# @todo investigate the exact conditions when this is necessary
|
||||||
TKBin
|
TKBin
|
||||||
)
|
)
|
||||||
|
|
||||||
if(OCC_VERSION_STRING VERSION_LESS 7.8.0)
|
if(OCC_VERSION_STRING VERSION_LESS 7.8.0)
|
||||||
list(APPEND OpenCASCADE_LIBRARIES TKIGES TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP)
|
list(
|
||||||
|
APPEND OpenCASCADE_LIBRARIES
|
||||||
|
TKIGES
|
||||||
|
TKSTEPBase
|
||||||
|
TKSTEPAttr
|
||||||
|
TKSTEP209
|
||||||
|
TKSTEP
|
||||||
|
)
|
||||||
else(OCC_VERSION_STRING VERSION_LESS 7.8.0)
|
else(OCC_VERSION_STRING VERSION_LESS 7.8.0)
|
||||||
list(APPEND OpenCASCADE_LIBRARIES TKDESTEP TKDEIGES)
|
list(APPEND OpenCASCADE_LIBRARIES TKDESTEP TKDEIGES)
|
||||||
endif(OCC_VERSION_STRING VERSION_LESS 7.8.0)
|
endif(OCC_VERSION_STRING VERSION_LESS 7.8.0)
|
||||||
@@ -106,10 +117,7 @@ find_library(libTKernel NAMES TKernel TKerneld PATHS ${OCC_LIBRARY_DIR} NO_DEFAU
|
|||||||
if(libTKernel)
|
if(libTKernel)
|
||||||
message(STATUS "Required Open Cascade Library files found")
|
message(STATUS "Required Open Cascade Library files found")
|
||||||
else()
|
else()
|
||||||
message(
|
message(FATAL_ERROR "Unable to find Open Cascade library files in OCC_LIBRARY_DIR ('${OCC_LIBRARY_DIR}'), aborting")
|
||||||
FATAL_ERROR
|
|
||||||
"Unable to find Open Cascade library files in OCC_LIBRARY_DIR ('${OCC_LIBRARY_DIR}'), aborting"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@@ -138,9 +146,21 @@ if(OCCT_STATIC)
|
|||||||
# OpenCASCADE_LIBRARIES repeated N times below in order to fix cyclic dependencies
|
# OpenCASCADE_LIBRARIES repeated N times below in order to fix cyclic dependencies
|
||||||
# tfk: --start-group ... --end-group didn't work on the apple linker when last tested
|
# tfk: --start-group ... --end-group didn't work on the apple linker when last tested
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(OpenCASCADE_LIBRARIES ${OpenCASCADE_LIBRARIES} ${OpenCASCADE_LIBRARIES} ${OpenCASCADE_LIBRARIES} ${OpenCASCADE_LIBRARIES} ${OpenCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
set(OpenCASCADE_LIBRARIES
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
set(OpenCASCADE_LIBRARIES -Wl,--start-group ${OpenCASCADE_LIBRARIES} -Wl,--end-group ${CMAKE_THREAD_LIBS_INIT})
|
set(OpenCASCADE_LIBRARIES
|
||||||
|
-Wl,--start-group
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
-Wl,--end-group
|
||||||
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -157,5 +177,4 @@ target_include_directories(OpenCASCADE_INTERFACE INTERFACE "${OCC_INCLUDE_DIR}")
|
|||||||
target_link_libraries(OpenCASCADE_INTERFACE INTERFACE ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(OpenCASCADE_INTERFACE INTERFACE ${OpenCASCADE_LIBRARIES})
|
||||||
target_link_directories(OpenCASCADE_INTERFACE INTERFACE "${OCC_LIBRARY_DIR}")
|
target_link_directories(OpenCASCADE_INTERFACE INTERFACE "${OCC_LIBRARY_DIR}")
|
||||||
set(OpenCASCADE_LIBRARIES OpenCASCADE_INTERFACE)
|
set(OpenCASCADE_LIBRARIES OpenCASCADE_INTERFACE)
|
||||||
install(TARGETS OpenCASCADE_INTERFACE
|
install(TARGETS OpenCASCADE_INTERFACE EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
|
||||||
|
|||||||
+39
-13
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
# Input variables:
|
# Input variables:
|
||||||
# - `OPENCOLLADA_INCLUDE_DIR`
|
# - `OPENCOLLADA_INCLUDE_DIR`
|
||||||
@@ -41,23 +40,37 @@ if(NOT OpenCOLLADA_DIR)
|
|||||||
|
|
||||||
if("${OPENCOLLADA_LIBRARY_DIR}" STREQUAL "")
|
if("${OPENCOLLADA_LIBRARY_DIR}" STREQUAL "")
|
||||||
message(STATUS "No OpenCOLLADA library directory specified")
|
message(STATUS "No OpenCOLLADA library directory specified")
|
||||||
find_library(OPENCOLLADA_FRAMEWORK_LIB NAMES OpenCOLLADAFramework
|
find_library(
|
||||||
PATHS /usr/lib64/opencollada /usr/lib/opencollada /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib)
|
OPENCOLLADA_FRAMEWORK_LIB
|
||||||
|
NAMES OpenCOLLADAFramework
|
||||||
|
PATHS /usr/lib64/opencollada /usr/lib/opencollada /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib
|
||||||
|
)
|
||||||
get_filename_component(OPENCOLLADA_LIBRARY_DIR ${OPENCOLLADA_FRAMEWORK_LIB} PATH)
|
get_filename_component(OPENCOLLADA_LIBRARY_DIR ${OPENCOLLADA_FRAMEWORK_LIB} PATH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(OpenCOLLADAFramework NAMES OpenCOLLADAFramework OpenCOLLADAFrameworkd PATHS ${OPENCOLLADA_LIBRARY_DIR} NO_DEFAULT_PATH)
|
find_library(
|
||||||
|
OpenCOLLADAFramework
|
||||||
|
NAMES OpenCOLLADAFramework OpenCOLLADAFrameworkd
|
||||||
|
PATHS ${OPENCOLLADA_LIBRARY_DIR}
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
if(OpenCOLLADAFramework)
|
if(OpenCOLLADAFramework)
|
||||||
message(STATUS "OpenCOLLADA library files found")
|
message(STATUS "OpenCOLLADA library files found")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "COLLADA_SUPPORT enabled, but unable to find OpenCOLLADA libraries. "
|
message(
|
||||||
"Disable COLLADA_SUPPORT or fix OpenCOLLADA paths to proceed.")
|
FATAL_ERROR
|
||||||
|
"COLLADA_SUPPORT enabled, but unable to find OpenCOLLADA libraries. "
|
||||||
|
"Disable COLLADA_SUPPORT or fix OpenCOLLADA paths to proceed."
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(OPENCOLLADA_LIBRARY_DIR "${OPENCOLLADA_LIBRARY_DIR}" CACHE FILEPATH "OpenCOLLADA library files")
|
set(OPENCOLLADA_LIBRARY_DIR "${OPENCOLLADA_LIBRARY_DIR}" CACHE FILEPATH "OpenCOLLADA library files")
|
||||||
|
|
||||||
set(OPENCOLLADA_INCLUDE_DIRS "${OPENCOLLADA_INCLUDE_DIR}/COLLADABaseUtils" "${OPENCOLLADA_INCLUDE_DIR}/COLLADAStreamWriter")
|
set(OPENCOLLADA_INCLUDE_DIRS
|
||||||
|
"${OPENCOLLADA_INCLUDE_DIR}/COLLADABaseUtils"
|
||||||
|
"${OPENCOLLADA_INCLUDE_DIR}/COLLADAStreamWriter"
|
||||||
|
)
|
||||||
|
|
||||||
find_file(COLLADASWStreamWriter_h "COLLADASWStreamWriter.h" ${OPENCOLLADA_INCLUDE_DIRS})
|
find_file(COLLADASWStreamWriter_h "COLLADASWStreamWriter.h" ${OPENCOLLADA_INCLUDE_DIRS})
|
||||||
|
|
||||||
@@ -66,8 +79,15 @@ if(NOT OpenCOLLADA_DIR)
|
|||||||
set(OPENCOLLADA_FOUND TRUE)
|
set(OPENCOLLADA_FOUND TRUE)
|
||||||
|
|
||||||
set(OPENCOLLADA_LIBRARY_NAMES
|
set(OPENCOLLADA_LIBRARY_NAMES
|
||||||
GeneratedSaxParser MathMLSolver OpenCOLLADABaseUtils OpenCOLLADAFramework OpenCOLLADASaxFrameworkLoader
|
GeneratedSaxParser
|
||||||
OpenCOLLADAStreamWriter UTF buffer ftoa
|
MathMLSolver
|
||||||
|
OpenCOLLADABaseUtils
|
||||||
|
OpenCOLLADAFramework
|
||||||
|
OpenCOLLADASaxFrameworkLoader
|
||||||
|
OpenCOLLADAStreamWriter
|
||||||
|
UTF
|
||||||
|
buffer
|
||||||
|
ftoa
|
||||||
)
|
)
|
||||||
|
|
||||||
# Use the found OpenCOLLADAFramework as a template for all other OpenCOLLADA libraries
|
# Use the found OpenCOLLADAFramework as a template for all other OpenCOLLADA libraries
|
||||||
@@ -100,16 +120,22 @@ if(NOT OpenCOLLADA_DIR)
|
|||||||
list(APPEND OPENCOLLADA_LIBRARIES "${pcre_library}")
|
list(APPEND OPENCOLLADA_LIBRARIES "${pcre_library}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "COLLADA_SUPPORT enabled, but unable to find PCRE. "
|
message(
|
||||||
"Disable COLLADA_SUPPORT or fix PCRE_LIBRARY_DIR path to proceed.")
|
FATAL_ERROR
|
||||||
|
"COLLADA_SUPPORT enabled, but unable to find PCRE. "
|
||||||
|
"Disable COLLADA_SUPPORT or fix PCRE_LIBRARY_DIR path to proceed."
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
add_debug_variants(OPENCOLLADA_LIBRARIES "${OPENCOLLADA_LIBRARIES}" d)
|
add_debug_variants(OPENCOLLADA_LIBRARIES "${OPENCOLLADA_LIBRARIES}" d)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "COLLADA_SUPPORT enabled, but unable to find OpenCOLLADA headers. "
|
message(
|
||||||
"Disable COLLADA_SUPPORT or fix OpenCOLLADA paths to proceed.")
|
FATAL_ERROR
|
||||||
|
"COLLADA_SUPPORT enabled, but unable to find OpenCOLLADA headers. "
|
||||||
|
"Disable COLLADA_SUPPORT or fix OpenCOLLADA paths to proceed."
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif(NOT OpenCOLLADA_DIR)
|
endif(NOT OpenCOLLADA_DIR)
|
||||||
|
|
||||||
|
|||||||
+3
-11
@@ -19,20 +19,14 @@ if((NOT PROJ_INCLUDE_DIR AND NOT PROJ_LIBRARIES))
|
|||||||
find_package(PROJ QUIET CONFIG)
|
find_package(PROJ QUIET CONFIG)
|
||||||
|
|
||||||
if(NOT PROJ_FOUND)
|
if(NOT PROJ_FOUND)
|
||||||
find_path(PROJ_INCLUDE_DIR proj.h
|
find_path(PROJ_INCLUDE_DIR proj.h PATHS /usr/include/proj REQUIRED)
|
||||||
PATHS
|
|
||||||
/usr/include/proj
|
|
||||||
REQUIRED
|
|
||||||
)
|
|
||||||
if(PROJ_INCLUDE_DIR)
|
if(PROJ_INCLUDE_DIR)
|
||||||
message(STATUS "Found PROJ include files in: ${PROJ_INCLUDE_DIR}")
|
message(STATUS "Found PROJ include files in: ${PROJ_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unable to find PROJ include directory, specify PROJ_INCLUDE_DIR manually.")
|
message(FATAL_ERROR "Unable to find PROJ include directory, specify PROJ_INCLUDE_DIR manually.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_library(PROJ_LIBRARY
|
find_library(PROJ_LIBRARY NAMES proj PATHS /usr/lib/x86_64-linux-gnu)
|
||||||
NAMES proj
|
|
||||||
PATHS /usr/lib/x86_64-linux-gnu)
|
|
||||||
if(PROJ_LIBRARY)
|
if(PROJ_LIBRARY)
|
||||||
message(STATUS "PROJ libraries ${PROJ_LIBRARY} found in: ${PROJ_LIBRARY_DIR}")
|
message(STATUS "PROJ libraries ${PROJ_LIBRARY} found in: ${PROJ_LIBRARY_DIR}")
|
||||||
set(PROJ_LIBRARIES ${PROJ_LIBRARY})
|
set(PROJ_LIBRARIES ${PROJ_LIBRARY})
|
||||||
@@ -46,9 +40,7 @@ if((NOT PROJ_INCLUDE_DIR AND NOT PROJ_LIBRARIES))
|
|||||||
target_link_directories(PROJ::proj INTERFACE "${PROJ_LIBRARY}")
|
target_link_directories(PROJ::proj INTERFACE "${PROJ_LIBRARY}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
find_library(PROJ_LIBRARY
|
find_library(PROJ_LIBRARY NAMES proj PATHS ${PROJ_LIBRARY_DIR})
|
||||||
NAMES proj
|
|
||||||
PATHS ${PROJ_LIBRARY_DIR})
|
|
||||||
if(PROJ_LIBRARY)
|
if(PROJ_LIBRARY)
|
||||||
message(STATUS "PROJ libraries ${PROJ_LIBRARY} found in: ${PROJ_LIBRARY_DIR}")
|
message(STATUS "PROJ libraries ${PROJ_LIBRARY} found in: ${PROJ_LIBRARY_DIR}")
|
||||||
set(PROJ_LIBRARIES ${PROJ_LIBRARY})
|
set(PROJ_LIBRARIES ${PROJ_LIBRARY})
|
||||||
|
|||||||
+27
-50
@@ -16,7 +16,6 @@ UNIFY_ENVVARS_AND_CACHE(USD_LIBRARY_DIR)
|
|||||||
UNIFY_ENVVARS_AND_CACHE(TBB_INCLUDE_DIR)
|
UNIFY_ENVVARS_AND_CACHE(TBB_INCLUDE_DIR)
|
||||||
UNIFY_ENVVARS_AND_CACHE(TBB_LIBRARY_DIR)
|
UNIFY_ENVVARS_AND_CACHE(TBB_LIBRARY_DIR)
|
||||||
|
|
||||||
|
|
||||||
if(NOT USD_LIBRARY_DIR AND NOT USD_INCLUDE_DIR)
|
if(NOT USD_LIBRARY_DIR AND NOT USD_INCLUDE_DIR)
|
||||||
find_package(pxr CONFIG)
|
find_package(pxr CONFIG)
|
||||||
if(pxr_FOUND)
|
if(pxr_FOUND)
|
||||||
@@ -29,12 +28,7 @@ if(NOT USD_LIBRARY_DIR AND NOT USD_INCLUDE_DIR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT USD_INCLUDE_DIR)
|
if(NOT USD_INCLUDE_DIR)
|
||||||
find_path(USD_INCLUDE_DIR pxr.h
|
find_path(USD_INCLUDE_DIR pxr.h PATHS /usr/include/pxr /usr/local/include/pxr REQUIRED)
|
||||||
PATHS
|
|
||||||
/usr/include/pxr
|
|
||||||
/usr/local/include/pxr
|
|
||||||
REQUIRED
|
|
||||||
)
|
|
||||||
if(USD_INCLUDE_DIR)
|
if(USD_INCLUDE_DIR)
|
||||||
message(STATUS "Found USD include files in: ${USD_INCLUDE_DIR}")
|
message(STATUS "Found USD include files in: ${USD_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
@@ -46,30 +40,28 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(USD_LIBRARIES
|
set(USD_LIBRARIES
|
||||||
usd_usd
|
usd_usd
|
||||||
usd_usdGeom
|
usd_usdGeom
|
||||||
usd_usdShade
|
usd_usdShade
|
||||||
usd_usdLux
|
usd_usdLux
|
||||||
usd_vt
|
usd_vt
|
||||||
usd_sdf
|
usd_sdf
|
||||||
usd_tf
|
usd_tf
|
||||||
usd_gf
|
usd_gf
|
||||||
usd_kind
|
usd_kind
|
||||||
usd_pcp
|
usd_pcp
|
||||||
usd_arch
|
usd_arch
|
||||||
usd_ar
|
usd_ar
|
||||||
usd_plug
|
usd_plug
|
||||||
usd_js
|
usd_js
|
||||||
usd_sdr
|
usd_sdr
|
||||||
usd_work
|
usd_work
|
||||||
usd_trace
|
usd_trace
|
||||||
usd_ndr
|
usd_ndr
|
||||||
usd_ts
|
usd_ts
|
||||||
)
|
)
|
||||||
|
|
||||||
find_library(USD_LIBRARY
|
find_library(USD_LIBRARY NAMES ${USD_LIBRARIES} PATHS ${USD_LIBRARY_DIR})
|
||||||
NAMES ${USD_LIBRARIES}
|
|
||||||
PATHS ${USD_LIBRARY_DIR})
|
|
||||||
if(USD_LIBRARY)
|
if(USD_LIBRARY)
|
||||||
message(STATUS "USD libraries ${USD_LIBRARIES} found in: ${USD_LIBRARY_DIR}")
|
message(STATUS "USD libraries ${USD_LIBRARIES} found in: ${USD_LIBRARY_DIR}")
|
||||||
link_directories(${USD_LIBRARY_DIR})
|
link_directories(${USD_LIBRARY_DIR})
|
||||||
@@ -78,32 +70,17 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(pxr::USD INTERFACE IMPORTED)
|
add_library(pxr::USD INTERFACE IMPORTED)
|
||||||
target_link_directories(pxr::USD
|
target_link_directories(pxr::USD INTERFACE ${USD_LIBRARY_DIR} ${TBB_LIBRARY_DIR})
|
||||||
INTERFACE
|
target_include_directories(pxr::USD INTERFACE ${USD_INCLUDE_DIR} ${TBB_INCLUDE_DIR})
|
||||||
${USD_LIBRARY_DIR} ${TBB_LIBRARY_DIR}
|
|
||||||
)
|
|
||||||
target_include_directories(pxr::USD
|
|
||||||
INTERFACE
|
|
||||||
${USD_INCLUDE_DIR} ${TBB_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
# We don't link TBB libraries - on Windows they're provided using `pragma(lib)`.
|
# We don't link TBB libraries - on Windows they're provided using `pragma(lib)`.
|
||||||
# On Unix there's no `pragma(lib)`, so in theory it will break.
|
# On Unix there's no `pragma(lib)`, so in theory it will break.
|
||||||
target_link_libraries(pxr::USD
|
target_link_libraries(pxr::USD INTERFACE ${USD_LIBRARIES})
|
||||||
INTERFACE
|
|
||||||
${USD_LIBRARIES}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_link_libraries(pxr::USD
|
target_link_libraries(pxr::USD INTERFACE debug DbgHelp.lib)
|
||||||
INTERFACE
|
|
||||||
debug DbgHelp.lib
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_definitions(pxr::USD
|
target_compile_definitions(pxr::USD INTERFACE PXR_STATIC WITH_USD)
|
||||||
INTERFACE
|
|
||||||
PXR_STATIC WITH_USD
|
|
||||||
)
|
|
||||||
|
|
||||||
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_USD)
|
set(SWIG_DEFINES ${SWIG_DEFINES} -DWITH_USD)
|
||||||
|
|||||||
@@ -6,30 +6,17 @@ set(CONFIG_PACKAGE_INPUT "${PROJECT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in")
|
|||||||
set(CONFIG_PACKAGE_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
|
set(CONFIG_PACKAGE_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
|
||||||
|
|
||||||
# Allow linking against build directory.
|
# Allow linking against build directory.
|
||||||
export(
|
export(EXPORT ${IFCOPENSHELL_EXPORT_TARGETS} FILE ${CONFIG_TARGETS_FILENAME} NAMESPACE ${CONFIG_NAMESPACE}::)
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
|
||||||
FILE ${CONFIG_TARGETS_FILENAME}
|
|
||||||
NAMESPACE ${CONFIG_NAMESPACE}::
|
|
||||||
)
|
|
||||||
|
|
||||||
install(
|
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
|
||||||
NAMESPACE ${CONFIG_NAMESPACE}::
|
|
||||||
DESTINATION "${CONFIG_PACKAGE_LOCATION}"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
install(EXPORT ${IFCOPENSHELL_EXPORT_TARGETS} NAMESPACE ${CONFIG_NAMESPACE}:: DESTINATION "${CONFIG_PACKAGE_LOCATION}")
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file(${CONFIG_VERSION_OUTPUT}
|
write_basic_package_version_file(${CONFIG_VERSION_OUTPUT} COMPATIBILITY ExactVersion)
|
||||||
COMPATIBILITY ExactVersion)
|
|
||||||
|
|
||||||
configure_package_config_file(${CONFIG_PACKAGE_INPUT}
|
configure_package_config_file(
|
||||||
|
${CONFIG_PACKAGE_INPUT}
|
||||||
${CONFIG_PACKAGE_OUTPUT}
|
${CONFIG_PACKAGE_OUTPUT}
|
||||||
INSTALL_DESTINATION ${CONFIG_PACKAGE_LOCATION}
|
INSTALL_DESTINATION ${CONFIG_PACKAGE_LOCATION}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES
|
install(FILES "${CONFIG_PACKAGE_OUTPUT}" "${CONFIG_VERSION_OUTPUT}" DESTINATION ${CONFIG_PACKAGE_LOCATION})
|
||||||
"${CONFIG_PACKAGE_OUTPUT}"
|
|
||||||
"${CONFIG_VERSION_OUTPUT}"
|
|
||||||
DESTINATION ${CONFIG_PACKAGE_LOCATION}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ if(SCHEMA_VERSIONS MATCHES "2x3")
|
|||||||
add_executable(IfcAdvancedHouse IfcAdvancedHouse.cpp)
|
add_executable(IfcAdvancedHouse IfcAdvancedHouse.cpp)
|
||||||
add_library(IfcHouseInterface INTERFACE)
|
add_library(IfcHouseInterface INTERFACE)
|
||||||
|
|
||||||
if (STANDALONE_PROJECT)
|
if(STANDALONE_PROJECT)
|
||||||
target_link_libraries(IfcHouseInterface INTERFACE IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer)
|
target_link_libraries(IfcHouseInterface INTERFACE IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(IfcHouseInterface INTERFACE IfcParse geometry_serializer)
|
target_link_libraries(IfcHouseInterface INTERFACE IfcParse geometry_serializer)
|
||||||
|
|||||||
@@ -9,13 +9,18 @@ endif()
|
|||||||
set(IFCCONVERT_FILES ${IFCCONVERT_CPP_FILES} ${IFCCONVERT_H_FILES})
|
set(IFCCONVERT_FILES ${IFCCONVERT_CPP_FILES} ${IFCCONVERT_H_FILES})
|
||||||
add_executable(IfcConvert ${IFCCONVERT_FILES})
|
add_executable(IfcConvert ${IFCCONVERT_FILES})
|
||||||
|
|
||||||
target_link_libraries(IfcConvert
|
target_link_libraries(
|
||||||
|
IfcConvert
|
||||||
PRIVATE
|
PRIVATE
|
||||||
IfcGeom IfcParse Serializers
|
IfcGeom
|
||||||
${OpenCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${HDF5_LIBRARIES} ${USD_LIBRARIES}
|
IfcParse
|
||||||
${CGAL_LIBRARIES} ${GLTF_LIBRARIES}
|
Serializers
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${Boost_LIBRARIES}
|
||||||
|
${HDF5_LIBRARIES}
|
||||||
|
${USD_LIBRARIES}
|
||||||
|
${CGAL_LIBRARIES}
|
||||||
|
${GLTF_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS IfcConvert
|
install(TARGETS IfcConvert EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ file(GLOB SCHEMA_AGNOSTIC_CPP_FILES *.cpp)
|
|||||||
set(SCHEMA_AGNOSTIC_FILES ${SCHEMA_AGNOSTIC_H_FILES} ${SCHEMA_AGNOSTIC_CPP_FILES})
|
set(SCHEMA_AGNOSTIC_FILES ${SCHEMA_AGNOSTIC_H_FILES} ${SCHEMA_AGNOSTIC_CPP_FILES})
|
||||||
|
|
||||||
add_library(IfcGeom ${SCHEMA_AGNOSTIC_FILES})
|
add_library(IfcGeom ${SCHEMA_AGNOSTIC_FILES})
|
||||||
set_target_properties(IfcGeom
|
set_target_properties(
|
||||||
|
IfcGeom
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS -DIFC_GEOM_EXPORTS
|
COMPILE_FLAGS -DIFC_GEOM_EXPORTS
|
||||||
VERSION "${PROJECT_VERSION}"
|
VERSION "${PROJECT_VERSION}"
|
||||||
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
||||||
PUBLIC_HEADER "${SCHEMA_AGNOSTIC_H_FILES}"
|
PUBLIC_HEADER "${SCHEMA_AGNOSTIC_H_FILES}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
@@ -28,16 +29,20 @@ endif()
|
|||||||
|
|
||||||
find_package(Eigen3 REQUIRED)
|
find_package(Eigen3 REQUIRED)
|
||||||
|
|
||||||
target_link_libraries(IfcGeom
|
target_link_libraries(
|
||||||
${kernel_libraries} ${mapping_libraries}
|
IfcGeom
|
||||||
${CMAKE_THREAD_LIBS_INIT} "Eigen3::Eigen"
|
${kernel_libraries}
|
||||||
|
${mapping_libraries}
|
||||||
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
"Eigen3::Eigen"
|
||||||
${CGAL_LIBRARIES}
|
${CGAL_LIBRARIES}
|
||||||
)
|
)
|
||||||
if(NOT WASM_BUILD)
|
if(NOT WASM_BUILD)
|
||||||
target_link_libraries(IfcGeom IfcParse)
|
target_link_libraries(IfcGeom IfcParse)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS IfcGeom
|
install(
|
||||||
|
TARGETS IfcGeom
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
||||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom"
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,15 +3,16 @@ add_subdirectory(schema)
|
|||||||
add_library(geometry_serializer STATIC Serialization.cpp)
|
add_library(geometry_serializer STATIC Serialization.cpp)
|
||||||
file(GLOB IFCGEOM_SERIALIZATION_H_FILE *.h)
|
file(GLOB IFCGEOM_SERIALIZATION_H_FILE *.h)
|
||||||
|
|
||||||
set_target_properties(geometry_serializer PROPERTIES
|
set_target_properties(
|
||||||
COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS"
|
geometry_serializer
|
||||||
PUBLIC_HEADER "${IFCGEOM_SERIALIZATION_H_FILE}"
|
PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS" PUBLIC_HEADER "${IFCGEOM_SERIALIZATION_H_FILE}"
|
||||||
)
|
)
|
||||||
target_link_libraries(geometry_serializer ${geometry_serializer_libraries} IfcParse)
|
target_link_libraries(geometry_serializer ${geometry_serializer_libraries} IfcParse)
|
||||||
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} "geometry_serializer" ${geometry_serializer_libraries})
|
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} "geometry_serializer" ${geometry_serializer_libraries})
|
||||||
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} PARENT_SCOPE)
|
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} PARENT_SCOPE)
|
||||||
|
|
||||||
install(TARGETS geometry_serializer ${geometry_serializer_libraries}
|
install(
|
||||||
|
TARGETS geometry_serializer ${geometry_serializer_libraries}
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
||||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom/Serialization"
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom/Serialization"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
foreach(schema ${SCHEMA_VERSIONS})
|
foreach(schema ${SCHEMA_VERSIONS})
|
||||||
add_library(geometry_serializer_ifc${schema} STATIC Serialization.cpp)
|
add_library(geometry_serializer_ifc${schema} STATIC Serialization.cpp)
|
||||||
target_link_libraries(geometry_serializer_ifc${schema} ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(geometry_serializer_ifc${schema} ${OpenCASCADE_LIBRARIES})
|
||||||
set_target_properties(geometry_serializer_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS -DIfcSchema=Ifc${schema}")
|
set_target_properties(
|
||||||
|
geometry_serializer_ifc${schema}
|
||||||
|
PROPERTIES COMPILE_FLAGS "-DIFC_GEOMSERIALIZATION_EXPORTS -DIfcSchema=Ifc${schema}"
|
||||||
|
)
|
||||||
list(APPEND geometry_serializer_libraries geometry_serializer_ifc${schema})
|
list(APPEND geometry_serializer_libraries geometry_serializer_ifc${schema})
|
||||||
endforeach()
|
endforeach()
|
||||||
set(geometry_serializer_libraries ${geometry_serializer_libraries} PARENT_SCOPE)
|
set(geometry_serializer_libraries ${geometry_serializer_libraries} PARENT_SCOPE)
|
||||||
@@ -9,13 +9,14 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
|||||||
set(KERNEL_TARGET "geometry_kernel_${kernel}")
|
set(KERNEL_TARGET "geometry_kernel_${kernel}")
|
||||||
|
|
||||||
add_library(${KERNEL_TARGET} OBJECT ${IFCGEOM_FILES})
|
add_library(${KERNEL_TARGET} OBJECT ${IFCGEOM_FILES})
|
||||||
set_target_properties(${KERNEL_TARGET} PROPERTIES
|
set_target_properties(
|
||||||
COMPILE_FLAGS "-DIFC_GEOM_EXPORTS"
|
${KERNEL_TARGET}
|
||||||
PUBLIC_HEADER "${IFCGEOM_H_FILES}"
|
PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS" PUBLIC_HEADER "${IFCGEOM_H_FILES}"
|
||||||
)
|
)
|
||||||
list(APPEND kernel_libraries ${KERNEL_TARGET})
|
list(APPEND kernel_libraries ${KERNEL_TARGET})
|
||||||
target_link_libraries(${KERNEL_TARGET} ${${KERNEL_UPPER}_LIBRARIES} Eigen3::Eigen)
|
target_link_libraries(${KERNEL_TARGET} ${${KERNEL_UPPER}_LIBRARIES} Eigen3::Eigen)
|
||||||
install(TARGETS ${KERNEL_TARGET}
|
install(
|
||||||
|
TARGETS ${KERNEL_TARGET}
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
||||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom/kernels/${kernel}"
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcgeom/kernels/${kernel}"
|
||||||
)
|
)
|
||||||
@@ -27,13 +28,14 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
|||||||
|
|
||||||
set(KERNEL_TARGET_SIMPLE "${KERNEL_TARGET}_simple")
|
set(KERNEL_TARGET_SIMPLE "${KERNEL_TARGET}_simple")
|
||||||
add_library(${KERNEL_TARGET_SIMPLE} OBJECT ${IFCGEOM_FILES})
|
add_library(${KERNEL_TARGET_SIMPLE} OBJECT ${IFCGEOM_FILES})
|
||||||
set_target_properties(${KERNEL_TARGET_SIMPLE} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIFOPSH_SIMPLE_KERNEL -DCGAL_HAS_THREADS")
|
set_target_properties(
|
||||||
|
${KERNEL_TARGET_SIMPLE}
|
||||||
|
PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIFOPSH_SIMPLE_KERNEL -DCGAL_HAS_THREADS"
|
||||||
|
)
|
||||||
list(APPEND kernel_libraries ${KERNEL_TARGET_SIMPLE})
|
list(APPEND kernel_libraries ${KERNEL_TARGET_SIMPLE})
|
||||||
target_link_libraries(${KERNEL_TARGET_SIMPLE} ${${KERNEL_UPPER}_LIBRARIES} Eigen3::Eigen)
|
target_link_libraries(${KERNEL_TARGET_SIMPLE} ${${KERNEL_UPPER}_LIBRARIES} Eigen3::Eigen)
|
||||||
target_link_libraries(${KERNEL_TARGET_SIMPLE} IFCOPENSHELL_CGAL)
|
target_link_libraries(${KERNEL_TARGET_SIMPLE} IFCOPENSHELL_CGAL)
|
||||||
install(TARGETS ${KERNEL_TARGET_SIMPLE}
|
install(TARGETS ${KERNEL_TARGET_SIMPLE} EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
|
||||||
)
|
|
||||||
elseif(${kernel} STREQUAL "opencascade")
|
elseif(${kernel} STREQUAL "opencascade")
|
||||||
target_link_libraries(${KERNEL_TARGET} ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(${KERNEL_TARGET} ${OpenCASCADE_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -7,13 +7,14 @@ foreach(schema ${SCHEMA_VERSIONS})
|
|||||||
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES})
|
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES})
|
||||||
|
|
||||||
add_library(geometry_mapping_ifc${schema} OBJECT ${IFCGEOM_FILES})
|
add_library(geometry_mapping_ifc${schema} OBJECT ${IFCGEOM_FILES})
|
||||||
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
|
set_target_properties(
|
||||||
target_link_libraries(geometry_mapping_ifc${schema} IfcParse Eigen3::Eigen)
|
geometry_mapping_ifc${schema}
|
||||||
|
PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}"
|
||||||
|
)
|
||||||
|
target_link_libraries(geometry_mapping_ifc${schema} IfcParse Eigen3::Eigen)
|
||||||
|
|
||||||
list(APPEND mapping_libraries geometry_mapping_ifc${schema})
|
list(APPEND mapping_libraries geometry_mapping_ifc${schema})
|
||||||
install(TARGETS geometry_mapping_ifc${schema}
|
install(TARGETS geometry_mapping_ifc${schema} EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
|
||||||
)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
set(mapping_libraries ${mapping_libraries} PARENT_SCOPE)
|
set(mapping_libraries ${mapping_libraries} PARENT_SCOPE)
|
||||||
|
|||||||
@@ -5,6 +5,4 @@ set(SOURCE_FILES ${CPP_FILES})
|
|||||||
add_executable(IfcGeomServer ${SOURCE_FILES})
|
add_executable(IfcGeomServer ${SOURCE_FILES})
|
||||||
target_link_libraries(IfcGeomServer IfcGeom ${kernel_libraries} ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(IfcGeomServer IfcGeom ${kernel_libraries} ${OpenCASCADE_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS IfcGeomServer
|
install(TARGETS IfcGeomServer EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -32,22 +32,32 @@ endforeach()
|
|||||||
if(HAS_MAX)
|
if(HAS_MAX)
|
||||||
# build libraray for each found 3ds Max SDK
|
# build libraray for each found 3ds Max SDK
|
||||||
foreach(max_year max_sdk IN ZIP_LISTS FOUND_MAX_YEARS FOUND_MAX_SDKS)
|
foreach(max_year max_sdk IN ZIP_LISTS FOUND_MAX_YEARS FOUND_MAX_SDKS)
|
||||||
|
|
||||||
message(STATUS "Building IFCMax library for Autodesk 3ds Max SDK ${max_year}")
|
message(STATUS "Building IFCMax library for Autodesk 3ds Max SDK ${max_year}")
|
||||||
|
|
||||||
include_directories(${INCLUDE_DIRECTORIES} ${OPENCOLLADA_INCLUDE_DIRS} ${ICU_INCLUDE_DIR}
|
include_directories(
|
||||||
${Boost_INCLUDE_DIRS} ${max_sdk}/include
|
${INCLUDE_DIRECTORIES}
|
||||||
|
${OPENCOLLADA_INCLUDE_DIRS}
|
||||||
|
${ICU_INCLUDE_DIR}
|
||||||
|
${Boost_INCLUDE_DIRS}
|
||||||
|
${max_sdk}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory
|
# All recent versions of 3ds Max (2014 and newer) are 64-bit only so assume lib/x64 directory
|
||||||
link_directories(${LINK_DIRECTORIES} ${IfcOpenShell_BINARY_DIR} ${OPENCOLLADA_LIBRARY_DIR}
|
link_directories(
|
||||||
${ICU_LIBRARY_DIR} ${Boost_LIBRARY_DIRS} ${max_sdk}/lib/x64/Release
|
${LINK_DIRECTORIES}
|
||||||
|
${IfcOpenShell_BINARY_DIR}
|
||||||
|
${OPENCOLLADA_LIBRARY_DIR}
|
||||||
|
${ICU_LIBRARY_DIR}
|
||||||
|
${Boost_LIBRARY_DIRS}
|
||||||
|
${max_sdk}/lib/x64/Release
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(IfcMax_${max_year} SHARED IfcMax.h IfcMax.cpp)
|
add_library(IfcMax_${max_year} SHARED IfcMax.h IfcMax.cpp)
|
||||||
|
|
||||||
# TODO: find the minimal subset of 3dsmax libraries to reference
|
# TODO: find the minimal subset of 3dsmax libraries to reference
|
||||||
target_link_libraries(IfcMax_${max_year} ${IFCOPENSHELL_LIBRARIES}
|
target_link_libraries(
|
||||||
|
IfcMax_${max_year}
|
||||||
|
${IFCOPENSHELL_LIBRARIES}
|
||||||
bmm.lib
|
bmm.lib
|
||||||
Comctl32.lib
|
Comctl32.lib
|
||||||
core.lib
|
core.lib
|
||||||
@@ -84,4 +94,3 @@ if(HAS_MAX)
|
|||||||
else()
|
else()
|
||||||
message(STATUS "Autodesk 3ds Max SDK not found, is required to build IFCMax.")
|
message(STATUS "Autodesk 3ds Max SDK not found, is required to build IFCMax.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
+10
-14
@@ -18,26 +18,21 @@ foreach(file ${IFCPARSE_CPP_FILES_ALL})
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
foreach(schema ${SCHEMA_VERSIONS})
|
foreach(schema ${SCHEMA_VERSIONS})
|
||||||
list(APPEND IFCPARSE_H_FILES
|
list(APPEND IFCPARSE_H_FILES Ifc${schema}.h Ifc${schema}-definitions.h)
|
||||||
Ifc${schema}.h
|
list(APPEND IFCPARSE_CPP_FILES Ifc${schema}.cpp Ifc${schema}-schema.cpp)
|
||||||
Ifc${schema}-definitions.h
|
|
||||||
)
|
|
||||||
list(APPEND IFCPARSE_CPP_FILES
|
|
||||||
Ifc${schema}.cpp
|
|
||||||
Ifc${schema}-schema.cpp
|
|
||||||
)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
|
||||||
|
|
||||||
add_library(IfcParse ${IFCPARSE_FILES})
|
add_library(IfcParse ${IFCPARSE_FILES})
|
||||||
target_compile_definitions(IfcParse PUBLIC ${SCHEMA_DEFINITIONS})
|
target_compile_definitions(IfcParse PUBLIC ${SCHEMA_DEFINITIONS})
|
||||||
set_target_properties(IfcParse
|
set_target_properties(
|
||||||
|
IfcParse
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS -DIFC_PARSE_EXPORTS
|
COMPILE_FLAGS -DIFC_PARSE_EXPORTS
|
||||||
VERSION "${PROJECT_VERSION}"
|
VERSION "${PROJECT_VERSION}"
|
||||||
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
||||||
PUBLIC_HEADER "${IFCPARSE_H_FILES}"
|
PUBLIC_HEADER "${IFCPARSE_H_FILES}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(IFCXML_SUPPORT)
|
if(IFCXML_SUPPORT)
|
||||||
@@ -56,7 +51,8 @@ endif()
|
|||||||
|
|
||||||
target_link_libraries(IfcParse ${ROCKSDB_LIBRARIES})
|
target_link_libraries(IfcParse ${ROCKSDB_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS IfcParse
|
install(
|
||||||
|
TARGETS IfcParse
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
||||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcparse"
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ifcparse"
|
||||||
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
|
|||||||
+70
-83
@@ -24,27 +24,27 @@ if(POLICY CMP0177) # 3.31
|
|||||||
cmake_policy(SET CMP0177 OLD)
|
cmake_policy(SET CMP0177 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
FIND_PACKAGE(SWIG)
|
find_package(SWIG)
|
||||||
IF(NOT SWIG_FOUND)
|
if(NOT SWIG_FOUND)
|
||||||
MESSAGE(
|
message(
|
||||||
FATAL_ERROR
|
FATAL_ERROR
|
||||||
"BUILD_IFCPYTHON enabled, but unable to find SWIG. Disable BUILD_IFCPYTHON or fix SWIG paths to proceed. "
|
"BUILD_IFCPYTHON enabled, but unable to find SWIG. Disable BUILD_IFCPYTHON or fix SWIG paths to proceed. "
|
||||||
"Likely SWIG_EXECUTABLE is missing (current value - '${SWIG_EXECUTABLE}')."
|
"Likely SWIG_EXECUTABLE is missing (current value - '${SWIG_EXECUTABLE}')."
|
||||||
)
|
)
|
||||||
ENDIF()
|
endif()
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
INCLUDE(${SWIG_USE_FILE})
|
include(${SWIG_USE_FILE})
|
||||||
|
|
||||||
IF(NOT "${PYTHON_INCLUDE_DIR}" STREQUAL "")
|
if(NOT "${PYTHON_INCLUDE_DIR}" STREQUAL "")
|
||||||
# Hint for FindPython where to find Python_INCLUDE_DIRS.
|
# Hint for FindPython where to find Python_INCLUDE_DIRS.
|
||||||
set(Python_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
|
set(Python_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
|
||||||
MESSAGE(STATUS "Looking for Python header files in: ${Python_INCLUDE_DIR}")
|
message(STATUS "Looking for Python header files in: ${Python_INCLUDE_DIR}")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT "${PYTHON_LIBRARY}" STREQUAL "")
|
if(NOT "${PYTHON_LIBRARY}" STREQUAL "")
|
||||||
# Hint for FindPython where to find Python_LIBRARIES.
|
# Hint for FindPython where to find Python_LIBRARIES.
|
||||||
set(Python_LIBRARY "${PYTHON_LIBRARY}")
|
set(Python_LIBRARY "${PYTHON_LIBRARY}")
|
||||||
MESSAGE(STATUS "Looking for Python library file in: ${Python_LIBRARY}")
|
message(STATUS "Looking for Python library file in: ${Python_LIBRARY}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Development.Module = headers on Unix, headers+libraries on Windows.
|
# Development.Module = headers on Unix, headers+libraries on Windows.
|
||||||
# Required variables:
|
# Required variables:
|
||||||
@@ -53,31 +53,29 @@ ENDIF()
|
|||||||
# Unfortunately all paths must be always provided explicitly, not by prefixing PATH.
|
# Unfortunately all paths must be always provided explicitly, not by prefixing PATH.
|
||||||
# Otherwise FindPython will break on newer Python versions (list of supported versions is hardcoded).
|
# Otherwise FindPython will break on newer Python versions (list of supported versions is hardcoded).
|
||||||
find_package(Python COMPONENTS Development.Module)
|
find_package(Python COMPONENTS Development.Module)
|
||||||
IF(NOT Python_Development.Module_FOUND)
|
if(NOT Python_Development.Module_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "BUILD_IFCPYTHON enabled, but unable to find Python lib or header. Disable BUILD_IFCPYTHON or fix Python paths to proceed.")
|
message(
|
||||||
ENDIF()
|
FATAL_ERROR
|
||||||
|
"BUILD_IFCPYTHON enabled, but unable to find Python lib or header. Disable BUILD_IFCPYTHON or fix Python paths to proceed."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Ensure version is saved here, from wasm libraries,
|
# Ensure version is saved here, from wasm libraries,
|
||||||
# not from Python interpreter that might be unrelated to pyodide Python version.
|
# not from Python interpreter that might be unrelated to pyodide Python version.
|
||||||
set(_python_libs_version "${Python_VERSION_MAJOR}${Python_VERSION_MINOR}")
|
set(_python_libs_version "${Python_VERSION_MAJOR}${Python_VERSION_MINOR}")
|
||||||
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
SET(CMAKE_SWIG_FLAGS ${SWIG_DEFINES})
|
set(CMAKE_SWIG_FLAGS ${SWIG_DEFINES})
|
||||||
|
|
||||||
if (WITH_CGAL)
|
if(WITH_CGAL)
|
||||||
set(LIBSVGFILL svgfill)
|
set(LIBSVGFILL svgfill)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(IfcPython.i PROPERTIES CPLUSPLUS ON)
|
set_source_files_properties(IfcPython.i PROPERTIES CPLUSPLUS ON)
|
||||||
# Rebuild on changes in other .i files.
|
# Rebuild on changes in other .i files.
|
||||||
SET_PROPERTY(
|
set_property(
|
||||||
SOURCE IfcPython.i
|
SOURCE IfcPython.i
|
||||||
PROPERTY DEPENDS
|
PROPERTY DEPENDS IfcGeomWrapper.i IfcParseWrapper.i utils/type_conversion.i utils/typemaps_in.i utils/typemaps_out.i
|
||||||
IfcGeomWrapper.i
|
|
||||||
IfcParseWrapper.i
|
|
||||||
utils/type_conversion.i
|
|
||||||
utils/typemaps_in.i
|
|
||||||
utils/typemaps_out.i
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# On Windows there is '_d' prefix for debug builds - e.g. `_d.cp311-win_amd64.pyd`.
|
# On Windows there is '_d' prefix for debug builds - e.g. `_d.cp311-win_amd64.pyd`.
|
||||||
@@ -92,20 +90,18 @@ endif()
|
|||||||
# But debug mode is still might be needed - e.g. Blender's Python is using it, if you're running debug build.
|
# But debug mode is still might be needed - e.g. Blender's Python is using it, if you're running debug build.
|
||||||
if(NOT USE_DEBUG_PYTHON)
|
if(NOT USE_DEBUG_PYTHON)
|
||||||
set(Python_DEBUG_POSTFIX "")
|
set(Python_DEBUG_POSTFIX "")
|
||||||
add_compile_definitions(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
|
add_compile_definitions(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
|
||||||
if(Python_LIBRARY_DEBUG)
|
if(Python_LIBRARY_DEBUG)
|
||||||
# If debug libraries were found, then override them with release ones.
|
# If debug libraries were found, then override them with release ones.
|
||||||
get_target_property(IMPORTED_IMPLIB Python::Module IMPORTED_IMPLIB_RELEASE)
|
get_target_property(IMPORTED_IMPLIB Python::Module IMPORTED_IMPLIB_RELEASE)
|
||||||
get_target_property(IMPORTED_LOCATION Python::Module IMPORTED_LOCATION_RELEASE)
|
get_target_property(IMPORTED_LOCATION Python::Module IMPORTED_LOCATION_RELEASE)
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
Python::Module
|
Python::Module
|
||||||
PROPERTIES
|
PROPERTIES IMPORTED_IMPLIB_DEBUG "${IMPORTED_IMPLIB}" IMPORTED_LOCATION_DEBUG "${IMPORTED_LOCATION}"
|
||||||
IMPORTED_IMPLIB_DEBUG "${IMPORTED_IMPLIB}"
|
|
||||||
IMPORTED_LOCATION_DEBUG "${IMPORTED_LOCATION}"
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL "4.2")
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "4.2")
|
||||||
# `DEBUG_POSTFIX` argument was added in 4.2.
|
# `DEBUG_POSTFIX` argument was added in 4.2.
|
||||||
swig_add_library(ifcopenshell_wrapper LANGUAGE python SOURCES IfcPython.i DEBUG_POSTFIX "${Python_DEBUG_POSTFIX}")
|
swig_add_library(ifcopenshell_wrapper LANGUAGE python SOURCES IfcPython.i DEBUG_POSTFIX "${Python_DEBUG_POSTFIX}")
|
||||||
else()
|
else()
|
||||||
@@ -113,15 +109,12 @@ else()
|
|||||||
# swig py wrapper will try to import `_ifcopenshell_wrapper_d` module and would fail.
|
# swig py wrapper will try to import `_ifcopenshell_wrapper_d` module and would fail.
|
||||||
set(SWIG_MODULE_ifcopenshell_wrapper_EXTRA_FLAGS "-interface" "_ifcopenshell_wrapper")
|
set(SWIG_MODULE_ifcopenshell_wrapper_EXTRA_FLAGS "-interface" "_ifcopenshell_wrapper")
|
||||||
swig_add_library(ifcopenshell_wrapper LANGUAGE python SOURCES IfcPython.i)
|
swig_add_library(ifcopenshell_wrapper LANGUAGE python SOURCES IfcPython.i)
|
||||||
set_target_properties(
|
set_target_properties(ifcopenshell_wrapper PROPERTIES DEBUG_POSTFIX "${Python_DEBUG_POSTFIX}")
|
||||||
ifcopenshell_wrapper PROPERTIES
|
|
||||||
DEBUG_POSTFIX "${Python_DEBUG_POSTFIX}"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(ifcopenshell_wrapper PRIVATE Python::Module)
|
target_link_libraries(ifcopenshell_wrapper PRIVATE Python::Module)
|
||||||
SET_PROPERTY(TARGET ifcopenshell_wrapper PROPERTY SWIG_DEPENDS ${IFCOPENSHELL_LIBRARIES})
|
set_property(TARGET ifcopenshell_wrapper PROPERTY SWIG_DEPENDS ${IFCOPENSHELL_LIBRARIES})
|
||||||
if (WASM_BUILD)
|
if(WASM_BUILD)
|
||||||
# SIDE_MODULE=1 - add to .so all symbols from linked archives (default used by pyodide).
|
# SIDE_MODULE=1 - add to .so all symbols from linked archives (default used by pyodide).
|
||||||
# Since currently libIfcGeom.a seems to be linked twice it results in duplicated symbols and compilation errors.
|
# Since currently libIfcGeom.a seems to be linked twice it results in duplicated symbols and compilation errors.
|
||||||
# Possibly in the future we can clean up linked libs and try `=1`.
|
# Possibly in the future we can clean up linked libs and try `=1`.
|
||||||
@@ -130,11 +123,7 @@ if (WASM_BUILD)
|
|||||||
if(CMAKE_GENERATOR MATCHES "Makefile" AND CMAKE_VERSION VERSION_LESS "4.2")
|
if(CMAKE_GENERATOR MATCHES "Makefile" AND CMAKE_VERSION VERSION_LESS "4.2")
|
||||||
# Accomodate bug in cmake makefile generator (fixed in 4.2+).
|
# Accomodate bug in cmake makefile generator (fixed in 4.2+).
|
||||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/27326
|
# https://gitlab.kitware.com/cmake/cmake/-/issues/27326
|
||||||
string(
|
string(REPLACE "SIDE_MODULE=1" "SIDE_MODULE=2" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
REPLACE "SIDE_MODULE=1" "SIDE_MODULE=2"
|
|
||||||
CMAKE_MODULE_LINKER_FLAGS
|
|
||||||
"${CMAKE_MODULE_LINKER_FLAGS}"
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
target_link_options(
|
target_link_options(
|
||||||
ifcopenshell_wrapper
|
ifcopenshell_wrapper
|
||||||
@@ -142,13 +131,16 @@ if (WASM_BUILD)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
if("$ENV{LDFLAGS}" MATCHES ".undefined.suppress")
|
if("$ENV{LDFLAGS}" MATCHES ".undefined.suppress")
|
||||||
# On osx there is some state in the python dylib. With `-Wl,undefined,suppress` we can ignore the missing symbols at compile time.
|
# On osx there is some state in the python dylib. With `-Wl,undefined,suppress` we can ignore the missing symbols at compile time.
|
||||||
target_link_libraries(ifcopenshell_wrapper PRIVATE ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${LIBSVGFILL})
|
target_link_libraries(
|
||||||
|
ifcopenshell_wrapper
|
||||||
|
PRIVATE ${IFCOPENSHELL_LIBRARIES} ${OpenCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${LIBSVGFILL}
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(ifcopenshell_wrapper PRIVATE ${IFCOPENSHELL_LIBRARIES} ${LIBSVGFILL})
|
target_link_libraries(ifcopenshell_wrapper PRIVATE ${IFCOPENSHELL_LIBRARIES} ${LIBSVGFILL})
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(ifcopenshell_wrapper PRIVATE ${CGAL_LIBRARIES})
|
target_link_libraries(ifcopenshell_wrapper PRIVATE ${CGAL_LIBRARIES})
|
||||||
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
|
if((NOT WIN32) AND BUILD_SHARED_LIBS)
|
||||||
SET_INSTALL_RPATHS(ifcopenshell_wrapper "${IFCDIRS};${OCC_LIBRARY_DIR}")
|
SET_INSTALL_RPATHS(ifcopenshell_wrapper "${IFCDIRS};${OCC_LIBRARY_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -156,10 +148,10 @@ endif()
|
|||||||
# directory in which the wrapper can be installed.
|
# directory in which the wrapper can be installed.
|
||||||
if(NOT ${PYTHON_EXECUTABLE} STREQUAL "")
|
if(NOT ${PYTHON_EXECUTABLE} STREQUAL "")
|
||||||
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
|
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
|
||||||
MESSAGE(STATUS "Looking for Python interpreter in: ${PYTHON_EXECUTABLE}")
|
message(STATUS "Looking for Python interpreter in: ${PYTHON_EXECUTABLE}")
|
||||||
endif()
|
endif()
|
||||||
FIND_PACKAGE(Python COMPONENTS Interpreter)
|
find_package(Python COMPONENTS Interpreter)
|
||||||
IF(Python_Interpreter_FOUND OR PYTHON_MODULE_INSTALL_DIR)
|
if(Python_Interpreter_FOUND OR PYTHON_MODULE_INSTALL_DIR)
|
||||||
# Python_SOABI example value is 'cp311-win_amd64'.
|
# Python_SOABI example value is 'cp311-win_amd64'.
|
||||||
if(WASM_BUILD)
|
if(WASM_BUILD)
|
||||||
# For WASM we usually don't provide interpreter,
|
# For WASM we usually don't provide interpreter,
|
||||||
@@ -172,48 +164,43 @@ IF(Python_Interpreter_FOUND OR PYTHON_MODULE_INSTALL_DIR)
|
|||||||
else()
|
else()
|
||||||
set(PYTHON_EXTENSION_SUFFIX ".${Python_SOABI}.so")
|
set(PYTHON_EXTENSION_SUFFIX ".${Python_SOABI}.so")
|
||||||
endif()
|
endif()
|
||||||
set_target_properties(
|
set_target_properties(ifcopenshell_wrapper PROPERTIES SUFFIX ${PYTHON_EXTENSION_SUFFIX})
|
||||||
ifcopenshell_wrapper PROPERTIES
|
if(PYTHON_MODULE_INSTALL_DIR)
|
||||||
SUFFIX ${PYTHON_EXTENSION_SUFFIX}
|
set(python_package_dir "${PYTHON_MODULE_INSTALL_DIR}")
|
||||||
)
|
|
||||||
if (PYTHON_MODULE_INSTALL_DIR)
|
|
||||||
set(python_package_dir "${PYTHON_MODULE_INSTALL_DIR}")
|
|
||||||
else()
|
else()
|
||||||
IF (USERSPACE_PYTHON_PREFIX)
|
if(USERSPACE_PYTHON_PREFIX)
|
||||||
EXECUTE_PROCESS(
|
execute_process(
|
||||||
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; import site; sys.stdout.write(site.USER_SITE)"
|
COMMAND ${PYTHON_EXECUTABLE} -c "import sys; import site; sys.stdout.write(site.USER_SITE)"
|
||||||
OUTPUT_VARIABLE python_package_dir
|
OUTPUT_VARIABLE python_package_dir
|
||||||
)
|
)
|
||||||
ELSE ()
|
else()
|
||||||
set(python_package_dir "${Python_SITEARCH}")
|
set(python_package_dir "${Python_SITEARCH}")
|
||||||
ENDIF()
|
endif()
|
||||||
if (BUILD_PACKAGE)
|
if(BUILD_PACKAGE)
|
||||||
set(python_package_dir ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}/dist-packages/)
|
set(python_package_dir ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}/dist-packages/)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
IF("${python_package_dir}" STREQUAL "")
|
if("${python_package_dir}" STREQUAL "")
|
||||||
MESSAGE(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper")
|
message(WARNING "Unable to locate Python site-package directory, unable to install the Python wrapper")
|
||||||
ELSE()
|
else()
|
||||||
message(STATUS "Python wrapper will be installed to '${python_package_dir}'.")
|
message(STATUS "Python wrapper will be installed to '${python_package_dir}'.")
|
||||||
FILE(GLOB_RECURSE sourcefiles
|
file(GLOB_RECURSE sourcefiles "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/*")
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/*"
|
foreach(file ${sourcefiles})
|
||||||
)
|
file(RELATIVE_PATH relative "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/" "${file}")
|
||||||
FOREACH(file ${sourcefiles})
|
get_filename_component(dir "${relative}" DIRECTORY)
|
||||||
FILE(RELATIVE_PATH relative "${CMAKE_CURRENT_SOURCE_DIR}/../ifcopenshell-python/ifcopenshell/" "${file}")
|
|
||||||
GET_FILENAME_COMPONENT(dir "${relative}" DIRECTORY)
|
|
||||||
if(NOT IS_DIRECTORY "${file}")
|
if(NOT IS_DIRECTORY "${file}")
|
||||||
INSTALL(FILES "${file}"
|
install(FILES "${file}" DESTINATION "${python_package_dir}/ifcopenshell/${dir}")
|
||||||
DESTINATION "${python_package_dir}/ifcopenshell/${dir}")
|
|
||||||
endif()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
INSTALL(FILES "${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell_wrapper.py"
|
install(
|
||||||
DESTINATION "${python_package_dir}/ifcopenshell")
|
FILES "${CMAKE_BINARY_DIR}/ifcwrap/ifcopenshell_wrapper.py"
|
||||||
INSTALL(TARGETS ifcopenshell_wrapper
|
DESTINATION "${python_package_dir}/ifcopenshell"
|
||||||
DESTINATION "${python_package_dir}/ifcopenshell")
|
)
|
||||||
if (MSVC)
|
install(TARGETS ifcopenshell_wrapper DESTINATION "${python_package_dir}/ifcopenshell")
|
||||||
INSTALL(FILES $<TARGET_PDB_FILE:ifcopenshell_wrapper> DESTINATION bin OPTIONAL)
|
if(MSVC)
|
||||||
endif()
|
install(FILES $<TARGET_PDB_FILE:ifcopenshell_wrapper> DESTINATION bin OPTIONAL)
|
||||||
ENDIF()
|
endif()
|
||||||
ELSE()
|
endif()
|
||||||
MESSAGE(WARNING "No Python interpreter found, unable to install the Python wrapper")
|
else()
|
||||||
ENDIF()
|
message(WARNING "No Python interpreter found, unable to install the Python wrapper")
|
||||||
|
endif()
|
||||||
|
|||||||
+19
-18
@@ -21,7 +21,15 @@ message("Running CMakeLists.txt in /src/qtviewer")
|
|||||||
|
|
||||||
# Specify the Qt version and components to use
|
# Specify the Qt version and components to use
|
||||||
set(QT_VERSION 6 CACHE STRING "Qt version")
|
set(QT_VERSION 6 CACHE STRING "Qt version")
|
||||||
set(QT_COMPONENTS Core Gui OpenGL OpenGLWidgets Widgets CACHE STRING "Qt components")
|
set(QT_COMPONENTS
|
||||||
|
Core
|
||||||
|
Gui
|
||||||
|
OpenGL
|
||||||
|
OpenGLWidgets
|
||||||
|
Widgets
|
||||||
|
CACHE STRING
|
||||||
|
"Qt components"
|
||||||
|
)
|
||||||
|
|
||||||
find_package(Qt${QT_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED PATHS ${QT_DIR})
|
find_package(Qt${QT_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED PATHS ${QT_DIR})
|
||||||
|
|
||||||
@@ -45,10 +53,7 @@ set(targetName "QtViewer")
|
|||||||
# Scan for .qrc files and add to build process
|
# Scan for .qrc files and add to build process
|
||||||
set(CMAKE_AUTORCC ON)
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
set(RESOURCE_FILES
|
set(RESOURCE_FILES resources/qt_resources.qrc resources/qt_res.rc)
|
||||||
resources/qt_resources.qrc
|
|
||||||
resources/qt_res.rc
|
|
||||||
)
|
|
||||||
|
|
||||||
# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
|
# The MACOSX_BUNDLE_ICON_FILE variable is added to the Info.plist
|
||||||
# generated by CMake. This variable contains the .icns file name,
|
# generated by CMake. This variable contains the .icns file name,
|
||||||
@@ -57,10 +62,10 @@ set(MACOSX_BUNDLE_ICON_FILE ifcosLogo.icns)
|
|||||||
|
|
||||||
# The following tells CMake where to find and install the file itself.
|
# The following tells CMake where to find and install the file itself.
|
||||||
set(app_icon_macos "resources/ifcosLogo.icns")
|
set(app_icon_macos "resources/ifcosLogo.icns")
|
||||||
set_source_files_properties(${app_icon_macos} PROPERTIES
|
set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||||
MACOSX_PACKAGE_LOCATION "Resources")
|
|
||||||
|
|
||||||
add_executable(${targetName}
|
add_executable(
|
||||||
|
${targetName}
|
||||||
MessageLogger.h
|
MessageLogger.h
|
||||||
IfcViewerWidget.h
|
IfcViewerWidget.h
|
||||||
IfcViewerWidget.cpp
|
IfcViewerWidget.cpp
|
||||||
@@ -73,14 +78,13 @@ add_executable(${targetName}
|
|||||||
${app_icon_macos}
|
${app_icon_macos}
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(${targetName} PROPERTIES
|
set_target_properties(
|
||||||
AUTOMOC On
|
${targetName}
|
||||||
WIN32_EXECUTABLE ON
|
PROPERTIES AUTOMOC On WIN32_EXECUTABLE ON MACOSX_BUNDLE ON RESOURCE "${RESOURCE_FILES}"
|
||||||
MACOSX_BUNDLE ON
|
|
||||||
RESOURCE "${RESOURCE_FILES}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${targetName}
|
target_link_libraries(
|
||||||
|
${targetName}
|
||||||
${IFCOPENSHELL_LIBRARIES}
|
${IFCOPENSHELL_LIBRARIES}
|
||||||
${OpenCASCADE_LIBRARIES}
|
${OpenCASCADE_LIBRARIES}
|
||||||
${OPENSCENEGRAPH_LIBRARIES}
|
${OPENSCENEGRAPH_LIBRARIES}
|
||||||
@@ -91,10 +95,7 @@ target_link_libraries(${targetName}
|
|||||||
Qt${QT_VERSION}::Widgets
|
Qt${QT_VERSION}::Widgets
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(${targetName} PUBLIC
|
target_include_directories(${targetName} PUBLIC ${QT_DIR}/include ${OPENSCENEGRAPH_INCLUDE_DIRS})
|
||||||
${QT_DIR}/include
|
|
||||||
${OPENSCENEGRAPH_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
get_target_property(targetIncludeDirs ${targetName} INCLUDE_DIRECTORIES)
|
get_target_property(targetIncludeDirs ${targetName} INCLUDE_DIRECTORIES)
|
||||||
message(STATUS "target_include_directories: ${targetIncludeDirs}")
|
message(STATUS "target_include_directories: ${targetIncludeDirs}")
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ file(GLOB SERIALIZERS_CPP_FILES *.cpp)
|
|||||||
set(SERIALIZERS_FILES ${SERIALIZERS_H_FILES} ${SERIALIZERS_CPP_FILES})
|
set(SERIALIZERS_FILES ${SERIALIZERS_H_FILES} ${SERIALIZERS_CPP_FILES})
|
||||||
|
|
||||||
add_library(Serializers ${SERIALIZERS_FILES})
|
add_library(Serializers ${SERIALIZERS_FILES})
|
||||||
set_target_properties(Serializers PROPERTIES
|
set_target_properties(
|
||||||
COMPILE_FLAGS "-DSERIALIZERS_EXPORTS"
|
Serializers
|
||||||
VERSION "${PROJECT_VERSION}"
|
PROPERTIES
|
||||||
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
COMPILE_FLAGS "-DSERIALIZERS_EXPORTS"
|
||||||
|
VERSION "${PROJECT_VERSION}"
|
||||||
|
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}"
|
||||||
)
|
)
|
||||||
set(SERIALIZER_SCHEMA_LIBRARIES Serializers ${SERIALIZER_SCHEMA_LIBRARIES} PARENT_SCOPE)
|
set(SERIALIZER_SCHEMA_LIBRARIES Serializers ${SERIALIZER_SCHEMA_LIBRARIES} PARENT_SCOPE)
|
||||||
|
|
||||||
@@ -21,18 +23,21 @@ if(WITH_PROJ)
|
|||||||
target_link_libraries(Serializers PRIVATE PROJ::proj)
|
target_link_libraries(Serializers PRIVATE PROJ::proj)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(Serializers
|
target_link_libraries(
|
||||||
|
Serializers
|
||||||
PRIVATE
|
PRIVATE
|
||||||
${SERIALIZER_SCHEMA_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${USD_LIBRARIES} ${GLTF_LIBRARIES}
|
${SERIALIZER_SCHEMA_LIBRARIES}
|
||||||
IfcGeom ${OpenCASCADE_LIBRARIES} ${kernel_libraries} IfcParse
|
${OPENCOLLADA_LIBRARIES}
|
||||||
|
${USD_LIBRARIES}
|
||||||
|
${GLTF_LIBRARIES}
|
||||||
|
IfcGeom
|
||||||
|
${OpenCASCADE_LIBRARIES}
|
||||||
|
${kernel_libraries}
|
||||||
|
IfcParse
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS Serializers)
|
install(TARGETS Serializers)
|
||||||
|
|
||||||
# Can't use `PUBLIC_HEADER` since we need two folders.
|
# Can't use `PUBLIC_HEADER` since we need two folders.
|
||||||
install(FILES ${SERIALIZERS_H_FILES}
|
install(FILES ${SERIALIZERS_H_FILES} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/serializers/")
|
||||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/serializers/"
|
install(FILES ${SERIALIZERS_S_H_FILES} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/serializers/schema_dependent")
|
||||||
)
|
|
||||||
install(FILES ${SERIALIZERS_S_H_FILES}
|
|
||||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/serializers/schema_dependent"
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -5,12 +5,14 @@ set(SERIALIZERS_S_FILES ${SERIALIZERS_S_H_FILES} ${SERIALIZERS_S_CPP_FILES})
|
|||||||
foreach(schema ${SCHEMA_VERSIONS})
|
foreach(schema ${SCHEMA_VERSIONS})
|
||||||
add_library(Serializers_ifc${schema} OBJECT ${SERIALIZERS_S_FILES})
|
add_library(Serializers_ifc${schema} OBJECT ${SERIALIZERS_S_FILES})
|
||||||
set(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} Serializers_ifc${schema})
|
set(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} Serializers_ifc${schema})
|
||||||
set_target_properties(Serializers_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
|
set_target_properties(
|
||||||
|
Serializers_ifc${schema}
|
||||||
|
PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}"
|
||||||
|
)
|
||||||
target_link_libraries(Serializers_ifc${schema} ${HDF5_LIBRARIES} ${GLTF_LIBRARIES})
|
target_link_libraries(Serializers_ifc${schema} ${HDF5_LIBRARIES} ${GLTF_LIBRARIES})
|
||||||
if(NOT WASM_BUILD)
|
if(NOT WASM_BUILD)
|
||||||
target_link_libraries(Serializers_ifc${schema} IfcGeom ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(Serializers_ifc${schema} IfcGeom ${OpenCASCADE_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
set(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} PARENT_SCOPE)
|
set(SERIALIZER_SCHEMA_LIBRARIES ${SERIALIZER_SCHEMA_LIBRARIES} PARENT_SCOPE)
|
||||||
|
|||||||
+18
-23
@@ -1,20 +1,19 @@
|
|||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
project (svgfill)
|
project(svgfill)
|
||||||
|
|
||||||
if (POLICY CMP0144) # 3.27
|
if(POLICY CMP0144) # 3.27
|
||||||
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables.
|
cmake_policy(SET CMP0144 NEW) # find_package() uses upper-case <PACKAGENAME>_ROOT variables.
|
||||||
endif()
|
endif()
|
||||||
if(POLICY CMP0167) # 3.30 find_package(Boost) to use BoostConfig instead of FindBoost.
|
if(POLICY CMP0167) # 3.30 find_package(Boost) to use BoostConfig instead of FindBoost.
|
||||||
cmake_policy(SET CMP0167 OLD)
|
cmake_policy(SET CMP0167 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(WIN32 AND NOT DEFINED ENV{CONDA_BUILD})
|
if(WIN32 AND NOT DEFINED ENV{CONDA_BUILD})
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
set(Boost_USE_MULTITHREADED ON)
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
if (USE_STATIC_MSVC_RUNTIME)
|
if(USE_STATIC_MSVC_RUNTIME)
|
||||||
set(Boost_USE_STATIC_RUNTIME ON)
|
set(Boost_USE_STATIC_RUNTIME ON)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
@@ -28,8 +27,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MSVC)
|
if(MSVC)
|
||||||
add_definitions(-bigobj)
|
add_definitions(-bigobj)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Boost)
|
find_package(Boost)
|
||||||
@@ -37,35 +36,31 @@ message(STATUS "Boost include files found in ${Boost_INCLUDE_DIRS}")
|
|||||||
find_package(LibXml2 REQUIRED)
|
find_package(LibXml2 REQUIRED)
|
||||||
find_package(CGAL REQUIRED)
|
find_package(CGAL REQUIRED)
|
||||||
|
|
||||||
|
include_directories(${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/svgpp/include)
|
||||||
include_directories(${Boost_INCLUDE_DIRS}
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/svgpp/include
|
|
||||||
)
|
|
||||||
|
|
||||||
file(GLOB LIB_H_FILES src/*.h)
|
file(GLOB LIB_H_FILES src/*.h)
|
||||||
file(GLOB LIB_CPP_FILES src/svgfill.cpp src/arrange_polygons.cpp)
|
file(GLOB LIB_CPP_FILES src/svgfill.cpp src/arrange_polygons.cpp)
|
||||||
set(LIB_SRC_FILES ${LIB_H_FILES} ${LIB_CPP_FILES})
|
set(LIB_SRC_FILES ${LIB_H_FILES} ${LIB_CPP_FILES})
|
||||||
add_library(svgfill ${LIB_SRC_FILES})
|
add_library(svgfill ${LIB_SRC_FILES})
|
||||||
target_link_libraries(svgfill ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} LibXml2::LibXml2 IFCOPENSHELL_CGAL)
|
target_link_libraries(svgfill ${Boost_LIBRARIES} ${BCRYPT_LIBRARIES} LibXml2::LibXml2 IFCOPENSHELL_CGAL)
|
||||||
set_target_properties(svgfill PROPERTIES
|
set_target_properties(svgfill PROPERTIES PUBLIC_HEADER "${LIB_H_FILES}")
|
||||||
PUBLIC_HEADER "${LIB_H_FILES}"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(svgfill_exe src/main.cpp)
|
add_executable(svgfill_exe src/main.cpp)
|
||||||
target_link_libraries(svgfill_exe svgfill)
|
target_link_libraries(svgfill_exe svgfill)
|
||||||
set_property(TARGET svgfill_exe PROPERTY OUTPUT_NAME svgfill)
|
set_property(TARGET svgfill_exe PROPERTY OUTPUT_NAME svgfill)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
# both the library and the executable now result in a file with basename svgfill,
|
# both the library and the executable now result in a file with basename svgfill,
|
||||||
# on linux the the library is prefixed with lib as libsvgfill.a. Windows does not
|
# on linux the the library is prefixed with lib as libsvgfill.a. Windows does not
|
||||||
# have this mechanism, so on windows the linker would be created an import library
|
# have this mechanism, so on windows the linker would be created an import library
|
||||||
# for the executable, also named svgfill.lib. This naming conflict results in:
|
# for the executable, also named svgfill.lib. This naming conflict results in:
|
||||||
# LINK : fatal error LNK1149: output filename matches input filename
|
# LINK : fatal error LNK1149: output filename matches input filename
|
||||||
# This flag tells the linker not to generate an import library and therefore no
|
# This flag tells the linker not to generate an import library and therefore no
|
||||||
# conflict occurs.
|
# conflict occurs.
|
||||||
target_link_options(svgfill_exe PRIVATE "/NOIMPLIB")
|
target_link_options(svgfill_exe PRIVATE "/NOIMPLIB")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS svgfill_exe svgfill
|
install(
|
||||||
|
TARGETS svgfill_exe svgfill
|
||||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS}
|
||||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/svgfill"
|
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/svgfill"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user