Skip to content

Commit

Permalink
switch to IFC4X3
Browse files Browse the repository at this point in the history
  • Loading branch information
ifcapps committed Nov 21, 2022
1 parent 8ec83ef commit 7e29f5b
Show file tree
Hide file tree
Showing 5,549 changed files with 271,502 additions and 186,015 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ examples/LoadFileExampleNoGUI/LoadFileExampleNoGUI/x64/
external/Carve/build/
examples/CreateWallAndWriteFile/x64/
examples/LoadFileWithGeometryExampleConsole/dump_mesh_debug.txt

IfcPlusPlus-*
Binary file modified Build IFC++.pdf
Binary file not shown.
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
CMAKE_MINIMUM_REQUIRED (VERSION 3.7.2)
project(IfcPlusPlus)

# Set a default build type if none was specified https://blog.kitware.com/cmake-and-the-default-build-type/
set(default_build_type "Release")

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")

set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)

# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

project(IFCPP)
message(STATUS "------------------------------------------------------------------------")

option(BUILD_CONSOLE_APPLICATION "Build an example CLI application" ON)
option(BUILD_VIEWER_APPLICATION "Build the viewer example application" ON)
if (WIN32)
option(BUILD_VIEWER_APPLICATION "Build the viewer example application" ON)
else(NOT WIN32)
option(BUILD_VIEWER_APPLICATION "Build the viewer example application" OFF)
endif()
option(USE_OSG_DEBUG "Use openscenegraph debug library" OFF)
option(BUILD_STATIC_LIBRARY "Build static library" OFF)

Expand All @@ -34,6 +39,13 @@ ELSE(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
ENDIF(NOT WIN32)

find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

set(CARVE_SOURCE_DIR ${IFCPP_SOURCE_DIR}/external/Carve)
set(CARVE_BINARY_DIR ${IFCPP_BINARY_DIR})
set(IFCPP_CONFIG_DIR "share/IFCPP/cmake")
Expand All @@ -57,6 +69,7 @@ INSTALL(
IF(BUILD_CONSOLE_APPLICATION)
ADD_SUBDIRECTORY (examples/CreateWallAndWriteFile)
ADD_SUBDIRECTORY (examples/LoadFileExampleConsole)
ADD_SUBDIRECTORY (examples/LoadFileWithGeometryExampleConsole)
ENDIF()
IF(BUILD_VIEWER_APPLICATION)
ADD_SUBDIRECTORY (examples/SimpleViewerExampleQt)
Expand Down
87 changes: 39 additions & 48 deletions IfcPlusPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cmake_minimum_required (VERSION 2.8...3.7.2)
project(IfcPlusPlus)

if(WIN32)
# for vs2017
Expand All @@ -16,67 +17,57 @@ else(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
endif(WIN32)

file (GLOB ifc4_source "src/ifcpp/IFC4/lib/*.cpp")

if(UNIX)
# do not add src/external/XUnzip.cpp on unix platforms
set(IFCPP_SOURCE_FILES
src/ifcpp/IFC4/EntityFactory.cpp
src/ifcpp/IFC4/TypeFactory.cpp
src/ifcpp/model/BuildingGuid.cpp
src/ifcpp/model/BuildingModel.cpp
src/ifcpp/model/UnitConverter.cpp
src/ifcpp/reader/AbstractReader.cpp
src/ifcpp/reader/ReaderSTEP.cpp
src/ifcpp/reader/ReaderXML.cpp
src/ifcpp/reader/ReaderUtil.cpp
src/ifcpp/writer/WriterSTEP.cpp
src/ifcpp/writer/WriterUtil.cpp

${ifc4_source}
)
else(UNIX)
set(IFCPP_SOURCE_FILES
src/ifcpp/IFC4/EntityFactory.cpp
src/ifcpp/IFC4/TypeFactory.cpp
src/ifcpp/model/BuildingGuid.cpp
src/ifcpp/model/BuildingModel.cpp
src/ifcpp/model/UnitConverter.cpp
src/ifcpp/reader/AbstractReader.cpp
src/ifcpp/reader/ReaderSTEP.cpp
src/ifcpp/reader/ReaderXML.cpp
src/ifcpp/reader/ReaderUtil.cpp
src/ifcpp/writer/WriterSTEP.cpp
src/ifcpp/writer/WriterUtil.cpp
src/external/XUnzip.cpp

${ifc4_source}
)
endif(UNIX)

set(IFCPP_SOURCE_FILES
src/ifcpp/IFC4X3/EntityFactory.cpp
src/ifcpp/IFC4X3/TypeFactory.cpp
src/ifcpp/model/BuildingGuid.cpp
src/ifcpp/model/BuildingModel.cpp
src/ifcpp/model/UnitConverter.cpp
src/ifcpp/reader/AbstractReader.cpp
src/ifcpp/reader/ReaderSTEP.cpp
src/ifcpp/reader/ReaderXML.cpp
src/ifcpp/reader/ReaderUtil.cpp
src/ifcpp/writer/WriterSTEP.cpp
src/ifcpp/writer/WriterUtil.cpp
)

if (MSVC)
set(IFCPP_SOURCE_FILES
src/external/XUnzip.cpp # do not add src/external/XUnzip.cpp on unix platforms
${IFCPP_SOURCE_FILES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj ")
endif()

add_definitions(-DIFCQUERY_AS_DYNAMIC_LIBRARY)
add_definitions(-DIFCQUERY_LIB)
ADD_DEFINITIONS(-DIFCQUERY_AS_DYNAMIC_LIBRARY)
ADD_DEFINITIONS(-DIFCQUERY_LIB)
ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT)
ADD_DEFINITIONS(-DGLM_FORCE_XYZW_ONLY)
ADD_DEFINITIONS(-D_HAS_AUTO_PTR_ETC=1)
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(IfcPlusPlus SHARED ${IFCPP_SOURCE_FILES})

link_directories( ${CMAKE_BINARY_DIR}/IfcPlusPlus/${CMAKE_BUILD_TYPE} )
link_directories( ${CMAKE_BINARY_DIR}/external/Carve/${CMAKE_BUILD_TYPE} )
target_link_libraries(IfcPlusPlus
PUBLIC
carve
${VC_LIBS}
)
if(OpenMP_CXX_FOUND)
ADD_DEFINITIONS(-DENABLE_OPENMP)
TARGET_LINK_LIBRARIES(IfcPlusPlus
optimized OpenMP::OpenMP_CXX
${VC_LIBS})
endif()


target_include_directories(IfcPlusPlus
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/external>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/ifcpp/IFC4/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/ifcpp/IFC4X3/include>"
"$<INSTALL_INTERFACE:include>")

set_target_properties(IfcPlusPlus PROPERTIES DEBUG_POSTFIX "d")
set_target_properties(IfcPlusPlus PROPERTIES CXX_STANDARD 20)

if(WIN32)
set_target_properties(IfcPlusPlus PROPERTIES LINK_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
Expand Down
Loading

0 comments on commit 7e29f5b

Please sign in to comment.