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 build on systems with lib in lib64 is broken #693

Open
satmandu opened this issue May 14, 2023 · 7 comments
Open

cmake build on systems with lib in lib64 is broken #693

satmandu opened this issue May 14, 2023 · 7 comments

Comments

@satmandu
Copy link

I'm hacking up the cmake build files to get this to build correctly on x86_64 chromebrew, modifying these files, where #{ARCH_LIB} is either lib or lib64 on the relevant systems, but ideally we wouldn't have to engage in this hackery. 😅

sed -i 's,lib/cmake/leptonica,#{ARCH_LIB}/cmake/leptonica,g' CMakeLists.txt
sed -i 's,lib/pkgconfig,#{ARCH_LIB}/pkgconfig,g' CMakeLists.txt
sed -i 's,prefix}/lib,prefix}/#{ARCH_LIB},g' lept.pc.cmake
@stweil
Copy link
Collaborator

stweil commented May 14, 2023

Do you want to send a pull request which fixes that? What about the automake build, does it also require a fix?

@satmandu
Copy link
Author

The automake build is fine, but we prefer CMAKE as it tends to make for cleaner builds.

I think you need to support the cmake CMAKE_INSTALL_LIBDIR variable. Most packages do, but this isn't the only package that we've had to massage.

@satmandu
Copy link
Author

Actually, CMAKE_LIBRARY_PATH seems to be the more universally used variable...

@satmandu
Copy link
Author

@satmandu
Copy link
Author

satmandu commented May 14, 2023

This might be sufficient:

# use GNU install dirs (e.g. lib64 instead of lib)
INCLUDE(GNUInstallDirs)

As per https://github.com/facebook/hhvm/blob/fdad0855eb63f528a357f11c5307df0ab29cec9b/CMakeLists.txt#L80

@satmandu
Copy link
Author

Oops! I missed some!
src/CMakeLists.txt also needs modification.
set(lib ${CMAKE_SHARED_LIBRARY_PREFIX}) looks like it needs changing as does install(TARGETS leptonica EXPORT LeptonicaTargets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)

@zdenop
Copy link
Collaborator

zdenop commented May 15, 2023

Please make PR so we can test it.
GNUInstallDirs could be useful for linux, not sure about Mac but I have doubt about Windows...

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

3 participants