Skip to content

Commit

Permalink
Merge pull request #20 from ibois-epfl/after_cmake_merge_guli
Browse files Browse the repository at this point in the history
After cmake merge
  • Loading branch information
9and3 authored Sep 21, 2023
2 parents 77df3d5 + a412138 commit bf27c67
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
42 changes: 35 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,29 @@ They are made to be print as stickers. The code to generate them can be found ![
<br />


## 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 [email protected]:ibois-epfl/augmented-carpentry.git
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion cmake/Findimgui.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
3 changes: 3 additions & 0 deletions deps/TTool.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ download_submodule_project(TTool)

set(TTOOL_BUILD_TTOOL_EXE OFF)
add_subdirectory(deps/TTool)

find_package(Torch)

7 changes: 5 additions & 2 deletions deps/imgui.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion tests/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

0 comments on commit bf27c67

Please sign in to comment.