diff --git a/CMakeLists.txt b/CMakeLists.txt index a8605fa4..999d20d1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,9 +66,8 @@ ENDIF(LIBNFC_CONFFILES_MODE) option (BUILD_EXAMPLES "build examples ON/OFF" ON) option (BUILD_UTILS "build utils ON/OFF" ON) - option (BUILD_DEBPKG "build debian package ON/OFF" OFF) - +option (LIBNFC_MAN "install man-pages" ON) # Doxygen SET(builddir "${CMAKE_BINARY_DIR}") @@ -126,28 +125,30 @@ IF(MINGW) ENDIF (NOT DLLTOOL) ENDIF(MINGW) +# Set some pkg-config variables +SET(prefix ${CMAKE_INSTALL_PREFIX}) +SET(exec_prefix ${CMAKE_INSTALL_PREFIX}) +SET(PACKAGE "libnfc") IF(NOT WIN32) - # Set some pkg-config variables - SET(prefix ${CMAKE_INSTALL_PREFIX}) - SET(exec_prefix ${CMAKE_INSTALL_PREFIX}) - SET(PACKAGE "libnfc") - IF(LIBNFC_DRIVER_PN53X_USB) - SET(PKG_REQ ${PKG_REQ} "libusb") - ENDIF(LIBNFC_DRIVER_PN53X_USB) - IF(LIBNFC_DRIVER_ACR122_USB) - SET(PKG_REQ ${PKG_REQ} "libusb") - ENDIF(LIBNFC_DRIVER_ACR122_USB) +IF(LIBNFC_DRIVER_PN53X_USB) + SET(PKG_REQ ${PKG_REQ} "libusb") +ENDIF(LIBNFC_DRIVER_PN53X_USB) +IF(LIBNFC_DRIVER_ACR122_USB) + SET(PKG_REQ ${PKG_REQ} "libusb") +ENDIF(LIBNFC_DRIVER_ACR122_USB) IF(LIBNFC_DRIVER_PCSC) SET(PKG_REQ ${PKG_REQ} "libpcsclite") ENDIF(LIBNFC_DRIVER_PCSC) IF(LIBNFC_DRIVER_ACR122_PCSC) SET(PKG_REQ ${PKG_REQ} "libpcsclite") ENDIF(LIBNFC_DRIVER_ACR122_PCSC) - # CMake lists are separated by a semi colon, replace with colon - STRING(REPLACE ";" "," PKG_CONFIG_REQUIRES "${PKG_REQ}") - 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 WIN32) +LIST(REMOVE_DUPLICATES PKG_REQ) +LIST(SORT PKG_REQ) +# CMake lists are separated by a semi colon, replace with colon +STRING(REPLACE ";" "," PKG_CONFIG_REQUIRES "${PKG_REQ}") +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) INCLUDE(LibnfcDrivers) @@ -210,20 +211,15 @@ if (NOT MSVC) 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 ) diff --git a/cmake/FixBundle.cmake.in b/cmake/FixBundle.cmake.in deleted file mode 100644 index 6e8f843d..00000000 --- a/cmake/FixBundle.cmake.in +++ /dev/null @@ -1,11 +0,0 @@ -INCLUDE(BundleUtilities) - -# set bundle to the full path of the executable already existing in the install tree -SET(bundle "${CMAKE_INSTALL_PREFIX}/bin/nfc-list@CMAKE_EXECUTABLE_SUFFIX@") - -# set other_libs to a list of additional libs that cannot be reached by dependency analysis -SET(other_libs "") - -SET(dirs "@LIBUSB_LIBRARY_DIR@") - -fixup_bundle("${bundle}" "${other_libs}" "${dirs}") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 01a93c9b..72be9244 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -41,15 +41,8 @@ FOREACH(source ${EXAMPLES-SOURCES}) INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT examples) ENDFOREACH(source) -#install required libraries -IF(WIN32) - INCLUDE(InstallRequiredSystemLibraries) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/FixBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake @ONLY) - INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake) -ENDIF(WIN32) - -IF(NOT WIN32) +IF(LIBNFC_MAN) # Manuals for the examples FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1") INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals) -ENDIF(NOT WIN32) +ENDIF(LIBNFC_MAN) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index b9c723ea..375ff749 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -55,15 +55,8 @@ FOREACH(source ${UTILS-SOURCES}) INSTALL(TARGETS ${source} RUNTIME DESTINATION bin COMPONENT utils) ENDFOREACH(source) -#install required libraries -IF(WIN32) - INCLUDE(InstallRequiredSystemLibraries) - CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/FixBundle.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake @ONLY) - INSTALL(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake) -ENDIF(WIN32) - -IF(NOT WIN32) +IF(LIBNFC_MAN) # Manuals for the examples FILE(GLOB manuals "${CMAKE_CURRENT_SOURCE_DIR}/*.1") INSTALL(FILES ${manuals} DESTINATION ${SHARE_INSTALL_PREFIX}/man/man1 COMPONENT manuals) -ENDIF(NOT WIN32) +ENDIF(LIBNFC_MAN)