From 635e7b4250827909e55bf33bc75f9ff8dad5c166 Mon Sep 17 00:00:00 2001 From: theobslhc Date: Mon, 24 Jul 2017 16:20:44 +0100 Subject: [PATCH 1/4] Added install and uninstall rules for libs --- InfiniTAM/CMakeLists.txt | 6 ++++++ InfiniTAM/cmake/SetCUDALibTarget.cmake | 2 ++ InfiniTAM/cmake/SetInstallTarget.cmake | 11 ++++++++++ InfiniTAM/cmake/SetLibTarget.cmake | 2 ++ InfiniTAM/cmake/SetUninstallTarget.cmake | 12 +++++++++++ InfiniTAM/cmake/cmake_uninstall.cmake.in | 26 ++++++++++++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 InfiniTAM/cmake/SetInstallTarget.cmake create mode 100644 InfiniTAM/cmake/SetUninstallTarget.cmake create mode 100644 InfiniTAM/cmake/cmake_uninstall.cmake.in diff --git a/InfiniTAM/CMakeLists.txt b/InfiniTAM/CMakeLists.txt index c249e7578..0e1f17675 100644 --- a/InfiniTAM/CMakeLists.txt +++ b/InfiniTAM/CMakeLists.txt @@ -44,3 +44,9 @@ ADD_SUBDIRECTORY(InputSource) ADD_SUBDIRECTORY(ITMLib) ADD_SUBDIRECTORY(MiniSlamGraphLib) ADD_SUBDIRECTORY(ORUtils) + +################################ +# Uninstall any installed file # +################################ + +include(${CMAKE_SOURCE_DIR}/cmake/SetUninstallTarget.cmake) diff --git a/InfiniTAM/cmake/SetCUDALibTarget.cmake b/InfiniTAM/cmake/SetCUDALibTarget.cmake index 9008cd51b..0fbb1fe7c 100644 --- a/InfiniTAM/cmake/SetCUDALibTarget.cmake +++ b/InfiniTAM/cmake/SetCUDALibTarget.cmake @@ -9,3 +9,5 @@ IF(WITH_CUDA) ELSE() ADD_LIBRARY(${targetname} STATIC ${sources} ${headers} ${templates}) ENDIF() + +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/SetInstallTarget.cmake) diff --git a/InfiniTAM/cmake/SetInstallTarget.cmake b/InfiniTAM/cmake/SetInstallTarget.cmake new file mode 100644 index 000000000..677e4ae47 --- /dev/null +++ b/InfiniTAM/cmake/SetInstallTarget.cmake @@ -0,0 +1,11 @@ +########################## +# SetInstallTarget.cmake # +########################## + +#install target +INSTALL(TARGETS ${targetname} + DESTINATION lib/InfiniTAM/${targetname}) +#install headers of target +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/. DESTINATION include/InfiniTAM/${targetname} + FILES_MATCHING REGEX "^.*\\.(h|hpp)$" +) diff --git a/InfiniTAM/cmake/SetLibTarget.cmake b/InfiniTAM/cmake/SetLibTarget.cmake index 1ac526ab6..3548d7047 100644 --- a/InfiniTAM/cmake/SetLibTarget.cmake +++ b/InfiniTAM/cmake/SetLibTarget.cmake @@ -5,3 +5,5 @@ INCLUDE(${PROJECT_SOURCE_DIR}/cmake/Flags.cmake) ADD_LIBRARY(${targetname} STATIC ${sources} ${headers} ${templates}) + +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/SetInstallTarget.cmake) diff --git a/InfiniTAM/cmake/SetUninstallTarget.cmake b/InfiniTAM/cmake/SetUninstallTarget.cmake new file mode 100644 index 000000000..8611eb466 --- /dev/null +++ b/InfiniTAM/cmake/SetUninstallTarget.cmake @@ -0,0 +1,12 @@ +############################ +# SetUninstallTarget.cmake # +############################ + +# uninstall target +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + IMMEDIATE @ONLY) + +add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) diff --git a/InfiniTAM/cmake/cmake_uninstall.cmake.in b/InfiniTAM/cmake/cmake_uninstall.cmake.in new file mode 100644 index 000000000..4e5159578 --- /dev/null +++ b/InfiniTAM/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,26 @@ +########################## +## cmake_uninstall.cmake.in +## Sourced from https://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F +############################# + +if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +string(REGEX REPLACE "\n" ";" files "${files}") +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif(NOT "${rm_retval}" STREQUAL 0) + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +endforeach(file) From a6866851429872a3c8ee69558d0f9450d051591b Mon Sep 17 00:00:00 2001 From: theobslhc Date: Mon, 24 Jul 2017 16:31:44 +0100 Subject: [PATCH 2/4] Update README.md - Add install instructions --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 47912b8db..d969d0553 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is the main branch of the software bundle "InfiniTAM", the current version Stuart Golodetz Michael Sapienza Tommaso Cavallari - + Previous maintainers and contributors are: Carl Yuheng Ren @@ -17,7 +17,7 @@ Previous maintainers and contributors are: Ian D Reid David W Murray -For more information about InfiniTAM please visit the project website . +For more information about InfiniTAM please visit the project website . Other related projects can be found in the Oxford Active Vision Library . @@ -76,6 +76,11 @@ Several 3rd party libraries are needed for compiling InfiniTAM. The given versio $ cd build $ cmake /path/to/InfiniTAM -DOPEN_NI_ROOT=/path/to/OpenNI2/ $ make +``` + To install the libraries to a custom location on your system, compile with: +``` + $ cmake /path/to/InfiniTAM -DOPEN_NI_ROOT=/path/to/OpenNI2/ -DCMAKE_PREFIX_PATH=/path/to/install/libs + $ make install ``` To create a doxygen documentation, just run doxygen: ``` @@ -90,7 +95,7 @@ Padding the data structure ITMVoxel in ITMLibDefines.h with one extra byte may o On Mac OS X 10.9 there are currently some issues with libc++ vs. libstdc++ in conjunction with CUDA. They eventually manifest in error messages like: ``` -Undefined symbols for architecture x86_64: +Undefined symbols for architecture x86_64: "std::ios_base::Init::Init()", referenced from: __GLOBAL__I_a in libITMLib.a(ITMLib_generated_ITMColorTracker_CUDA.cu.o) __GLOBAL__I_a in libITMLib.a(ITMLib_generated_ITMDepthTracker_CUDA.cu.o) @@ -146,7 +151,7 @@ author = {{K{\"a}hler}, O. and {Torr}, P.~H.~S and {Murray}, D.~W.}, title = "{Very High Frame Rate Volumetric Integration of Depth Images on Mobile Device}", -journal = "{IEEE Transactions on Visualization and Computer Graphics +journal = "{IEEE Transactions on Visualization and Computer Graphics (Proceedings International Symposium on Mixed and Augmented Reality 2015}", volume = {22}, number = {11}, From e080819da1606d0d0df30e37d93e029df15414ec Mon Sep 17 00:00:00 2001 From: theobslhc Date: Wed, 26 Jul 2017 15:40:55 +0100 Subject: [PATCH 3/4] Small cleanup --- InfiniTAM/CMakeLists.txt | 2 +- InfiniTAM/cmake/SetUninstallTarget.cmake | 4 +-- InfiniTAM/cmake/cmake_uninstall.cmake.in | 36 ++++++++++++------------ README.md | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/InfiniTAM/CMakeLists.txt b/InfiniTAM/CMakeLists.txt index 0e1f17675..ccfc3b782 100644 --- a/InfiniTAM/CMakeLists.txt +++ b/InfiniTAM/CMakeLists.txt @@ -49,4 +49,4 @@ ADD_SUBDIRECTORY(ORUtils) # Uninstall any installed file # ################################ -include(${CMAKE_SOURCE_DIR}/cmake/SetUninstallTarget.cmake) +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/SetUninstallTarget.cmake) diff --git a/InfiniTAM/cmake/SetUninstallTarget.cmake b/InfiniTAM/cmake/SetUninstallTarget.cmake index 8611eb466..b84484a2d 100644 --- a/InfiniTAM/cmake/SetUninstallTarget.cmake +++ b/InfiniTAM/cmake/SetUninstallTarget.cmake @@ -3,10 +3,10 @@ ############################ # uninstall target -configure_file( +CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) -add_custom_target(uninstall +ADD_CUSTOM_TARGET(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) diff --git a/InfiniTAM/cmake/cmake_uninstall.cmake.in b/InfiniTAM/cmake/cmake_uninstall.cmake.in index 4e5159578..e4f3cd4e5 100644 --- a/InfiniTAM/cmake/cmake_uninstall.cmake.in +++ b/InfiniTAM/cmake/cmake_uninstall.cmake.in @@ -1,26 +1,26 @@ -########################## -## cmake_uninstall.cmake.in +############################# +## cmake_uninstall.cmake.in # ## Sourced from https://cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F ############################# -if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -string(REGEX REPLACE "\n" ";" files "${files}") -foreach(file ${files}) - message(STATUS "Uninstalling $ENV{DESTDIR}${file}") - if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - exec_program( +FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling $ENV{DESTDIR}${file}") + IF(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + EXEC_PROGRAM( "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) - if(NOT "${rm_retval}" STREQUAL 0) - message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") - endif(NOT "${rm_retval}" STREQUAL 0) - else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File $ENV{DESTDIR}${file} does not exist.") - endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) + IF(NOT "${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + ENDIF(NOT "${rm_retval}" STREQUAL 0) + ELSE(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + MESSAGE(STATUS "File $ENV{DESTDIR}${file} does not exist.") + ENDIF(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") +ENDFOREACH(file) diff --git a/README.md b/README.md index d969d0553..b065056bd 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ author = {{K{\"a}hler}, O. and {Torr}, P.~H.~S and {Murray}, D.~W.}, title = "{Very High Frame Rate Volumetric Integration of Depth Images on Mobile Device}", -journal = "{IEEE Transactions on Visualization and Computer Graphics +journal = "{IEEE Transactions on Visualization and Computer Graphics (Proceedings International Symposium on Mixed and Augmented Reality 2015}", volume = {22}, number = {11}, From 173fef4f364275ae535b8bbe2daeb670f7afa79d Mon Sep 17 00:00:00 2001 From: theobslhc Date: Wed, 26 Jul 2017 15:43:00 +0100 Subject: [PATCH 4/4] Update README.md - Add uninstall instruction --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b065056bd..eefabc269 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,10 @@ Several 3rd party libraries are needed for compiling InfiniTAM. The given versio ``` $ cmake /path/to/InfiniTAM -DOPEN_NI_ROOT=/path/to/OpenNI2/ -DCMAKE_PREFIX_PATH=/path/to/install/libs $ make install +``` + You can uninstall the libraries with: +``` + $ make uninstall ``` To create a doxygen documentation, just run doxygen: ``` @@ -151,7 +155,7 @@ author = {{K{\"a}hler}, O. and {Torr}, P.~H.~S and {Murray}, D.~W.}, title = "{Very High Frame Rate Volumetric Integration of Depth Images on Mobile Device}", -journal = "{IEEE Transactions on Visualization and Computer Graphics +journal = "{IEEE Transactions on Visualization and Computer Graphics (Proceedings International Symposium on Mixed and Augmented Reality 2015}", volume = {22}, number = {11},