mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-29 08:13:14 +00:00
examples - further simplify linking
This commit is contained in:
@@ -319,7 +319,7 @@ endif()
|
||||
# Otherwise it will find components needed for CGAL and we might some libraries.
|
||||
if(WITH_CGAL)
|
||||
find_package(CGAL REQUIRED)
|
||||
set(CGAL_LIBRARIES CGAL::CGAL_INTERFACE)
|
||||
set(CGAL_LIBRARIES IFCOPENSHELL_CGAL)
|
||||
list(APPEND GEOMETRY_KERNELS cgal)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
# Input variables could also be provided as environment variables.
|
||||
#
|
||||
# Output targets:
|
||||
# - `CGAL::CGAL_INTERFACE`
|
||||
# - `IFCOPENSHELL_CGAL`
|
||||
#
|
||||
|
||||
if(TARGET CGAL::CGAL_INTERFACE)
|
||||
if(TARGET IFCOPENSHELL_CGAL)
|
||||
return()
|
||||
endif()
|
||||
|
||||
@@ -59,9 +59,11 @@ else()
|
||||
message(STATUS "CGAL: found config at '${CGAL_DIR}'.")
|
||||
endif()
|
||||
|
||||
# Adding another `CGAL_INTERFACE` target, because we want to add compile definitions to it,
|
||||
# Adding another `IFCOPENSHELL_CGAL` target, because we want to add compile definitions to it,
|
||||
# but in `CGALconfig.cmake` `CGAL::CGAL` is an alias, so you can't add properties to it.
|
||||
add_library(CGAL::CGAL_INTERFACE INTERFACE IMPORTED)
|
||||
target_link_libraries(CGAL::CGAL_INTERFACE INTERFACE CGAL::CGAL)
|
||||
target_compile_definitions(CGAL::CGAL_INTERFACE INTERFACE IFOPSH_WITH_CGAL)
|
||||
add_library(IFCOPENSHELL_CGAL INTERFACE)
|
||||
target_link_libraries(IFCOPENSHELL_CGAL INTERFACE CGAL::CGAL)
|
||||
target_compile_definitions(IFCOPENSHELL_CGAL INTERFACE IFOPSH_WITH_CGAL)
|
||||
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_CGAL)
|
||||
install(TARGETS IFCOPENSHELL_CGAL
|
||||
EXPORT ${IFCOPENSHELL_EXPORT_TARGETS})
|
||||
|
||||
Reference in New Issue
Block a user