File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
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
1919 cmake --build build -j 4
20- linux-build-apk :
20+
21+ linux-build-deb :
2122 runs-on : ubuntu-latest
2223 steps :
2324 - name : Check out repository code
3738
3839 - name : Build Tinyopt-example
3940 run : |-
40- cmake ./ -B build -DBUILD_TINYOPT_TESTS=OFF
41+ cmake ./ -B build
4142 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