Consider creating namespaced CMake targets
Hi all,
modern CMake is all about targets, which carry all the important dependency information. With proper targets defined, including G+SMO in ones project is quite simply done by
find_package(gismo REQUIRED CONFIG)
target_link_libraries(myapp PRIVATE gismo::gismo)
Right now, I can fake this behavior by creating an imported target myself with
add_library(gismo::gismo SHARED IMPORTED GLOBAL)
set_target_properties(gismo::gismo PROPERTIES
INCLUDE_DIRECTORIES "${GISMO_INCLUDE_DIRS}"
IMPORTED_LOCATION "${GISMO_LIBRARY_DIR}/libgismo.so")
However, there might be compile flags or what not that is not handled and in general the proper way would be for G+SMO to provide the target.
All the best, Christian
Hi Christian, thank you for this suggestion, we will try to incorporate it. You are also mostly welcome to attempt to add the namespaced target and make a PR
@filiatra is this still relevant, or will it be improved in PR #510 ?