Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider creating namespaced CMake targets #472

Open
cheinigk opened this issue Sep 27, 2021 · 2 comments
Open

Consider creating namespaced CMake targets #472

cheinigk opened this issue Sep 27, 2021 · 2 comments

Comments

@cheinigk
Copy link

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

@filiatra
Copy link
Member

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

@hverhelst
Copy link
Member

@filiatra is this still relevant, or will it be improved in PR #510 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants