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

CMakeLists file missing export #257

Closed
jeremyong opened this issue Jan 3, 2016 · 7 comments · Fixed by #264
Closed

CMakeLists file missing export #257

jeremyong opened this issue Jan 3, 2016 · 7 comments · Fixed by #264

Comments

@jeremyong
Copy link
Contributor

This would be nice to allow the cppformat project to be transitively included in an existing CMake build tree without requiring a separate make install step.

@vitaut
Copy link
Contributor

vitaut commented Jan 4, 2016

It's already possible to include cppformat in a CMake project via add_subdirectory. Is there any advantage of using export?

@jeremyong
Copy link
Contributor Author

Yes. Suppose I have library A which links cppformat and I want all users of library A to transitively link cppformat as well if they link A. Further, suppose I want A to be exported. The export will fail because A now publicly links cppformat which is not part of the export list. I'm not sure how to resolve this without directly modifying cppformat's CMakeLists.txt itself. It would be nice if an option was provided to specify an export list (optionally). My Cmake-fu is not 100% yet, but I believe this is the correct use case.

@vitaut
Copy link
Contributor

vitaut commented Jan 4, 2016

It's possible to simply add cppformat with add_subdirectory and export cppformat or any other target:

add_subdirectory(cppformat)
export(TARGETS cppformat FILE test.cmake)

Will it work for you?

@jeremyong
Copy link
Contributor Author

I was referring to adding the cppformat target to an existing export list which isn't possible outside of the cppformat CMakeLists.txt file I believe. I'll play around with things some tomorrow and see if I can get something to work.

@vitaut
Copy link
Contributor

vitaut commented Jan 5, 2016

It would help if you showed an example of what you are expecting to have in the cppformat's CMakeFiles.txt or, better, submitted a PR. I haven't used CMake export before and I'm not sure I fully understand what's the purpose of it other than for cross-compilation, but I'll be happy to accept the export-related changes if they simplify some use case.

@vitaut
Copy link
Contributor

vitaut commented Jan 11, 2016

@jeremyong, have my suggestion worked for you or have you found an alternative?

@vitaut
Copy link
Contributor

vitaut commented Jan 13, 2016

Fixed by #264.

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

Successfully merging a pull request may close this issue.

2 participants