diff --git a/CMakeLists.txt b/CMakeLists.txt index ce596a53..14a2d7be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ set(BUILD_SHARED_LIBS ON) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) include(external_tools) - #set(CMAKE_CXX_STANDARD 17) #TODO: check for Opencv 4.5.4 that cannot be installed or detected @@ -85,7 +84,7 @@ find_package(OpenGL REQUIRED) set(BUILD_V4_API ON) add_external_package(TSlam) -add_external_package(TTool) +add_external_package(TTool IGNORE_SYSTEM) find_package(glfw3 3.3 REQUIRED) find_package(OpenCV 4.5.4 REQUIRED @@ -100,6 +99,7 @@ find_package(OpenCV 4.5.4 REQUIRED find_package(assimp 5.0.0 REQUIRED) find_package(GLEW REQUIRED) + add_external_package(imgui) add_external_package(spdlog) add_external_package(pugixml) diff --git a/README.md b/README.md index dc2b788e..1cdbfa40 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,29 @@ They are made to be print as stickers. The code to generate them can be found ![
-## Build +## System dependecies +AC needs some local libraries already installed before compilation with cmake. + +Before start you will need many dependencies but the largest will be opencv `4.5.5`. Be sure to have installed this version in your local system. + +Next we need glm dependencies and libraries: +```bash +sudo apt-get -y install libmpfr-dev libboost-dev libgoogle-glog-dev \ + freeglut3-dev libglew-dev libglfw3 libglfw3-dev \ + git-lfs libassimp-dev libglm-dev libimgui-dev +``` + +For tbb and opencv you will also need these: +```bash +sudo apt -y install build-essential cmake git pkg-config libgtk-3-dev \ + libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ + libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ + gfortran openexr libatlas-base-dev python3-dev python3-numpy \ + libtbb2 libtbb-dev libdc1394-dev libopenexr-dev \ + libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev +``` + +## Build & run Cloning the repo with submodules ```bash git clone --recursive git@github.com:ibois-epfl/augmented-carpentry.git @@ -190,17 +212,23 @@ git submodule sync git pull --recurse-submodules ``` -If it is the first time you are installing AC, set all the dependecies options in the `CMakeLists.txt` file to **ON**. +Next you need to pull the PyTorch dependency with the Large File System in git, to do this: +```bash +cd deps/TTool +git lfs pull +``` + +Time to build.. If you are deploying on a touch monitor set the flag `-DDEPLOY_ON_TOUCH=ON`, you can config: ```bash - ./cmake/install_TSlam.sh (Although CMakeList.txt run this when INSTALL_TSLAM option is on, you might need to install TSlam with this command manually as its need sudo priviledge) - ./cmake/install_TTool.sh - ./configure.sh (or ./configure.sh -c for cleaning out the build folder) - ./build.sh # or cmake --build . --target AC +cd augmented-carpentry +cmake -S . -B build +cmake --build build ``` + To run the code: ```bash -./run.sh +./build/bin/AC ``` ## How to contribute diff --git a/cmake/Findimgui.cmake b/cmake/Findimgui.cmake index 25a36ff0..69621e75 100644 --- a/cmake/Findimgui.cmake +++ b/cmake/Findimgui.cmake @@ -2,4 +2,6 @@ find_package(PkgConfig) pkg_check_modules(imgui imgui IMPORTED_TARGET) -add_library(imgui::imgui ALIAS PkgConfig::imgui) +if (imgui_FOUND) + add_library(imgui::imgui ALIAS PkgConfig::imgui) +endif () \ No newline at end of file diff --git a/deps/TTool.cmake b/deps/TTool.cmake index 8f32b6d5..ca33e5df 100644 --- a/deps/TTool.cmake +++ b/deps/TTool.cmake @@ -2,3 +2,6 @@ download_submodule_project(TTool) set(TTOOL_BUILD_TTOOL_EXE OFF) add_subdirectory(deps/TTool) + +find_package(Torch) + diff --git a/deps/imgui.cmake b/deps/imgui.cmake index de6ab487..e17557ca 100644 --- a/deps/imgui.cmake +++ b/deps/imgui.cmake @@ -6,6 +6,9 @@ download_external_project(stb URL "https://github.com/ibois-epfl/stb.git" BACKEND GIT) -add_subdirectory(stb) -add_subdirectory(imgui) +#add_subdirectory(stb) +add_library(stb INTERFACE) +target_include_directories(stb INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/deps) + +add_subdirectory(deps/imgui) #list(APPEND AC_INSTALL_TARGETS imgui::imgui) diff --git a/tests/graphics/CMakeLists.txt b/tests/graphics/CMakeLists.txt index ac56a6a1..71512c8b 100644 --- a/tests/graphics/CMakeLists.txt +++ b/tests/graphics/CMakeLists.txt @@ -13,4 +13,4 @@ target_link_libraries(graphics_test GLU ) -add_test(NAME "GraphicsTest" COMMAND "graphics_test" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") +add_test(NAME "GraphicsTest" COMMAND "graphics_test" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") \ No newline at end of file