Skip to content

Conversation

@LunarWatcher
Copy link
Contributor

397bb5d introduced a bug by using CMAKE_PROJECT_VERSION. While a valid variable, to quote the documentation,

This variable holds the version of the project as specified in the top level CMakeLists.txt file by a project() command

This is a problem if using IXWebSocket as a submodule, as IXWebSocket is no longer the top-level project in this scenario. Best-case, the version for the resulting shared library is wrong. Worst-case, which happened to a project of mine, no version is defined, and everything explodes. Because the variable is then interpreted to be empty, a set_target_properties call explodes, because it thinks it's missing an argument:

CMake Error at build/_deps/ixwebsocket-src/CMakeLists.txt:171 (set_target_properties):
    set_target_properties called with incorrect number of arguments. 

The correct variable to use is PROJECT_VERSION, which returns the VERSION option for the last project command, i.e. the one defined by IXWebSocket

@LunarWatcher
Copy link
Contributor Author

Also, I'm not sure if whatever ixwebsocket.pc.in also needs an update with this change, but can do that if needed.

@bsergean bsergean merged commit 38d6da7 into machinezone:master Mar 28, 2024
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 this pull request may close these issues.

2 participants