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

(cmake branch) custom dependency definitions do not work #38

Open
wavepacket opened this issue Jun 11, 2023 · 0 comments
Open

(cmake branch) custom dependency definitions do not work #38

wavepacket opened this issue Jun 11, 2023 · 0 comments

Comments

@wavepacket
Copy link

If a dependency cannot be found for whatever reason, the current CMake code allows the explicit definition of the compiler / linker flags for a dependency XYZ through the variables TENSOR_XYZ_CXXFLAGS and TENSOR_XYZ_LDFLAGS. Unfortunately, this scheme does not work for two different reasons:

  1. The name of the dependency, Dummy::XYZ, leads to a CMake error. The underlying reason is that an INTERFACE library is created, and these are restricted in their allowed names.
  2. After fixing the first item, the build files cannot be created because the new interface target is not part of an exported set. The background here is that every dependency for an installed target must either be an IMPORTED target, which will lead the installed configuration to search for it via find_package(), or it must be installed, such as tensor and tensor_options. This INTERFACE target falls into the second category.

I would have created a pull request, but I am not entirely sure how to solve this issue. One could create an IMPORTED target, which, however, needs an import location (static or shared library), which makes the definition of these custom dependencies more complex. Alternatively, one could just append the flags to the tensor_options target. This has the drawback that it spreads knowledge of this special target throughout the code base, and the code must be able to work with a non-existing dependency target.

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

No branches or pull requests

1 participant