2015-09-01 08:55:53 +02:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
|
|
|
|
if (NOT DEFINED CMAKE_BUILD_TYPE)
|
|
|
|
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
project (libnfc C)
|
|
|
|
|
2009-11-02 15:05:03 +01:00
|
|
|
SET(VERSION_MAJOR "1")
|
2020-05-22 12:19:15 +02:00
|
|
|
SET(VERSION_MINOR "8")
|
|
|
|
SET(VERSION_PATCH "0")
|
2009-11-02 15:05:03 +01:00
|
|
|
|
|
|
|
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
|
|
|
|
|
|
|
SET(PACKAGE_NAME "libnfc")
|
|
|
|
SET(PACKAGE_VERSION ${VERSION})
|
|
|
|
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
2010-01-29 16:04:32 +01:00
|
|
|
|
2010-04-26 14:59:23 +02:00
|
|
|
# config.h
|
2011-03-31 15:38:49 +02:00
|
|
|
IF(WIN32)
|
2020-07-07 19:40:46 +02:00
|
|
|
SET(LIBNFC_SYSCONFDIR "./config" CACHE PATH "libnfc configuration directory")
|
2019-07-19 14:34:17 +02:00
|
|
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_windows.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
2011-03-31 15:38:49 +02:00
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32)
|
2020-07-07 19:40:46 +02:00
|
|
|
IF(NOT MINGW)
|
|
|
|
SET(CMAKE_C_FLAGS "-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE ${CMAKE_C_FLAGS}")
|
|
|
|
ENDIF(NOT MINGW)
|
2011-03-31 15:38:49 +02:00
|
|
|
ELSE(WIN32)
|
2010-01-29 16:04:32 +01:00
|
|
|
SET(_XOPEN_SOURCE 600)
|
2013-02-01 11:11:39 +01:00
|
|
|
SET(SYSCONFDIR "/etc" CACHE PATH "System configuration directory")
|
2019-07-19 14:34:17 +02:00
|
|
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_posix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
2011-03-31 15:38:49 +02:00
|
|
|
ENDIF(WIN32)
|
2019-07-19 14:34:17 +02:00
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
2010-01-29 16:04:32 +01:00
|
|
|
|
2010-04-26 14:59:23 +02:00
|
|
|
ADD_DEFINITIONS("-DHAVE_CONFIG_H")
|
|
|
|
|
2010-04-07 16:37:19 +02:00
|
|
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2009-09-02 22:15:21 +02:00
|
|
|
|
2009-09-09 09:51:11 +02:00
|
|
|
# make it easy to locate CMake modules for finding libraries
|
2018-10-02 12:14:29 +02:00
|
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/")
|
2009-09-09 09:51:11 +02:00
|
|
|
|
2010-04-26 14:59:23 +02:00
|
|
|
# Options
|
2015-09-01 08:57:11 +02:00
|
|
|
option (LIBNFC_LOG "Enable log facility (errors, warning, info and debug messages)" ON)
|
2013-02-01 10:32:15 +01:00
|
|
|
IF(LIBNFC_LOG)
|
|
|
|
ADD_DEFINITIONS(-DLOG)
|
|
|
|
ENDIF(LIBNFC_LOG)
|
|
|
|
|
2015-09-01 08:57:11 +02:00
|
|
|
option (LIBNFC_ENVVARS "Enable envvars facility" ON)
|
2013-03-18 15:26:15 +01:00
|
|
|
IF(LIBNFC_ENVVARS)
|
|
|
|
ADD_DEFINITIONS(-DENVVARS)
|
|
|
|
ENDIF(LIBNFC_ENVVARS)
|
|
|
|
|
2013-02-01 10:32:15 +01:00
|
|
|
SET(LIBNFC_DEBUG_MODE OFF CACHE BOOL "Debug mode")
|
|
|
|
IF(LIBNFC_DEBUG_MODE)
|
2013-02-04 10:13:36 +01:00
|
|
|
ADD_DEFINITIONS(-DDEBUG)
|
2013-02-01 16:19:02 +01:00
|
|
|
SET(CMAKE_C_FLAGS "-g3 ${CMAKE_C_FLAGS}")
|
|
|
|
SET(WIN32_MODE "debug")
|
|
|
|
SET(CMAKE_RC_FLAGS "-D_DEBUG ${CMAKE_RC_FLAGS}")
|
2013-02-04 10:13:36 +01:00
|
|
|
ELSE(LIBNFC_DEBUG_MODE)
|
2013-02-01 16:19:02 +01:00
|
|
|
SET(WIN32_MODE "release")
|
2013-02-01 10:32:15 +01:00
|
|
|
ENDIF(LIBNFC_DEBUG_MODE)
|
2010-04-26 14:59:23 +02:00
|
|
|
|
2015-09-01 08:57:11 +02:00
|
|
|
option (LIBNFC_CONFFILES_MODE "Enable configuration files" ON)
|
2013-12-08 14:09:50 +01:00
|
|
|
IF(LIBNFC_CONFFILES_MODE)
|
|
|
|
ADD_DEFINITIONS(-DCONFFILES)
|
|
|
|
ENDIF(LIBNFC_CONFFILES_MODE)
|
|
|
|
|
2015-09-01 08:58:35 +02:00
|
|
|
option (BUILD_EXAMPLES "build examples ON/OFF" ON)
|
|
|
|
option (BUILD_UTILS "build utils ON/OFF" ON)
|
|
|
|
|
2016-10-21 14:17:23 +02:00
|
|
|
option (BUILD_DEBPKG "build debian package ON/OFF" OFF)
|
|
|
|
|
2015-09-01 08:58:35 +02:00
|
|
|
|
2010-01-12 20:27:37 +01:00
|
|
|
# Doxygen
|
|
|
|
SET(builddir "${CMAKE_BINARY_DIR}")
|
|
|
|
SET(top_srcdir "${CMAKE_SOURCE_DIR}")
|
|
|
|
INCLUDE(UseDoxygen)
|
|
|
|
|
2009-09-02 22:15:21 +02:00
|
|
|
IF(DEFINED CMAKE_INSTALL_LIBDIR)
|
2009-09-03 11:21:52 +02:00
|
|
|
SET(libdir ${CMAKE_INSTALL_LIBDIR})
|
2009-09-02 22:15:21 +02:00
|
|
|
ELSE(DEFINED CMAKE_INSTALL_LIBDIR)
|
|
|
|
SET(CMAKE_INSTALL_LIBDIR lib)
|
2009-09-03 11:21:52 +02:00
|
|
|
SET(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
|
2009-09-02 22:15:21 +02:00
|
|
|
ENDIF(DEFINED CMAKE_INSTALL_LIBDIR)
|
|
|
|
|
|
|
|
IF(DEFINED INCLUDE_INSTALL_DIR)
|
2009-09-03 11:21:52 +02:00
|
|
|
SET(includedir ${INCLUDE_INSTALL_DIR})
|
2009-09-02 22:15:21 +02:00
|
|
|
ELSE(DEFINED INCLUDE_INSTALL_DIR)
|
|
|
|
SET(INCLUDE_INSTALL_DIR include)
|
2009-09-03 11:21:52 +02:00
|
|
|
SET(includedir ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR})
|
2009-09-02 22:15:21 +02:00
|
|
|
ENDIF(DEFINED INCLUDE_INSTALL_DIR)
|
|
|
|
|
|
|
|
IF(NOT DEFINED SHARE_INSTALL_PREFIX)
|
|
|
|
SET(SHARE_INSTALL_PREFIX share)
|
|
|
|
ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX)
|
|
|
|
|
2010-04-26 14:59:23 +02:00
|
|
|
# Additonnal GCC flags
|
2010-12-21 12:06:43 +01:00
|
|
|
IF(CMAKE_COMPILER_IS_GNUCC)
|
2010-03-22 21:28:30 +01:00
|
|
|
# Make sure we will not miss some warnings ;)
|
2013-02-01 16:19:02 +01:00
|
|
|
SET(CMAKE_C_FLAGS "-Wall -pedantic -std=c99 ${CMAKE_C_FLAGS}")
|
2010-12-21 12:06:43 +01:00
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
2009-12-01 12:39:35 +01:00
|
|
|
|
2010-02-09 17:10:45 +01:00
|
|
|
# Workarounds for libusb in C99
|
|
|
|
ADD_DEFINITIONS(-Du_int8_t=uint8_t -Du_int16_t=uint16_t)
|
|
|
|
|
2011-01-17 14:42:24 +01:00
|
|
|
IF(MINGW)
|
2017-01-25 11:05:58 +01:00
|
|
|
IF (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
|
|
|
# force MinGW-w64 in 32bit mode
|
|
|
|
MESSAGE("Building 32-bit Windows DLL")
|
|
|
|
#SET(CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS}")
|
|
|
|
#SET(CMAKE_MODULE_LINKER_FLAGS "--Wl,--enable-stdcall-fixup ${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
#SET(CMAKE_SHARED_LINKER_FLAGS "--Wl,--enable-stdcall-fixup ${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
#SET(CMAKE_EXE_LINKER_FLAGS "--Wl,--enable-stdcall-fixup ${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
SET(CMAKE_RC_FLAGS "--target=pe-i386 --output-format=coff ${CMAKE_RC_FLAGS}")
|
2024-02-16 14:35:48 +01:00
|
|
|
ELSEIF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") OR (CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64"))
|
2017-01-25 11:05:58 +01:00
|
|
|
MESSAGE("Building 64-bit Windows DLL")
|
|
|
|
SET(CMAKE_RC_FLAGS "--target=pe-x86-64 --output-format=coff ${CMAKE_RC_FLAGS}")
|
|
|
|
ELSE(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
|
|
|
MESSAGE(FATAL_ERROR "Unknown Processor: ${CMAKE_SYSTEM_PROCESSOR}")
|
|
|
|
ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")
|
|
|
|
ENDIF(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
|
|
|
|
FIND_PROGRAM(DLLTOOL dlltool CMAKE_FIND_ROOT_PATH_BOTH)
|
|
|
|
IF (NOT DLLTOOL)
|
|
|
|
MESSAGE(FATAL_ERROR "Could not find dlltool command")
|
|
|
|
ENDIF (NOT DLLTOOL)
|
2011-01-17 14:42:24 +01:00
|
|
|
ENDIF(MINGW)
|
|
|
|
|
2010-11-17 09:29:41 +01:00
|
|
|
IF(NOT WIN32)
|
2009-09-14 10:47:31 +02:00
|
|
|
# Set some pkg-config variables
|
|
|
|
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
|
|
|
SET(exec_prefix ${CMAKE_INSTALL_PREFIX})
|
|
|
|
SET(PACKAGE "libnfc")
|
2011-03-31 15:38:49 +02:00
|
|
|
IF(LIBNFC_DRIVER_PN53X_USB)
|
2009-09-14 10:47:31 +02:00
|
|
|
SET(PKG_REQ ${PKG_REQ} "libusb")
|
2011-03-31 15:38:49 +02:00
|
|
|
ENDIF(LIBNFC_DRIVER_PN53X_USB)
|
2020-07-07 19:40:46 +02:00
|
|
|
IF(LIBNFC_DRIVER_ACR122_USB)
|
|
|
|
SET(PKG_REQ ${PKG_REQ} "libusb")
|
|
|
|
ENDIF(LIBNFC_DRIVER_ACR122_USB)
|
2019-09-03 15:50:28 +02:00
|
|
|
IF(LIBNFC_DRIVER_PCSC)
|
|
|
|
SET(PKG_REQ ${PKG_REQ} "libpcsclite")
|
2020-07-07 19:40:46 +02:00
|
|
|
ENDIF(LIBNFC_DRIVER_PCSC)
|
2019-09-03 15:51:38 +02:00
|
|
|
IF(LIBNFC_DRIVER_ACR122_PCSC)
|
2009-09-14 10:47:31 +02:00
|
|
|
SET(PKG_REQ ${PKG_REQ} "libpcsclite")
|
2019-09-03 15:51:38 +02:00
|
|
|
ENDIF(LIBNFC_DRIVER_ACR122_PCSC)
|
2009-09-14 10:47:31 +02:00
|
|
|
# CMake lists are separated by a semi colon, replace with colon
|
|
|
|
STRING(REPLACE ";" "," PKG_CONFIG_REQUIRES "${PKG_REQ}")
|
2009-09-02 22:15:21 +02:00
|
|
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libnfc.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc @ONLY)
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
2010-11-17 09:29:41 +01:00
|
|
|
ENDIF(NOT WIN32)
|
2009-09-02 22:15:21 +02:00
|
|
|
|
2013-03-12 20:54:50 +01:00
|
|
|
INCLUDE(LibnfcDrivers)
|
|
|
|
|
2021-08-14 11:58:54 +02:00
|
|
|
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2017-03-02 23:42:36 +01:00
|
|
|
IF(I2C_REQUIRED)
|
|
|
|
# Inspired from http://cmake.3232098.n2.nabble.com/RFC-cmake-analog-to-AC-SEARCH-LIBS-td7585423.html
|
|
|
|
INCLUDE (CheckFunctionExists)
|
|
|
|
INCLUDE (CheckLibraryExists)
|
|
|
|
CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME)
|
|
|
|
IF (NOT HAVE_CLOCK_GETTIME)
|
|
|
|
CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_CLOCK_GETTIME_IN_RT)
|
|
|
|
IF (HAVE_CLOCK_GETTIME_IN_RT)
|
|
|
|
SET(LIBRT_FOUND TRUE)
|
|
|
|
SET(LIBRT_LIBRARIES "rt")
|
|
|
|
ENDIF (HAVE_CLOCK_GETTIME_IN_RT)
|
|
|
|
ENDIF (NOT HAVE_CLOCK_GETTIME)
|
|
|
|
ENDIF(I2C_REQUIRED)
|
2021-08-14 11:58:54 +02:00
|
|
|
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
2017-03-02 23:42:36 +01:00
|
|
|
|
2011-10-01 16:50:53 +02:00
|
|
|
IF(PCSC_INCLUDE_DIRS)
|
|
|
|
INCLUDE_DIRECTORIES(${PCSC_INCLUDE_DIRS})
|
|
|
|
LINK_DIRECTORIES(${PCSC_LIBRARY_DIRS})
|
|
|
|
ENDIF(PCSC_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
IF(LIBUSB_INCLUDE_DIRS)
|
|
|
|
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS})
|
|
|
|
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS})
|
2013-03-08 08:15:40 +01:00
|
|
|
SET(LIBUSB_FOUND TRUE)
|
2011-10-01 16:50:53 +02:00
|
|
|
ENDIF(LIBUSB_INCLUDE_DIRS)
|
|
|
|
|
2013-02-01 16:19:02 +01:00
|
|
|
# version.rc for Windows
|
|
|
|
IF(WIN32)
|
|
|
|
# Date for filling in rc file information
|
2024-02-16 14:30:38 +01:00
|
|
|
STRING(TIMESTAMP CURRENT_YEAR %Y)
|
2015-08-16 12:22:15 +02:00
|
|
|
SET(prefix ${CMAKE_INSTALL_PREFIX})
|
2013-02-01 16:19:02 +01:00
|
|
|
SET(RC_COMMENT "${PACKAGE_NAME} library")
|
|
|
|
SET(RC_INTERNAL_NAME "${PACKAGE_NAME} ${WIN32_MODE}")
|
|
|
|
SET(RC_ORIGINAL_NAME ${PACKAGE_NAME}.dll)
|
2020-07-11 15:12:57 +02:00
|
|
|
# RC_FILE_TYPE: VFT_DLL
|
2020-07-07 19:40:46 +02:00
|
|
|
SET(RC_FILE_TYPE 0x00000002L)
|
2013-02-05 17:24:23 +01:00
|
|
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/windows/libnfc.rc @ONLY)
|
2013-02-01 16:19:02 +01:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2010-04-07 16:37:19 +02:00
|
|
|
ADD_SUBDIRECTORY(libnfc)
|
|
|
|
ADD_SUBDIRECTORY(include)
|
2015-09-01 08:58:35 +02:00
|
|
|
|
|
|
|
if (BUILD_UTILS)
|
|
|
|
add_subdirectory (utils)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (BUILD_EXAMPLES)
|
|
|
|
add_subdirectory (examples)
|
|
|
|
endif ()
|
2009-09-02 22:15:21 +02:00
|
|
|
|
2014-06-27 20:37:50 +02:00
|
|
|
if (NOT MSVC)
|
|
|
|
# config script install path
|
|
|
|
if ( NOT DEFINED LIBNFC_CMAKE_CONFIG_DIR )
|
|
|
|
set ( LIBNFC_CMAKE_CONFIG_DIR lib${LIB_SUFFIX}/cmake/libnfc )
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set ( LIBNFC_INCLUDE_DIR ${includedir} )
|
|
|
|
set ( LIBNFC_INCLUDE_DIRS ${LIBNFC_INCLUDE_DIR} )
|
|
|
|
list ( APPEND LIBNFC_INCLUDE_DIRS ${LIBUSB_INCLUDE_DIRS} )
|
|
|
|
set ( LIBNFC_LIBRARY nfc )
|
|
|
|
set ( LIBNFC_LIBRARIES ${LIBNFC_LIBRARY} )
|
|
|
|
list ( APPEND LIBNFC_LIBRARIES ${LIBUSB_LIBRARIES} )
|
|
|
|
set ( LIBNFC_LIBRARY_DIRS ${libdir} )
|
|
|
|
set ( LIBNFC_ROOT_DIR ${prefix} )
|
|
|
|
set ( LIBNFC_VERSION_STRING ${VERSION} )
|
|
|
|
set ( LIBNFC_VERSION_MAJOR ${VERSION_MAJOR} )
|
|
|
|
set ( LIBNFC_VERSION_MINOR ${VERSION_MINOR} )
|
|
|
|
set ( LIBNFC_VERSION_PATCH ${VERSION_PATCH} )
|
|
|
|
|
|
|
|
set ( LIBNFC_USE_FILE ${CMAKE_INSTALL_PREFIX}/${LIBNFC_CMAKE_CONFIG_DIR}/UseLibNFC.cmake )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(CMAKE_VERSION VERSION_LESS 2.8.8)
|
|
|
|
configure_file ( cmake/LibNFCConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LibNFCConfig.cmake @ONLY )
|
|
|
|
configure_file ( cmake/LibNFCConfigVersion.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/LibNFCConfigVersion.cmake @ONLY )
|
|
|
|
else ()
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
configure_package_config_file (
|
|
|
|
cmake/LibNFCConfig.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/LibNFCConfig.cmake
|
|
|
|
INSTALL_DESTINATION ${LIBNFC_CMAKE_CONFIG_DIR}
|
|
|
|
PATH_VARS
|
|
|
|
LIBNFC_USE_FILE
|
|
|
|
LIBNFC_ROOT_DIR
|
|
|
|
LIBNFC_INCLUDE_DIR
|
|
|
|
LIBNFC_INCLUDE_DIRS
|
|
|
|
LIBNFC_LIBRARY_DIRS
|
|
|
|
NO_CHECK_REQUIRED_COMPONENTS_MACRO
|
|
|
|
)
|
|
|
|
write_basic_package_version_file (
|
|
|
|
LibNFCConfigVersion.cmake
|
|
|
|
VERSION ${LIBNFC_VERSION_STRING}
|
|
|
|
COMPATIBILITY AnyNewerVersion
|
|
|
|
)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/LibNFCConfig.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/LibNFCConfigVersion.cmake
|
|
|
|
cmake/UseLibNFC.cmake
|
|
|
|
DESTINATION ${LIBNFC_CMAKE_CONFIG_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
endif ()
|
|
|
|
|
2009-09-02 22:15:21 +02:00
|
|
|
# Binary Package
|
2010-11-17 09:29:41 +01:00
|
|
|
IF(WIN32)
|
2013-04-03 07:06:03 +02:00
|
|
|
SET(CPACK_GENERATOR "ZIP")
|
2010-11-17 09:29:41 +01:00
|
|
|
ELSE(WIN32)
|
2009-09-09 14:32:41 +02:00
|
|
|
SET(CPACK_GENERATOR "TBZ2")
|
2016-10-21 14:17:23 +02:00
|
|
|
IF(BUILD_DEBPKG)
|
|
|
|
SET(CPACK_GENERATOR "DEB")
|
|
|
|
ENDIF(BUILD_DEBPKG)
|
2010-11-17 09:29:41 +01:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2009-09-02 22:15:21 +02:00
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Near Field Communication (NFC) library")
|
|
|
|
SET(CPACK_PACKAGE_VENDOR "Roel Verdult")
|
2017-02-17 10:31:25 +01:00
|
|
|
SET(CPACK_PACKAGE_CONTACT "Roel Verdult <roel@libnfc.org>")
|
2016-11-20 16:48:00 +01:00
|
|
|
|
|
|
|
#Readme file
|
|
|
|
IF(WIN32)
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README-Windows.md")
|
|
|
|
ELSE(WIN32)
|
|
|
|
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
|
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2011-05-20 18:09:00 +02:00
|
|
|
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
|
2009-11-02 15:05:03 +01:00
|
|
|
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "libnfc")
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
|
|
|
|
SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
|
|
|
|
SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
|
2009-09-02 22:15:21 +02:00
|
|
|
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "NFC Library")
|
|
|
|
SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Example Applications")
|
|
|
|
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Development Headers")
|
2010-11-17 09:29:41 +01:00
|
|
|
IF(NOT WIN32)
|
2010-03-23 11:00:48 +01:00
|
|
|
SET(CPACK_COMPONENT_MANUALS_DISPLAY_NAME "Example Applications Manuals")
|
|
|
|
SET(CPACK_COMPONENT_MANUALS_DISABLED TRUE)
|
|
|
|
SET(CPACK_COMPONENT_MANUALS_DEPENDS examples)
|
2010-11-17 09:29:41 +01:00
|
|
|
ENDIF(NOT WIN32)
|
2009-09-02 22:15:21 +02:00
|
|
|
SET(CPACK_COMPONENT_HEADERS_DISABLED TRUE)
|
|
|
|
SET(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
|
|
|
|
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries)
|
|
|
|
|
|
|
|
# Source Package
|
2010-11-17 09:29:41 +01:00
|
|
|
IF(WIN32)
|
2009-09-02 22:15:21 +02:00
|
|
|
SET(CPACK_SOURCE_GENERATOR "ZIP")
|
2010-11-17 09:29:41 +01:00
|
|
|
ELSE(WIN32)
|
2009-09-02 22:15:21 +02:00
|
|
|
SET(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
|
2010-11-17 09:29:41 +01:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2009-09-02 22:15:21 +02:00
|
|
|
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "libnfc-${VERSION}")
|
2012-11-27 18:56:54 +01:00
|
|
|
SET(CPACK_SOURCE_IGNORE_FILES "~$" "/\\\\.git/" "bin/")
|
2009-09-02 22:15:21 +02:00
|
|
|
INCLUDE(CPack)
|