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

added atomic_configure_file function to catkin #566

Merged
merged 1 commit into from
Dec 23, 2013
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
1 change: 1 addition & 0 deletions cmake/all.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ include(CMakeParseArguments)
# python-integration: catkin_python_setup.cmake, interrogate_setup_dot_py.py, templates/__init__.py.in, templates/script.py.in, templates/python_distutils_install.bat.in, templates/python_distutils_install.sh.in, templates/safe_execute_install.cmake.in
foreach(filename
assert
atomic_configure_file
catkin_add_env_hooks
catkin_destinations
catkin_generate_environment
Expand Down
5 changes: 5 additions & 0 deletions cmake/atomic_configure_file.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function(atomic_configure_file input output)
set(atomic_file "${CMAKE_BINARY_DIR}/atomic_configure_file")
configure_file("${input}" "${atomic_file}" ${ARGN})
file(RENAME "${atomic_file}" "${output}")
endfunction()
2 changes: 1 addition & 1 deletion cmake/catkin_add_env_hooks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function(catkin_add_env_hooks file_prefix)
else()
set(in_template ${base}.in)
endif()
configure_file(${in_template}
atomic_configure_file(${in_template}
${CATKIN_DEVEL_PREFIX}/etc/catkin/profile.d/${ENV_HOOK}
@ONLY)
elseif (EXISTS ${base})
Expand Down
12 changes: 6 additions & 6 deletions cmake/catkin_generate_environment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ function(catkin_generate_environment)
endif()

# generate Python setup util
configure_file(${catkin_EXTRAS_DIR}/templates/_setup_util.py.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/_setup_util.py.in
${CATKIN_DEVEL_PREFIX}/_setup_util.py
@ONLY)

if(NOT WIN32)
# non-windows
# generate env
configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.in
${CATKIN_DEVEL_PREFIX}/env.sh
@ONLY)
# generate setup for various shells
foreach(shell bash sh zsh)
configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/setup.${shell}.in
${CATKIN_DEVEL_PREFIX}/setup.${shell}
@ONLY)
endforeach()

else()
# windows
# generate env
configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/env.bat.in
${CATKIN_DEVEL_PREFIX}/env.bat
@ONLY)
# generate setup
configure_file(${catkin_EXTRAS_DIR}/templates/setup.bat.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/setup.bat.in
${CATKIN_DEVEL_PREFIX}/setup.bat
@ONLY)
endif()

# generate rosinstall file referencing setup.sh
configure_file(${catkin_EXTRAS_DIR}/templates/rosinstall.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/rosinstall.in
${CATKIN_DEVEL_PREFIX}/.rosinstall
@ONLY)

Expand Down
2 changes: 1 addition & 1 deletion cmake/catkin_python_setup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function(catkin_python_setup)
message(FATAL_ERROR "The script '${name}' as listed in 'setup.py' of '${PROJECT_NAME}' doesn't exist")
endif()
set(PYTHON_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/${script})
configure_file(${catkin_EXTRAS_DIR}/templates/script.py.in
atomic_configure_file(${catkin_EXTRAS_DIR}/templates/script.py.in
${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_BIN_DESTINATION}/${name}
@ONLY)
endforeach()
Expand Down