Use INSTALL_LIB_DIR instead of 'CMAKE_INSTALL_PREFIX/lib' in CMakeLists.txt (#318)
This commit is contained in:
parent
832c6cb48d
commit
cc04a013be
|
@ -8,17 +8,6 @@ option(BUILD_ORM "Build orm" ON)
|
||||||
option(LIBPQ_BATCH_MODE "Use batch mode for libpq" ON)
|
option(LIBPQ_BATCH_MODE "Use batch mode for libpq" ON)
|
||||||
option(BUILD_DROGON_SHARED "Build drogon as a shared lib" OFF)
|
option(BUILD_DROGON_SHARED "Build drogon as a shared lib" OFF)
|
||||||
|
|
||||||
if(BUILD_DROGON_SHARED)
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
|
||||||
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
|
||||||
if("${isSystemDir}" STREQUAL "-1")
|
|
||||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
|
||||||
endif("${isSystemDir}" STREQUAL "-1")
|
|
||||||
add_library(${PROJECT_NAME} SHARED)
|
|
||||||
else()
|
|
||||||
add_library(${PROJECT_NAME} STATIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(DROGON_MAJOR_VERSION 1)
|
set(DROGON_MAJOR_VERSION 1)
|
||||||
set(DROGON_MINOR_VERSION 0)
|
set(DROGON_MINOR_VERSION 0)
|
||||||
set(DROGON_PATCH_VERSION 0)
|
set(DROGON_PATCH_VERSION 0)
|
||||||
|
@ -52,6 +41,17 @@ foreach(p
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
if(BUILD_DROGON_SHARED)
|
||||||
|
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||||
|
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${INSTALL_LIB_DIR}" isSystemDir)
|
||||||
|
if("${isSystemDir}" STREQUAL "-1")
|
||||||
|
set(CMAKE_INSTALL_RPATH "${INSTALL_LIB_DIR}")
|
||||||
|
endif("${isSystemDir}" STREQUAL "-1")
|
||||||
|
add_library(${PROJECT_NAME} SHARED)
|
||||||
|
else()
|
||||||
|
add_library(${PROJECT_NAME} STATIC)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CheckIncludeFileCXX)
|
include(CheckIncludeFileCXX)
|
||||||
|
|
||||||
check_include_file_cxx(any HAS_ANY)
|
check_include_file_cxx(any HAS_ANY)
|
||||||
|
|
Loading…
Reference in New Issue