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

Loading…
Cancel
Save