mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Add Options on Cmake to selectively compile IFCConvert and IFCGeomServer
This commit is contained in:
+38
-21
@@ -27,6 +27,8 @@ OPTION(ENABLE_BUILD_OPTIMIZATIONS "Enable certain compiler and linker optimizati
|
|||||||
OPTION(IFCCONVERT_DOUBLE_PRECISION "IfcConvert: Use double precision floating-point numbers." ON)
|
OPTION(IFCCONVERT_DOUBLE_PRECISION "IfcConvert: Use double precision floating-point numbers." ON)
|
||||||
OPTION(BUILD_IFCPYTHON "Build IfcPython." ON)
|
OPTION(BUILD_IFCPYTHON "Build IfcPython." ON)
|
||||||
OPTION(BUILD_EXAMPLES "Build example applications." ON)
|
OPTION(BUILD_EXAMPLES "Build example applications." ON)
|
||||||
|
OPTION(BUILD_GEOMSERVER "Build IfcGeomServer executable." ON)
|
||||||
|
OPTION(BUILD_CONVERT "Build IfcConvert executable." ON)
|
||||||
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)
|
||||||
OPTION(USE_MMAP "Adds a command line options to parse IFC files from memory mapped files using Boost.Iostreams" OFF)
|
OPTION(USE_MMAP "Adds a command line options to parse IFC files from memory mapped files using Boost.Iostreams" OFF)
|
||||||
OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF)
|
OPTION(BUILD_IFCMAX "Build IfcMax, a 3ds Max plug-in, Windows-only." OFF)
|
||||||
@@ -582,30 +584,45 @@ set_target_properties(IfcGeom PROPERTIES COMPILE_FLAGS -DIFC_GEOM_EXPORTS)
|
|||||||
TARGET_LINK_LIBRARIES(IfcGeom IfcGeom_ifc2x3 IfcGeom_ifc4)
|
TARGET_LINK_LIBRARIES(IfcGeom IfcGeom_ifc2x3 IfcGeom_ifc4)
|
||||||
|
|
||||||
# IfcConvert
|
# IfcConvert
|
||||||
file(GLOB IFCCONVERT_CPP_FILES ../src/ifcconvert/*.cpp)
|
if(BUILD_CONVERT)
|
||||||
file(GLOB IFCCONVERT_H_FILES ../src/ifcconvert/*.h)
|
file(GLOB IFCCONVERT_CPP_FILES ../src/ifcconvert/*.cpp)
|
||||||
set(IFCCONVERT_FILES ${IFCCONVERT_CPP_FILES} ${IFCCONVERT_H_FILES})
|
file(GLOB IFCCONVERT_H_FILES ../src/ifcconvert/*.h)
|
||||||
ADD_EXECUTABLE(IfcConvert ${IFCCONVERT_FILES})
|
set(IFCCONVERT_FILES ${IFCCONVERT_CPP_FILES} ${IFCCONVERT_H_FILES})
|
||||||
if (IFCCONVERT_DOUBLE_PRECISION)
|
ADD_EXECUTABLE(IfcConvert ${IFCCONVERT_FILES})
|
||||||
set_target_properties(IfcConvert PROPERTIES COMPILE_FLAGS -DIFCCONVERT_DOUBLE_PRECISION)
|
if (IFCCONVERT_DOUBLE_PRECISION)
|
||||||
endif()
|
set_target_properties(IfcConvert PROPERTIES COMPILE_FLAGS -DIFCCONVERT_DOUBLE_PRECISION)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(IfcConvert ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${ICU_LIBRARIES})
|
||||||
|
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
|
||||||
|
# Only set RPATHs when building shared libraries (i.e. IfcParse and
|
||||||
|
# IfcGeom are dynamically linked). Not necessarily a perfect solution
|
||||||
|
# but probably a good indication of whether RPATHs are necessary.
|
||||||
|
SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR};${ICU_LIBRARY_DIR}")
|
||||||
|
endif()
|
||||||
|
INSTALL(TARGETS IfcConvert
|
||||||
|
ARCHIVE DESTINATION ${LIBDIR}
|
||||||
|
LIBRARY DESTINATION ${LIBDIR}
|
||||||
|
RUNTIME DESTINATION ${BINDIR}
|
||||||
|
)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(IfcConvert ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${ICU_LIBRARIES})
|
|
||||||
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
|
|
||||||
# Only set RPATHs when building shared libraries (i.e. IfcParse and
|
|
||||||
# IfcGeom are dynamically linked). Not necessarily a perfect solution
|
|
||||||
# but probably a good indication of whether RPATHs are necessary.
|
|
||||||
SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR};${ICU_LIBRARY_DIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# IfcGeomServer
|
# IfcGeomServer
|
||||||
file(GLOB CPP_FILES ../src/ifcgeomserver/*.cpp)
|
if(BUILD_GEOMSERVER)
|
||||||
file(GLOB H_FILES ../src/ifcgeomserver/*.h)
|
file(GLOB CPP_FILES ../src/ifcgeomserver/*.cpp)
|
||||||
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
|
file(GLOB H_FILES ../src/ifcgeomserver/*.h)
|
||||||
ADD_EXECUTABLE(IfcGeomServer ${SOURCE_FILES})
|
set(SOURCE_FILES ${CPP_FILES} ${H_FILES})
|
||||||
TARGET_LINK_LIBRARIES(IfcGeomServer ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${ICU_LIBRARIES})
|
ADD_EXECUTABLE(IfcGeomServer ${SOURCE_FILES})
|
||||||
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
|
TARGET_LINK_LIBRARIES(IfcGeomServer ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${ICU_LIBRARIES})
|
||||||
SET_INSTALL_RPATHS(IfcGeomServer "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${ICU_LIBRARY_DIR}")
|
if ((NOT WIN32) AND BUILD_SHARED_LIBS)
|
||||||
|
SET_INSTALL_RPATHS(IfcGeomServer "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${ICU_LIBRARY_DIR}")
|
||||||
|
INSTALL(TARGETS IfcGeomServer
|
||||||
|
ARCHIVE DESTINATION ${LIBDIR}
|
||||||
|
LIBRARY DESTINATION ${LIBDIR}
|
||||||
|
RUNTIME DESTINATION ${BINDIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(BUILD_IFCPYTHON)
|
IF(BUILD_IFCPYTHON)
|
||||||
@@ -629,7 +646,7 @@ INSTALL(FILES ${IFCGEOM_H_FILES}
|
|||||||
DESTINATION ${INCLUDEDIR}/ifcgeom
|
DESTINATION ${INCLUDEDIR}/ifcgeom
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTALL(TARGETS IfcParse IfcGeom_ifc2x3 IfcGeom_ifc4 IfcConvert IfcGeomServer
|
INSTALL(TARGETS IfcParse IfcGeom_ifc2x3 IfcGeom_ifc4
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
ARCHIVE DESTINATION ${LIBDIR}
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
LIBRARY DESTINATION ${LIBDIR}
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
RUNTIME DESTINATION ${BINDIR}
|
||||||
|
|||||||
Reference in New Issue
Block a user