From 8b8b8d49a7e642e8a27f40104d426ccb974b61ed Mon Sep 17 00:00:00 2001 From: Alex Lian Date: Wed, 3 Apr 2013 01:06:03 -0400 Subject: [PATCH] Windows packaging improvement - Stepped away from NSIS, to just be a plain zip file - Fixed a bug (though when trying NSIS) of dealing with slashes in windows paths - Had package add .lib file instead of .dll.a file, since lib files tend to be more useful for Windows developers --- CMakeLists.txt | 2 +- cmake/modules/FindLIBUSB.cmake | 2 ++ libnfc/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 201b1ba..90825f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,7 +153,7 @@ ADD_SUBDIRECTORY(examples) # Binary Package IF(WIN32) - SET(CPACK_GENERATOR "NSIS") + SET(CPACK_GENERATOR "ZIP") ELSE(WIN32) SET(CPACK_GENERATOR "TBZ2") ENDIF(WIN32) diff --git a/cmake/modules/FindLIBUSB.cmake b/cmake/modules/FindLIBUSB.cmake index bcdbb69..14b5f98 100644 --- a/cmake/modules/FindLIBUSB.cmake +++ b/cmake/modules/FindLIBUSB.cmake @@ -29,6 +29,8 @@ IF(NOT LIBUSB_FOUND) FIND_PATH(LIBUSB_INCLUDE_DIRS lusb0_usb.h "$ENV{ProgramFiles}/LibUSB-Win32/include" NO_SYSTEM_ENVIRONMENT_PATH) FIND_LIBRARY(LIBUSB_LIBRARIES NAMES libusb PATHS "$ENV{ProgramFiles}/LibUSB-Win32/lib/gcc") SET(LIBUSB_LIBRARY_DIR "$ENV{ProgramFiles}/LibUSB-Win32/bin/x86/") + # Must fix up variable to avoid backslashes during packaging + STRING(REGEX REPLACE "\\\\" "/" LIBUSB_LIBRARY_DIR ${LIBUSB_LIBRARY_DIR}) ELSE(WIN32) # If not under Windows we use PkgConfig FIND_PACKAGE (PkgConfig) diff --git a/libnfc/CMakeLists.txt b/libnfc/CMakeLists.txt index 21ced53..4925d35 100644 --- a/libnfc/CMakeLists.txt +++ b/libnfc/CMakeLists.txt @@ -100,7 +100,7 @@ IF(WIN32) INSTALL(TARGETS nfc RUNTIME DESTINATION bin COMPONENT libraries) # At compile time we need the .LIB file, we place it in the lib directory - INSTALL(TARGETS nfc ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT headers) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnfc.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) ELSE(WIN32) INSTALL(TARGETS nfc LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries) ENDIF(WIN32)