Browse Source

[cmake] use GNUInstallDirs for libraries destination path (#1672)

Signed-off-by: r4sas <r4sas@i2pmail.org>
pull/1677/head
R4SAS 3 years ago
parent
commit
ff0e23d2c4
Signed by: r4sas
GPG Key ID: 66F6C87B98EBCFE2
  1. 18
      build/CMakeLists.txt

18
build/CMakeLists.txt

@ -27,6 +27,9 @@ option(WITH_THREADSANITIZER "Build with thread sanitizer unix only" OFF) @@ -27,6 +27,9 @@ option(WITH_THREADSANITIZER "Build with thread sanitizer unix only" OFF)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
set(CMAKE_SOURCE_DIR "..")
#Handle paths nicely
include(GNUInstallDirs)
# architecture
include(TargetArch)
target_architecture(ARCHITECTURE)
@ -48,8 +51,8 @@ set_target_properties(libi2pd PROPERTIES PREFIX "") @@ -48,8 +51,8 @@ set_target_properties(libi2pd PROPERTIES PREFIX "")
if(WITH_LIBRARY)
install(TARGETS libi2pd
EXPORT libi2pd
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Libraries)
# TODO Make libi2pd available to 3rd party projects via CMake as imported target
# FIXME This pulls stdafx
@ -63,8 +66,8 @@ set_target_properties(libi2pdclient PROPERTIES PREFIX "") @@ -63,8 +66,8 @@ set_target_properties(libi2pdclient PROPERTIES PREFIX "")
if(WITH_LIBRARY)
install(TARGETS libi2pdclient
EXPORT libi2pdclient
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Libraries)
endif()
@ -75,8 +78,8 @@ set_target_properties(libi2pdlang PROPERTIES PREFIX "") @@ -75,8 +78,8 @@ set_target_properties(libi2pdlang PROPERTIES PREFIX "")
if(WITH_LIBRARY)
install(TARGETS libi2pdlang
EXPORT libi2pdlang
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Libraries)
endif()
@ -272,9 +275,6 @@ message(STATUS " ADDRSANITIZER : ${WITH_ADDRSANITIZER}") @@ -272,9 +275,6 @@ message(STATUS " ADDRSANITIZER : ${WITH_ADDRSANITIZER}")
message(STATUS " THREADSANITIZER : ${WITH_THREADSANITIZER}")
message(STATUS "---------------------------------------")
#Handle paths nicely
include(GNUInstallDirs)
if(WITH_BINARY)
add_executable("${PROJECT_NAME}" ${DAEMON_SRC})

Loading…
Cancel
Save