diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ab28461..17cfcade 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,8 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) +set(RUNTIME_SHARED_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/shared/bin) + set(CMAKE_MACOSX_RPATH TRUE) if (NOT CMAKE_BUILD_TYPE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e1b43147..d1f3cc72 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,7 +188,7 @@ set_target_properties(ss-redir-shared PROPERTIES OUTPUT_NAME ss-redir) set_target_properties(ss-server-shared ss-tunnel-shared ss-manager-shared ss-local-shared ss-redir-shared PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/shared/bin" + RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_SHARED_OUTPUT_DIRECTORY} ) set_target_properties(shadowsocks-libev-shared PROPERTIES OUTPUT_NAME shadowsocks-libev) @@ -197,7 +197,8 @@ target_link_libraries(shadowsocks-libev-shared cork-shared ipset-shared ${DEPS_S # ------------------------------------------------------------------ # Misc -install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/ +# Recommend to install shared by default +install(DIRECTORY ${RUNTIME_SHARED_OUTPUT_DIRECTORY}/ DESTINATION bin) install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/ DESTINATION lib)