mirror of https://github.com/gnss-sdr/gnss-sdr
Use cmake -E rm instead of -E remove if CMake >= 3.17
This commit is contained in:
parent
2bf7d887a1
commit
581ba96904
|
@ -14,7 +14,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||||
message(FATAL_ERROR "Prevented in-tree build, it is bad practice.\nTry 'cd build && cmake ..' instead.")
|
message(FATAL_ERROR "Prevented in-tree build, it is bad practice.\nTry 'cd build && cmake ..' instead.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.12...3.16)
|
cmake_minimum_required(VERSION 2.8.12...3.17)
|
||||||
project(gnss-sdr CXX C)
|
project(gnss-sdr CXX C)
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
||||||
|
|
||||||
|
@ -2322,12 +2322,21 @@ if(DOXYGEN_FOUND)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.")
|
message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.")
|
||||||
add_custom_target(doc-clean
|
if(CMAKE_VERSION VERSION_LESS 3.17)
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html
|
add_custom_target(doc-clean
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html
|
||||||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex
|
||||||
COMMENT "Cleaning documentation." VERBATIM
|
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf
|
||||||
)
|
COMMENT "Cleaning documentation." VERBATIM
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_target(doc-clean
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/docs/html
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/docs/latex
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf
|
||||||
|
COMMENT "Cleaning documentation." VERBATIM
|
||||||
|
)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS " Doxygen has not been found in your system.")
|
message(STATUS " Doxygen has not been found in your system.")
|
||||||
message(STATUS " You can get nice code documentation by using it!")
|
message(STATUS " You can get nice code documentation by using it!")
|
||||||
|
|
|
@ -14,21 +14,20 @@ file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||||
foreach(file ${files})
|
foreach(file ${files})
|
||||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||||
if(EXISTS "$ENV{DESTDIR}${file}")
|
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||||
execute_process(
|
if(CMAKE_VERSION VERSION_LESS 3.17)
|
||||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
execute_process(
|
||||||
OUTPUT_VARIABLE rm_out
|
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
||||||
RESULT_VARIABLE rm_retval
|
OUTPUT_VARIABLE rm_out
|
||||||
)
|
RESULT_VARIABLE rm_retval
|
||||||
if(NOT "${rm_retval}" STREQUAL 0)
|
)
|
||||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
else()
|
||||||
|
execute_process(
|
||||||
|
COMMAND @CMAKE_COMMAND@ -E rm "$ENV{DESTDIR}${file}"
|
||||||
|
OUTPUT_VARIABLE rm_out
|
||||||
|
RESULT_VARIABLE rm_retval
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
elseif(IS_SYMLINK "$ENV{DESTDIR}${file}")
|
|
||||||
execute_process(
|
|
||||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
|
||||||
OUTPUT_VARIABLE rm_out
|
|
||||||
RESULT_VARIABLE rm_retval
|
|
||||||
)
|
|
||||||
if(NOT "${rm_retval}" STREQUAL 0)
|
if(NOT "${rm_retval}" STREQUAL 0)
|
||||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -14,21 +14,20 @@ file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||||
foreach(file ${files})
|
foreach(file ${files})
|
||||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||||
if(EXISTS "$ENV{DESTDIR}${file}")
|
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||||
execute_process(
|
if(CMAKE_VERSION VERSION_LESS 3.17)
|
||||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
execute_process(
|
||||||
OUTPUT_VARIABLE rm_out
|
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
||||||
RESULT_VARIABLE rm_retval
|
OUTPUT_VARIABLE rm_out
|
||||||
)
|
RESULT_VARIABLE rm_retval
|
||||||
if(NOT "${rm_retval}" STREQUAL 0)
|
)
|
||||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
else()
|
||||||
|
execute_process(
|
||||||
|
COMMAND @CMAKE_COMMAND@ -E rm "$ENV{DESTDIR}${file}"
|
||||||
|
OUTPUT_VARIABLE rm_out
|
||||||
|
RESULT_VARIABLE rm_retval
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
elseif(IS_SYMLINK "$ENV{DESTDIR}${file}")
|
|
||||||
execute_process(
|
|
||||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
|
||||||
OUTPUT_VARIABLE rm_out
|
|
||||||
RESULT_VARIABLE rm_retval
|
|
||||||
)
|
|
||||||
if(NOT "${rm_retval}" STREQUAL 0)
|
if(NOT "${rm_retval}" STREQUAL 0)
|
||||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue