Skip to content

Commit 3f712fc

Browse files
committed
Add sometimes needed Eigen link
1 parent 82174b8 commit 3f712fc

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ jobs:
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
@@ -37,5 +38,5 @@ jobs:
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

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ project(tinyopt-example VERSION 0.0.1
77
# Compiler flags
88
set(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
1113
find_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}")
2529
endif()
2630

2731
# Header-only library
2832
add_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)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ Minimal Tinyopt project
1010
set(CMAKE_CXX_STANDARD 20) # Minimum is c++17
1111
1212
find_package(Tinyopt)
13+
find_package(Eigen3) # Only needed if Tinyopt is not found locally
1314
1415
add_executable(example src/example.cpp)
1516
target_link_libraries(example PUBLIC tinyopt)
17+
target_link_libraries(example PUBLIC Eigen3::Eigen) # needed, sometimes...
1618
```
1719

1820
### Alternative using `git submodule`

0 commit comments

Comments
 (0)