Skip to content

Commit

Permalink
Use ${CMAKE_COMMAND} instead of @CMAKE_COMMAND@ in generated scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gergondet committed Feb 29, 2024
1 parent a3c23e1 commit b76548f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cmake_reinstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
if(EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
execute_process(COMMAND "@CMAKE_COMMAND@" --build "@PROJECT_BINARY_DIR@" --target uninstall --config $<CONFIGURATION>)
execute_process(COMMAND ${CMAKE_COMMAND} --build "@PROJECT_BINARY_DIR@" --target uninstall --config $<CONFIGURATION>)
endif()
execute_process(COMMAND "@CMAKE_COMMAND@" --build "@PROJECT_BINARY_DIR@" --target install --config $<CONFIGURATION>)
execute_process(COMMAND ${CMAKE_COMMAND} --build "@PROJECT_BINARY_DIR@" --target install --config $<CONFIGURATION>)
10 changes: 5 additions & 5 deletions cmake_uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ MESSAGE(STATUS "catkin path: @CMAKE_INSTALL_PREFIX@/.catkin")
IF(EXISTS "@CMAKE_INSTALL_PREFIX@/.catkin" AND PACKAGE_CREATES_DOT_CATKIN)
MESSAGE(STATUS "Try to remove @CMAKE_INSTALL_PREFIX@/.catkin")
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "@CMAKE_INSTALL_PREFIX@/.catkin"
COMMAND ${CMAKE_COMMAND} -E remove "@CMAKE_INSTALL_PREFIX@/.catkin"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
ERROR_VARIABLE rm_err
Expand All @@ -40,7 +40,7 @@ FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
)
Expand All @@ -54,7 +54,7 @@ FOREACH(file ${files})
IF(EXISTS "$ENV{DESTDIR}${pycfile}")
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${pycfile}\"")
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${pycfile}"
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${pycfile}"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
)
Expand All @@ -70,15 +70,15 @@ FOREACH(file ${files})
# If file is a broken symbolic link, EXISTS returns false.
# Workaround this bug by attempting to remove the file anyway.
EXECUTE_PROCESS(
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
ERROR_QUIET
)
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)
EXECUTE_PROCESS(
COMMAND "@CMAKE_COMMAND@" -E remove "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"
COMMAND ${CMAKE_COMMAND} -E remove "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt"
RESULT_VARIABLE rm_resval
OUTPUT_VARIABLE rm_out
ERROR_QUIET
Expand Down
7 changes: 4 additions & 3 deletions uninstall.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ macro(_SETUP_PROJECT_UNINSTALL)
# remember what we install ?!
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" IMMEDIATE @ONLY)
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake" @ONLY)

add_custom_target(
uninstall
"${CMAKE_COMMAND}"
-DPACKAGE_CREATES_DOT_CATKIN=${PACKAGE_CREATES_DOT_CATKIN} -P
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")

configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake_reinstall.cmake.in"
"${PROJECT_BINARY_DIR}/cmake/cmake_reinstall.cmake.configured")
configure_file(
"${CMAKE_CURRENT_LIST_DIR}/cmake_reinstall.cmake.in"
"${PROJECT_BINARY_DIR}/cmake/cmake_reinstall.cmake.configured" @ONLY)
if(DEFINED CMAKE_BUILD_TYPE)
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/cmake/${CMAKE_BUILD_TYPE}")
else(DEFINED CMAKE_BUILD_TYPE)
Expand Down

0 comments on commit b76548f

Please sign in to comment.