Skip to content

Commit

Permalink
Add libzip as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jul 31, 2017
1 parent 0db8a58 commit 5eba29e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ IF(WITH_CORE)
IF (WITH_GUI)
FIND_PACKAGE(Qwt REQUIRED)
ENDIF (WITH_GUI)
FIND_PACKAGE(LibZip REQUIRED)

IF (WITH_INTERNAL_QEXTSERIALPORT)
SET(QEXTSERIALPORT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/gps/qextserialport)
Expand Down
40 changes: 40 additions & 0 deletions cmake/FindLibZip.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# CMake module to search for libzip
#
# Once done this will define
#
# LIBZIP_FOUND - system has the zip library
# LIBZIP_INCLUDE_DIR - the zip include directory
# LIBZIP_LIBRARY - Link this to use the zip library
#
# Copyright (c) 2017, Paul Blottiere, <paul.blottiere@oslandia.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

FIND_PATH(LIBZIP_INCLUDE_DIR
zip.h
PATHS
/usr/local/include
/usr/include
"$ENV{LIB_DIR}/include"
"$ENV{INCLUDE}"
)

FIND_LIBRARY(LIBZIP_LIBRARY
NAMES zip
PATHS
/usr/local/lib
/usr/lib
"$ENV{LIB_DIR}/lib"
"$ENV{LIB}"
)

IF (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)
SET(LIBZIP_FOUND TRUE)
ENDIF (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR)

IF (LIBZIP_FOUND)
MESSAGE(STATUS "Found libzip: ${LIBZIP_LIBRARY}")
ELSE (LIPZIP_FOUND)
MESSAGE(FATAL_ERROR "Could not find libzip")
ENDIF (LIBZIP_FOUND)

0 comments on commit 5eba29e

Please sign in to comment.