Enable selection of static vs shared build
By removing the hard-coded `SHARED` flag in `ADD_LIBRARY` and setting the `ARCHIVE DESTINATION` to the library install path, you can choose which type of build you want by passing a `BUILD_SHARED_LIBS` flag when configuring.
This commit is contained in:
parent
692038ceaf
commit
992f1c56ca
@ -69,7 +69,7 @@ IF(LIBNFC_LOG)
|
||||
LIST(APPEND LIBRARY_SOURCES log log-internal)
|
||||
ENDIF(WIN32)
|
||||
ENDIF(LIBNFC_LOG)
|
||||
ADD_LIBRARY(nfc SHARED ${LIBRARY_SOURCES})
|
||||
ADD_LIBRARY(nfc ${LIBRARY_SOURCES})
|
||||
|
||||
IF(PCSC_FOUND)
|
||||
TARGET_LINK_LIBRARIES(nfc ${PCSC_LIBRARIES})
|
||||
@ -103,6 +103,6 @@ IF(WIN32)
|
||||
# At compile time we need the .LIB file, we place it in the lib directory
|
||||
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)
|
||||
INSTALL(TARGETS nfc ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user