Major changes of installation in CMake project files - #433
Conversation
Now you can just:
```cmake
target_link_libraries(
${PROJECT_NAME} INTERFACE raylib_cpp::raylib_cpp
)
```
Fixed Web configurations example
|
Tests seem to build both in our workflows and on my machine. Спасибо! |
|
Literally, before this pr |
| add_executable(${PROJECT_NAME} ${SOURCES}) | ||
| set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 11) | ||
| target_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp) | ||
| target_link_libraries(${PROJECT_NAME} PUBLIC raylib INTERFACE raylib_cpp) |
There was a problem hiding this comment.
raylib_cpp is INTERFACE library, so it CANNOT be linked like PUBLIC library.
stalker57241
left a comment
There was a problem hiding this comment.
raylib_cpp is INTERFACE library, so it CANNOT be linked like PUBLIC library.
|
I thought linking the interface added the include path and such? |
Yeah, it adds the include path, and such. But when it's all, that library got, we need to specify it for cmake. There is wasn't. |
Added versioning and made project linkable in interface mode. Before it, I don't like, how bad it linked at example:
Here told, that it tries to link
raylib-cppwithtarget_link_libraries(${PROJECT_NAME} PUBLIC raylib raylib_cpp), and it's don't works. Example is forv6.0.0, and it doesn't compiles properly. Standalone it compiles normally, but when I tried to disable fetching of github to use locally installed raylib-cpp, it doesn't work. CMake doesn't know, what israylib_cpp. Now I let it know.P. S. And fixed a web configurations of
CMakeLists.txtfrom that example.