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

add separate option CATKIN_INSTALL_INTO_PREFIX_ROOT #940

Merged
merged 1 commit into from
May 31, 2018
Merged
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
12 changes: 11 additions & 1 deletion cmake/all.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ if(_index EQUAL -1)
list(INSERT CMAKE_PREFIX_PATH 0 ${CATKIN_DEVEL_PREFIX})
endif()

# set CATKIN_INSTALL_INTO_PREFIX_ROOT based on CATKIN_BUILD_BINARY_PACKAGE
# if not defined already
if(NOT DEFINED CATKIN_INSTALL_INTO_PREFIX_ROOT)
if(CATKIN_BUILD_BINARY_PACKAGE)
set(CATKIN_INSTALL_INTO_PREFIX_ROOT FALSE)
else()
set(CATKIN_INSTALL_INTO_PREFIX_ROOT TRUE)
endif()
endif()


# enable all new policies (if available)
macro(_set_cmake_policy_to_new_if_available policy)
Expand Down Expand Up @@ -194,7 +204,7 @@ configure_file(${catkin_EXTRAS_DIR}/templates/env.${script_ext}.in
set(CATKIN_ENV ${SETUP_DIR}/env_cached.${script_ext} CACHE INTERNAL "catkin environment")

# add additional environment hooks
if(CATKIN_BUILD_BINARY_PACKAGE)
if(NOT CATKIN_INSTALL_INTO_PREFIX_ROOT)
set(catkin_skip_install_env_hooks "SKIP_INSTALL")
endif()
if(CMAKE_HOST_UNIX AND PROJECT_NAME STREQUAL "catkin")
Expand Down
8 changes: 4 additions & 4 deletions cmake/catkin_generate_environment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function(catkin_generate_environment)
# installspace
set(SETUP_DIR ${CMAKE_INSTALL_PREFIX})

if(NOT CATKIN_BUILD_BINARY_PACKAGE)
if(CATKIN_INSTALL_INTO_PREFIX_ROOT)
# install empty workspace marker if it doesn't already exist
install(CODE "
if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\")
Expand All @@ -99,7 +99,7 @@ function(catkin_generate_environment)
configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
${CMAKE_BINARY_DIR}/catkin_generated/installspace/env.sh
@ONLY)
if(NOT CATKIN_BUILD_BINARY_PACKAGE)
if(CATKIN_INSTALL_INTO_PREFIX_ROOT)
install(PROGRAMS
${CMAKE_BINARY_DIR}/catkin_generated/installspace/env.sh
DESTINATION ${CMAKE_INSTALL_PREFIX})
Expand All @@ -109,7 +109,7 @@ function(catkin_generate_environment)
configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in
${CMAKE_BINARY_DIR}/catkin_generated/installspace/setup.${shell}
@ONLY)
if(NOT CATKIN_BUILD_BINARY_PACKAGE)
if(CATKIN_INSTALL_INTO_PREFIX_ROOT)
install(FILES
${CMAKE_BINARY_DIR}/catkin_generated/installspace/setup.${shell}
DESTINATION ${CMAKE_INSTALL_PREFIX})
Expand Down Expand Up @@ -138,7 +138,7 @@ function(catkin_generate_environment)
configure_file(${catkin_EXTRAS_DIR}/templates/rosinstall.in
${CMAKE_BINARY_DIR}/catkin_generated/installspace/.rosinstall
@ONLY)
if(NOT CATKIN_BUILD_BINARY_PACKAGE)
if(CATKIN_INSTALL_INTO_PREFIX_ROOT)
install(FILES
${CMAKE_BINARY_DIR}/catkin_generated/installspace/.rosinstall
DESTINATION ${CMAKE_INSTALL_PREFIX})
Expand Down