Skip to content

Build & CMake Integration

Slope is designed to be easilty integrated on top of any cmake project in order to merge scientific code and your presentations!

project(slope_project)
cmake_minimum_required(VERSION 3.12)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(slope)

add_executable(slope_project slides.cpp )
target_link_libraries(slope_project slope)
slope.cmake
1
2
3
4
5
6
7
include(FetchContent)
FetchContent_Declare(
  slope
  GIT_REPOSITORY https://github.com/baptiste-genest/slope.git
  GIT_TAG alpha-0.0.1
)
FetchContent_MakeAvailable(slope)

Dependencies

  • the same as Polyscope
  • Imagick (convert command) : Make sure that the convert command is allowed to convert pdf to png, see here.
  • pdflatex

Paths to Imagick and pdflatex are found by cmake.

Build and run !

mkdir build && cd build
cmake ..
make -j
./exe --project_path /path/to/your/project/folder