File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed
Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1515
1616 - name : Build Tinyopt-example
1717 run : |-
18- cmake ./ -B build -DBUILD_TINYOPT_TESTS=OFF
18+ cmake ./ -B build -DTINYOPT_BUILD_TESTS=OFF
19+ cmake --build build -j 4
20+
21+ linux-build-deb :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - name : Check out repository code
25+ uses : actions/checkout@v4
26+ - run : echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
27+
28+ - name : Install dependencies
29+ run : |-
30+ sudo apt-get install build-essential cmake libeigen3-dev
31+
32+ - name : Install Tinyopt as a dependency
33+ run : |-
34+ TAG=`git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/julien-michot/tinyopt.git/ | tail --lines=1 | cut --delimiter='/' --fields=3`
35+ echo $TAG
36+ wget -q --no-check-certificate https://github.com/julien-michot/tinyopt/releases/download/$TAG/tinyopt-${TAG:1}-Linux.deb
37+ sudo dpkg -i tinyopt-${TAG:1}-Linux.deb
38+
39+ - name : Build Tinyopt-example
40+ run : |-
41+ cmake ./ -B build
1942 cmake --build build -j 4
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ project(tinyopt-example VERSION 0.0.1
77# Compiler flags
88set (CMAKE_CXX_STANDARD 20)
99
10+ find_package (Eigen3 ) # Only needed if Tinyopt is not found locally
11+
1012# Find Tinyopt, fetch it if not found
1113find_package (Tinyopt )
1214
@@ -20,10 +22,13 @@ if (NOT Tinyopt_FOUND)
2022 GIT_SHALLOW TRUE
2123 GIT_PROGRESS TRUE
2224 )
23- set (BUILD_TINYOPT_TESTS OFF )
25+ set (TINYOPT_BUILD_TESTS OFF )
2426 FetchContent_MakeAvailable (tinyopt)
27+ else ()
28+ message ("Tinyopt found at ${Tinyopt_INCLUDE_DIRS} " )
2529endif ()
2630
2731# Header-only library
2832add_executable (example src/example.cpp )
29- target_link_libraries (example PUBLIC tinyopt )
33+ target_link_libraries (example PUBLIC tinyopt ) # PULIC when Fetched, INTERFACE otherwise...
34+ target_link_libraries (example PUBLIC Eigen3::Eigen )
Original file line number Diff line number Diff line change @@ -10,9 +10,11 @@ Minimal Tinyopt project
1010set(CMAKE_CXX_STANDARD 20) # Minimum is c++17
1111
1212find_package(Tinyopt)
13+ find_package(Eigen3) # Only needed if Tinyopt is not found locally
1314
1415add_executable(example src/example.cpp)
1516target_link_libraries(example PUBLIC tinyopt)
17+ target_link_libraries(example PUBLIC Eigen3::Eigen) # needed, sometimes...
1618```
1719
1820### Alternative using ` git submodule `
You can’t perform that action at this time.
0 commit comments