mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 03:38:03 +08:00
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(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_MINOR_VERSION 0)
|
||||
set(DROGON_PATCH_VERSION 0)
|
||||
@ -52,6 +41,17 @@ foreach(p
|
||||
endif()
|
||||
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)
|
||||
|
||||
check_include_file_cxx(any HAS_ANY)
|
||||
|
Loading…
Reference in New Issue
Block a user