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

Fix packaging issues on Windows #729

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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 )
Expand Down
11 changes: 0 additions & 11 deletions cmake/FixBundle.cmake.in

This file was deleted.

11 changes: 2 additions & 9 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 2 additions & 9 deletions utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)