diff --git a/InfiniTAM/CMakeLists.txt b/InfiniTAM/CMakeLists.txt index c249e7578..ccfc3b782 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..b84484a2d --- /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..e4f3cd4e5 --- /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) diff --git a/README.md b/README.md index 47912b8db..eefabc269 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,15 @@ 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 +``` + You can uninstall the libraries with: +``` + $ make uninstall ``` To create a doxygen documentation, just run doxygen: ``` @@ -90,7 +99,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 +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},