mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Merged in infinitei/eigen (pull request PR-91)
Added cmake uninstall target
This commit is contained in:
commit
e0a8615b94
@ -448,6 +448,7 @@ if(cmake_generator_tolower MATCHES "makefile")
|
||||
message(STATUS "make check | Build and run the unit-tests. Read this page:")
|
||||
message(STATUS " | http://eigen.tuxfamily.org/index.php?title=Tests")
|
||||
message(STATUS "make blas | Build BLAS library (not the same thing as Eigen)")
|
||||
message(STATUS "make uninstall| Removes files installed by make install")
|
||||
message(STATUS "--------------+--------------------------------------------------------------")
|
||||
else()
|
||||
message(STATUS "To build/run the unit tests, read this page:")
|
||||
@ -483,3 +484,7 @@ install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/UseEigen3.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Eigen3Config.cmake
|
||||
DESTINATION ${EIGEN_CONFIG_CMAKE_PATH}
|
||||
)
|
||||
|
||||
# Add uninstall target
|
||||
add_custom_target ( uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/EigenUninstall.cmake)
|
||||
|
40
cmake/EigenUninstall.cmake
Normal file
40
cmake/EigenUninstall.cmake
Normal file
@ -0,0 +1,40 @@
|
||||
################ CMake Uninstall Template #######################
|
||||
# CMake Template file for uninstallation of files
|
||||
# mentioned in 'install_manifest.txt'
|
||||
#
|
||||
# Used by uinstall target
|
||||
#################################################################
|
||||
|
||||
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
|
||||
|
||||
if(EXISTS ${MANIFEST})
|
||||
message(STATUS "============== Uninstalling Eigen ===================")
|
||||
|
||||
file(STRINGS ${MANIFEST} files)
|
||||
foreach(file ${files})
|
||||
if(EXISTS ${file})
|
||||
message(STATUS "Removing file: '${file}'")
|
||||
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${file}
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Failed to remove file: '${file}'.")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "File '${file}' does not exist.")
|
||||
endif()
|
||||
endforeach(file)
|
||||
|
||||
message(STATUS "========== Finished Uninstalling Eigen ==============")
|
||||
else()
|
||||
message(STATUS "Cannot find install manifest: '${MANIFEST}'")
|
||||
message(STATUS "Probably make install has not been performed")
|
||||
message(STATUS " or install_manifest.txt has been deleted.")
|
||||
endif()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user