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 improvements and fixes #26
Conversation
See it in action at https://build.opensuse.org/request/show/423579 |
|
So do you would suggest to pack it into an |
Either UNIX, or UNIX AND NOT APPLE. I don't know enough about Macs to
say whether the setting makes sense there. @Meowtimer, @ckanibal?
|
* Fix thirdparty libraries, needed to be explicit compiled as static libs. Some distributions use shared libraries as default preset in CMake. * Fix some CMake checks (missing return in main function). * Allow custom install directories
CMAKE_INSTALL_PREFIX will most likely not work for a end user on macOS due to system integrity protection. I'd rather have the application packaging script-fu working again (thing that creates .app-Files). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OC_SYSTEM_*_DIR needs to be set on all platforms, or alternatively the install() commands need to be protected with if(UNIX).
@@ -1459,7 +1466,7 @@ foreach(group ${OC_C4GROUPS}) | |||
DEPENDS "${native_c4group}" | |||
VERBATIM | |||
) | |||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION share/games/openclonk) | |||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION "${OC_SYSTEM_DATA_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response, but this doesn't work on Windows (or rather, all non-UNIX platforms, of which there is only one we support) because OC_SYSTEM_DATA_DIR is unset, which makes CMake unhappy.
@@ -1474,7 +1481,7 @@ if (NOT APPLE) | |||
install(CODE "execute_process(COMMAND update-desktop-database)") | |||
|
|||
# Install binaries | |||
install(TARGETS openclonk DESTINATION games) | |||
install(TARGETS openclonk DESTINATION "${OC_SYSTEM_GAMES_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
As reported by [1], some distributions use shared libraries as default preset in CMake. Without explicitely linking statically libmisc and libc4script, we have the following link issue: [...]/host/bin/x86_64-linux-g++ --sysroot=[...]sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=gnu++14 -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -DNDEBUG -rdynamic CMakeFiles/c4group.dir/src/c4group/C4GroupMain.cpp.o -o c4group -Wl,-rpath,[...]/build/openclonk-7.0: liblibmisc.so -lz -lpthread -lrt liblibmisc.so : référence indéfinie vers « C4LangStringTable::Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const » liblibmisc.so : référence indéfinie vers « C4LangStringTable::system_string_table » [1] openclonk#26 Signed-off-by: Romain Naour <romain.naour@gmail.com>
As reported by [1], some distributions use shared libraries as default preset in CMake. Without explicitely linking statically libmisc and libc4script, we have the following link issue: [...]/host/bin/x86_64-linux-g++ --sysroot=[...]sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=gnu++14 -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -DNDEBUG -rdynamic CMakeFiles/c4group.dir/src/c4group/C4GroupMain.cpp.o -o c4group -Wl,-rpath,[...]/build/openclonk-7.0: liblibmisc.so -lz -lpthread -lrt liblibmisc.so : référence indéfinie vers « C4LangStringTable::Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const » liblibmisc.so : référence indéfinie vers « C4LangStringTable::system_string_table » [1] openclonk#26 While at it, build libopenclonk statically since libopenclonk is not installed by the CMake build system. Signed-off-by: Romain Naour <romain.naour@gmail.com>
As reported by [1], some distributions use shared libraries as default preset in CMake. Without explicitely linking statically libmisc and libc4script, we have the following link issue: [...]/host/bin/x86_64-linux-g++ --sysroot=[...]sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=gnu++14 -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -DNDEBUG -rdynamic CMakeFiles/c4group.dir/src/c4group/C4GroupMain.cpp.o -o c4group -Wl,-rpath,[...]/build/openclonk-7.0: liblibmisc.so -lz -lpthread -lrt liblibmisc.so : référence indéfinie vers « C4LangStringTable::Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const » liblibmisc.so : référence indéfinie vers « C4LangStringTable::system_string_table » [1] #26 While at it, build libopenclonk statically since libopenclonk is not installed by the CMake build system. Signed-off-by: Romain Naour <romain.naour@gmail.com>
Since the commits are in master, I believe I can close this? |
Some distributions use shared libraries as default preset in CMake.