sol2 icon indicating copy to clipboard operation
sol2 copied to clipboard

[v4] the cmake target lost sol2:: prefix

Open DarthGandalf opened this issue 3 years ago • 1 comments

A user of existing sol 3.2.3 uses the library like this:

find_package(sol2 CONFIG REQUIRED)
target_link_libraries(foo PRIVATE sol2::sol2)

But it doesn't work anymore in v4 because the sol2:: prefix got lost in the installed target.

Looks like this was removed from CMakeLists.txt

set_target_properties(sol2
	PROPERTIES
	EXPORT_NAME sol2::sol2)

Though the recommended way to achieve the same is

install(EXPORT sol2 NAMESPACE sol2::)

(currently https://github.com/ThePhD/sol2/blob/50b62c9346750b7c2c406c9e4c546f96b0bf021d/CMakeLists.txt#L118-L120 is callled without NAMESPACE either)

DarthGandalf avatar Feb 07 '22 12:02 DarthGandalf

ping: this issue already went into the 3.3.0 release

DarthGandalf avatar Aug 15 '22 16:08 DarthGandalf

This should be completed. Thanks for the PR.

ThePhD avatar Sep 27 '22 17:09 ThePhD