Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR#92 update: use $ORIGIN/../lib for custom installed boost libraries #1

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,21 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

IF (UNIX AND NOT APPLE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../lib64")
IF( NOT ${GET_BOOST})
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../lib64")
ELSE()
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../lib64:${Boost_LIBRARY_DIRS}")
ENDIF( NOT ${GET_BOOST})

#ELSE ( APPLE )
# set(CMAKE_INSTALL_NAME_DIR "@rpath")
# set(CMAKE_INSTALL_RPATH "@executable_path/../lib;@excutable_path/../lib64;@loader_path")
ELSE (UNIX AND NOT APPLE)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib64")
IF( NOT ${GET_BOOST} )
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib64")
ELSE()
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib64:${Boost_LIBRARY_DIRS}")
ENDIF( NOT ${GET_BOOST} )
ENDIF (UNIX AND NOT APPLE)

# add the automatically determined parts of the RPATH
Expand Down
16 changes: 9 additions & 7 deletions cmake/IntegrateBoost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ macro(download_boost)
message(STATUS "Downloading boost...")
message(STATUS "Target boost URL: ${BOOST_URL}")
execute_process(COMMAND mkdir -p ${BOOST_ROOT_DIR})
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && wget ${BOOST_URL}")
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && tar -xvzf ./*.tar.gz")
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && rm ./*.tar.gz")
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && mv boost* boost")
if (NOT EXISTS ${BOOST_SRC_DIR})
file(DOWNLOAD ${BOOST_URL} ${BOOST_ROOT_DIR}/boost_1_67_0.tar.gz SHOW_PROGRESS)
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && tar -xvzf ./*.tar.gz")
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && rm ./*.tar.gz")
execute_process(COMMAND bash -c "cd ${BOOST_ROOT_DIR} && mv boost* boost")
endif()
endmacro()


Expand All @@ -28,8 +30,8 @@ macro(install_boost)
execute_process(COMMAND mkdir -p ${BOOST_INSTALL_DIR})
execute_process(
COMMAND
bash -c "cd ${BOOST_SRC_DIR} && ./bootstrap.sh --prefix=${BOOST_INSTALL_DIR}")
execute_process(COMMAND bash -c "cd ${BOOST_SRC_DIR} && ./b2 install")
bash -c "cd ${BOOST_SRC_DIR} && ./bootstrap.sh --prefix=${BOOST_INSTALL_DIR} cxxflags=-std=c++17")
execute_process(COMMAND bash -c "cd ${BOOST_SRC_DIR} && ./b2 -j4 hardcode-dll-paths=true dll-path=\"'\\$ORIGIN/../lib'\" install")
endmacro()


Expand All @@ -38,7 +40,7 @@ macro(config_boost)
set(BOOST_ROOT ${BOOST_INSTALL_DIR})
set(Boost_INCLUDE_DIR ${BOOST_INSTALL_DIR}/include)
set(Boost_LIBRARY_DIRS ${BOOST_INSTALL_DIR}/lib)
find_package(Boost 1.67.0 REQUIRED)
find_package(Boost 1.67.0 EXACT REQUIRED)
endmacro()


Expand Down