mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
cmake: Use standard install way
For specific install customization, use CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR variables. See-Also: https://cmake.org/cmake/help/latest/guide/tutorial/Installation%20Commands%20and%20Concepts.html
This commit is contained in:
committed by
Thomas Krijnen
parent
0724fac698
commit
083fab5255
+2
-31
@@ -159,15 +159,6 @@ endif()
|
|||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
# Specify paths to install files
|
|
||||||
if(NOT BINDIR)
|
|
||||||
set(BINDIR bin)
|
|
||||||
endif()
|
|
||||||
if(NOT IS_ABSOLUTE ${BINDIR})
|
|
||||||
set(BINDIR ${CMAKE_INSTALL_BINDIR})
|
|
||||||
endif()
|
|
||||||
message(STATUS "BINDIR: ${BINDIR}")
|
|
||||||
|
|
||||||
if(NOT INCLUDEDIR)
|
if(NOT INCLUDEDIR)
|
||||||
set(INCLUDEDIR include)
|
set(INCLUDEDIR include)
|
||||||
endif()
|
endif()
|
||||||
@@ -176,16 +167,6 @@ if(NOT IS_ABSOLUTE ${INCLUDEDIR})
|
|||||||
endif()
|
endif()
|
||||||
message(STATUS "INCLUDEDIR: ${INCLUDEDIR}")
|
message(STATUS "INCLUDEDIR: ${INCLUDEDIR}")
|
||||||
|
|
||||||
if(NOT LIBDIR)
|
|
||||||
set(LIBDIR lib)
|
|
||||||
endif()
|
|
||||||
if(NOT IS_ABSOLUTE ${LIBDIR})
|
|
||||||
set(LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
|
||||||
endif()
|
|
||||||
message(STATUS "LIBDIR: ${LIBDIR}")
|
|
||||||
|
|
||||||
set(IFCOPENSHELL_LIBRARY_DIR "") # for *nix rpaths
|
|
||||||
|
|
||||||
if(BUILD_SHARED_LIBS)
|
if(BUILD_SHARED_LIBS)
|
||||||
add_definitions(-DIFC_SHARED_BUILD)
|
add_definitions(-DIFC_SHARED_BUILD)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
@@ -194,8 +175,6 @@ if(BUILD_SHARED_LIBS)
|
|||||||
# 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)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IFCOPENSHELL_LIBRARY_DIR "${LIBDIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
UNIFY_ENVVARS_AND_CACHE(BOOST_ROOT)
|
UNIFY_ENVVARS_AND_CACHE(BOOST_ROOT)
|
||||||
@@ -765,20 +744,12 @@ if(BUILD_IFCGEOM)
|
|||||||
)
|
)
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} ${kernel_libraries} IfcGeom
|
install(TARGETS ${IFCGEOM_SCHEMA_LIBRARIES} ${kernel_libraries} IfcGeom)
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
endif(BUILD_IFCGEOM)
|
endif(BUILD_IFCGEOM)
|
||||||
|
|
||||||
if(BUILD_CONVERT OR BUILD_IFCPYTHON)
|
if(BUILD_CONVERT OR BUILD_IFCPYTHON)
|
||||||
if(WITH_OPENCASCADE)
|
if(WITH_OPENCASCADE)
|
||||||
install(TARGETS geometry_serializer ${geometry_serializer_libraries}
|
install(TARGETS geometry_serializer ${geometry_serializer_libraries})
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
endif(BUILD_CONVERT OR BUILD_IFCPYTHON)
|
endif(BUILD_CONVERT OR BUILD_IFCPYTHON)
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,4 @@ if(WITH_RELATIONSHIP_VALIDATION)
|
|||||||
set_property(TARGET IfcConvert APPEND_STRING PROPERTY COMPILE_FLAGS " -DWITH_RELATIONSHIP_VALIDATION")
|
set_property(TARGET IfcConvert APPEND_STRING PROPERTY COMPILE_FLAGS " -DWITH_RELATIONSHIP_VALIDATION")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS IfcConvert
|
install(TARGETS IfcConvert)
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
|||||||
list(APPEND kernel_libraries ${KERNEL_TARGET})
|
list(APPEND kernel_libraries ${KERNEL_TARGET})
|
||||||
target_link_libraries(${KERNEL_TARGET} ${${KERNEL_UPPER}_LIBRARIES})
|
target_link_libraries(${KERNEL_TARGET} ${${KERNEL_UPPER}_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS ${KERNEL_TARGET}
|
install(TARGETS ${KERNEL_TARGET})
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(${kernel} STREQUAL "cgal")
|
if(${kernel} STREQUAL "cgal")
|
||||||
set_property(TARGET ${KERNEL_TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -DCGAL_HAS_THREADS")
|
set_property(TARGET ${KERNEL_TARGET} APPEND_STRING PROPERTY COMPILE_FLAGS " -DCGAL_HAS_THREADS")
|
||||||
@@ -25,11 +21,7 @@ foreach(kernel ${GEOMETRY_KERNELS})
|
|||||||
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)
|
||||||
install(TARGETS ${KERNEL_TARGET_SIMPLE}
|
install(TARGETS ${KERNEL_TARGET_SIMPLE})
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
elseif(${kernel} STREQUAL "opencascade")
|
elseif(${kernel} STREQUAL "opencascade")
|
||||||
target_link_libraries(${KERNEL_TARGET} ${OpenCASCADE_LIBRARIES})
|
target_link_libraries(${KERNEL_TARGET} ${OpenCASCADE_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -5,8 +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)
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -79,11 +79,7 @@ if(HAS_MAX)
|
|||||||
|
|
||||||
set_target_properties(IfcMax_${max_year} PROPERTIES SUFFIX ".dli")
|
set_target_properties(IfcMax_${max_year} PROPERTIES SUFFIX ".dli")
|
||||||
|
|
||||||
install(TARGETS IfcMax_${max_year}
|
install(TARGETS IfcMax_${max_year})
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
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.")
|
||||||
|
|||||||
@@ -57,8 +57,4 @@ install(FILES ${IFCPARSE_H_FILES}
|
|||||||
DESTINATION ${INCLUDEDIR}/ifcparse
|
DESTINATION ${INCLUDEDIR}/ifcparse
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS IfcParse
|
install(TARGETS IfcParse)
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -19,11 +19,7 @@ endif()
|
|||||||
|
|
||||||
target_link_libraries(Serializers PRIVATE ${SERIALIZER_SCHEMA_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${USD_LIBRARIES} IfcGeom ${OPENCASCADE_LIBRARIES} ${kernel_libraries} IfcParse)
|
target_link_libraries(Serializers PRIVATE ${SERIALIZER_SCHEMA_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${USD_LIBRARIES} IfcGeom ${OPENCASCADE_LIBRARIES} ${kernel_libraries} IfcParse)
|
||||||
|
|
||||||
install(TARGETS Serializers
|
install(TARGETS Serializers)
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
install(FILES ${SERIALIZERS_H_FILES}
|
install(FILES ${SERIALIZERS_H_FILES}
|
||||||
DESTINATION ${INCLUDEDIR}/serializers/
|
DESTINATION ${INCLUDEDIR}/serializers/
|
||||||
|
|||||||
@@ -12,11 +12,7 @@ foreach(schema ${SCHEMA_VERSIONS})
|
|||||||
target_link_libraries(Serializers_ifc${schema} IfcGeom ${OPENCASCADE_LIBRARIES} ${HDF5_LIBRARIES})
|
target_link_libraries(Serializers_ifc${schema} IfcGeom ${OPENCASCADE_LIBRARIES} ${HDF5_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS Serializers_ifc${schema}
|
install(TARGETS Serializers_ifc${schema})
|
||||||
ARCHIVE DESTINATION ${LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${BINDIR}
|
|
||||||
LIBRARY DESTINATION ${LIBDIR}
|
|
||||||
)
|
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user