1

My CMake project depends on zipper library which is a wrapper on top of minizip/zlib. The zipper is a git submodule (in /thirdparty/zipper directory) of my project and so I compile it with the add_subdirectory command:

/CMakeLists.txt:

add_subdirectory(../../thirdparty thirdparty)

/thirdparty/CMakeLists.txt:

add_subdirectory(zlib)
add_subdirectory(zipper)

When I compile the thirdparty project it compiles zlib and zipper independently, so the zipper looks for zlib in the LD_LIBRARY_PATH but I want zipper to link again just compiled zlibstatic near it. How to do that?

VP.
  • 15,509
  • 17
  • 91
  • 161
  • Maybe this question helps https://stackoverflow.com/q/14061605/1741542 – Olaf Dietsche Sep 10 '17 at 11:01
  • @OlafDietsche yes, I have done this already for few my libraries, but zipper does not seem to have such options :( – VP. Sep 10 '17 at 15:15
  • Disclaimer: I don't know anything about CMake. Looking at https://github.com/sebastiandev/zipper/blob/master/CMakeLists.txt#L107, maybe you can set an environment variable `ZLIBROOT`, where CMake looks for the library. Although, this depends on the order CMake searches. – Olaf Dietsche Sep 10 '17 at 16:02

0 Answers0