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 variable package_name makes it impossible to use expected-lite with variant-lite in one source tree #24

Closed
rmorozov opened this issue Jan 14, 2019 · 3 comments

Comments

@rmorozov
Copy link

Hello Martin!

set( package_name "${unit_name}-lite" CACHE STRING "Name of the package" )

Tried to update third_parties in https://github.com/flexferrum/Jinja2Cpp/tree/master/thirdparty/nonstd to latest, in order to get basic cmake package support, but making package_name CACHE variable caused CMake errors when variant-lite tries to call add_library after adding expected-lite .

add_library cannot create target "expected-lite" because another target
with the same name already exists. The existing target is an interface
library created in source directory

Could you please fix scenario when someone wants to build several of your libraries using your CMakes?

Maybe it is better not to make package_name CACHE variable but CMake option instead. Also there could be possibility of name clash with CMAKE variable package_name declared in upper CMakes. So I would rather call it expected_lite_package_name?

@martinmoene
Copy link
Owner

Ah, I see, thanks.

I chose to duplicate the unit name in test/CMakeLists.txt and approach it like:

Note that the namespace changed from expected-lite::, optional-lite:: etc. to nonstd .

B.t.w. option() can only be used for boolean values.

@rmorozov
Copy link
Author

B.t.w. option() can only be used for boolean values.

Sorry missed that point=)

@martinmoene
Copy link
Owner

I think this one can be closed.

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

2 participants