This repository was archived by the owner on Sep 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,3 +4,25 @@ project(xtp-tutorials)
44
55set (PROJECT_VERSION "1.7-dev" )
66
7+ set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR } /CMakeModules)
8+ include (GNUInstallDirs )
9+
10+ install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR } / DESTINATION ${CMAKE_INSTALL_DATADIR} /votca/xtp-tutorials
11+ PATTERN ".git*" EXCLUDE
12+ PATTERN "CMake*" EXCLUDE PATTERN "cmake_install.cmake" EXCLUDE
13+ PATTERN "install_manifest.txt" EXCLUDE PATTERN "*~" EXCLUDE)
14+
15+ configure_file (${CMAKE_MODULE_PATH } /cmake_uninstall.cmake.in ${CMAKE_CURRENT_BINARY_DIR } /cmake_uninstall.cmake IMMEDIATE @ONLY )
16+ option (ENABLE_TESTING "Test if cmake worked" OFF )
17+ if (ENABLE_TESTING)
18+ enable_testing ()
19+ add_test (regression_xtp-tutorial_UninstallExists ${CMAKE_COMMAND } -DFileToCheck=${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
20+ -P ${CMAKE_CURRENT_SOURCE_DIR } /CMakeModules/FileExists.cmake )
21+
22+ set_tests_properties (regression_xtp-tutorial_UninstallExists PROPERTIES LABELS "xtp-tutorials" )
23+ endif (ENABLE_TESTING )
24+ add_custom_target (uninstall-xtp-tutorials COMMAND ${CMAKE_COMMAND } -P ${CMAKE_CURRENT_BINARY_DIR } /cmake_uninstall.cmake )
25+ if (NOT TARGET uninstall)
26+ add_custom_target (uninstall )
27+ endif ()
28+ add_dependencies (uninstall uninstall-xtp-tutorials )
Original file line number Diff line number Diff line change 1+ if (EXISTS ${FileToCheck} )
2+ message ("${FileToCheck} exists." )
3+ else ()
4+ message (FATAL_ERROR "${FileToCheck} doesn't exist." )
5+ endif ()
Original file line number Diff line number Diff line change 1+ IF (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" )
2+ MESSAGE (FATAL_ERROR "Cannot find install manifest: \" @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\" " )
3+ ENDIF (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" )
4+
5+ FILE (READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files )
6+ STRING (REGEX REPLACE "\n " ";" files "${files} " )
7+ FOREACH (file ${files} )
8+ MESSAGE (STATUS "Uninstalling \" $ENV{DESTDIR} ${file} \" " )
9+ IF (EXISTS "$ENV{DESTDIR} ${file} " )
10+ EXEC_PROGRAM (
11+ "@CMAKE_COMMAND@" ARGS "-E remove \" $ENV{DESTDIR} ${file} \" "
12+ OUTPUT_VARIABLE rm_out
13+ RETURN_VALUE rm_retval
14+ )
15+ IF (NOT "${rm_retval} " STREQUAL 0)
16+ MESSAGE (FATAL_ERROR "Problem when removing \" $ENV{DESTDIR} ${file} \" " )
17+ ENDIF (NOT "${rm_retval} " STREQUAL 0 )
18+ ELSE (EXISTS "$ENV{DESTDIR} ${file} " )
19+ MESSAGE (STATUS "File \" $ENV{DESTDIR} ${file} \" does not exist." )
20+ ENDIF (EXISTS "$ENV{DESTDIR} ${file} " )
21+ ENDFOREACH (file )
22+
You can’t perform that action at this time.
0 commit comments