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 improvements #46

Merged
merged 1 commit into from
Jul 7, 2019
Merged

CMake improvements #46

merged 1 commit into from
Jul 7, 2019

Conversation

vicroms
Copy link
Contributor

@vicroms vicroms commented Jun 17, 2019

Hi @ctabin

I propose some changes to the current CMake script.

  • Remove the Win32 only restriction, as it is possible to build for Linux and Mac OS using CMake.
  • Produce binaries with the same name for shared and static libraries (remove -shared and -static suffixes).
  • Respect the BUILD_SHARED_LIBS variable to control whether to build static or shared.
  • Support CMake integration via find_package(libzippp::libzippp) by producing libzipppConfig.cmake and libzipppTargets*.cmake files.
  • Use a FindZIPLIB.cmake module to pull dependencies.
  • Add option to disable building tests.

Tested with:

mkdir build
cd build
cmake -G "Visual Studio 16 2019" -A x64 .. 

From vcpkg PR #6801.

@ctabin
Copy link
Owner

ctabin commented Jun 18, 2019

@vicroms Thanks for your PR ! I'll test and merge asap. 😃

@ctabin
Copy link
Owner

ctabin commented Jun 21, 2019

@vicroms I'm trying to get CMake work on my linux with the following command:

make libraries
mkdir build
cd build
cmake -D LIBZIP_INCLUDE_DIR="../lib/libzip-1.5.2/lib ../lib/libzip-1.5.2/build" -D LIBZIP_LIBRARY=../lib/libzip-1.5.2/build/lib/ ..

However CMake doesn't like to have multiple paths in LIBZIP_INCLUDE_DIR (either separated with a space, comma, colon or semicolon).

If I set only one path, the cmake works fine, but I'm unable to execute make because some headers are missing. I would like to avoid some hack by coping manually all the headers in one directory because I'm pretty sure the solution is obvious 😅

Can I have you help here ? Thanks !

Copy link
Owner

@ctabin ctabin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enquote ${LIBZIP_INCLUDE_DIRS} in cmake/FindLIBZIP.cmake

@ctabin ctabin merged commit f69cddd into ctabin:master Jul 7, 2019
@ctabin ctabin mentioned this pull request Nov 25, 2019
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.

None yet

2 participants