libnfc/CMakeLists.txt

67 lines
2.4 KiB
Text
Raw Normal View History

2009-09-02 22:15:21 +02:00
PROJECT(libnfc C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(VERSION "1.2.2")
SET(LIBNFC_VERBOSE_OUTPUT OFF CACHE BOOL "Verbose output of communication with the NFC chip")
SET(LIBNFC_LANG_C99 OFF CACHE BOOL "Use C99 language standard (GCC only)")
IF(DEFINED CMAKE_INSTALL_LIBDIR)
SET(PKG_LIBDIR ${CMAKE_INSTALL_LIBDIR})
ELSE(DEFINED CMAKE_INSTALL_LIBDIR)
SET(CMAKE_INSTALL_LIBDIR lib)
SET(PKG_LIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
ENDIF(DEFINED CMAKE_INSTALL_LIBDIR)
IF(DEFINED INCLUDE_INSTALL_DIR)
SET(PKG_INCLUDE_DIR ${INCLUDE_INSTALL_DIR})
ELSE(DEFINED INCLUDE_INSTALL_DIR)
SET(INCLUDE_INSTALL_DIR include)
SET(PKG_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR})
ENDIF(DEFINED INCLUDE_INSTALL_DIR)
IF(NOT DEFINED SHARE_INSTALL_PREFIX)
SET(SHARE_INSTALL_PREFIX share)
ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX)
IF(NOT MSVC)
INCLUDE(FindPkgConfig)
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)
ENDIF(NOT MSVC)
ADD_SUBDIRECTORY(src)
# Binary Package
IF(MSVC)
SET(CPACK_GENERATOR "NSIS")
ELSE(MSVC)
SET(CPACK_GENERATOR "TGZ")
ENDIF(MSVC)
SET(CPACK_PACKAGE_FILE_NAME "libnfc-${VERSION}-bin")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Near Field Communication (NFC) library")
SET(CPACK_PACKAGE_VENDOR "Roel Verdult")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "2")
SET(CPACK_PACKAGE_VERSION_PATCH "2")
SET(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "NFC Library")
SET(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Example Applications")
SET(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Development Headers")
SET(CPACK_COMPONENT_MANUALS_DISPLAY_NAME "Example Applications Manuals")
SET(CPACK_COMPONENT_HEADERS_DISABLED TRUE)
SET(CPACK_COMPONENT_MANUALS_DISABLED TRUE)
SET(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
SET(CPACK_COMPONENT_EXAMPLES_DEPENDS libraries)
SET(CPACK_COMPONENT_MANUALS_DEPENDS examples)
# Source Package
IF(MSVC)
SET(CPACK_SOURCE_GENERATOR "ZIP")
ELSE(MSVC)
SET(CPACK_SOURCE_GENERATOR "ZIP;TBZ2")
ENDIF(MSVC)
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "libnfc-${VERSION}")
SET(CPACK_SOURCE_IGNORE_FILES "~$" "/\\\\.svn/" "bin/")
INCLUDE(CPack)