Skip to content

Commit dccbf01

Browse files
authored
Adding FetchContent for everest-cmake (#85)
* Added fetch_content for everest-cmake. If no everest-cmake is found, everest-cmake will be download via fetch_content * Updating README.md: One sentence to everest-cmake and fetch content and adding one block describing which dependencies should be installed Signed-off-by: Sebastian Lukas <sebastian.lukas@pionix.de>
1 parent 78a54ca commit dccbf01

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

CMakeLists.txt

+14-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@ project(iso15118
66
LANGUAGES CXX C
77
)
88

9-
find_package(everest-cmake 0.1 REQUIRED
9+
find_package(everest-cmake 0.5
1010
PATHS ../everest-cmake
1111
)
1212

1313
find_package(OpenSSL 3 REQUIRED)
1414

15+
if (NOT everest-cmake_FOUND)
16+
message(STATUS "Retrieving everest-cmake using FetchContent")
17+
include(FetchContent)
18+
FetchContent_Declare(
19+
everest-cmake
20+
GIT_REPOSITORY https://github.com/EVerest/everest-cmake.git
21+
GIT_TAG v0.5.0
22+
)
23+
FetchContent_MakeAvailable(everest-cmake)
24+
set(everest-cmake_DIR "${everest-cmake_SOURCE_DIR}")
25+
include("${everest-cmake_SOURCE_DIR}/everest-cmake-config.cmake")
26+
endif()
27+
1528
# options
1629
option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF)
1730
option(BUILD_TESTING "Build unit tests, used if standalone project" OFF)

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,23 @@ ISO15118 support is distributed accross multiple repositories and modules in EVe
4646
Dependencies
4747
------------
4848

49-
To build this library you need [everest-cmake](https://github.com/EVerest/everest-cmake) checkout in the same directory as libiso15118.
49+
To build this library you need [everest-cmake](https://github.com/EVerest/everest-cmake) checkout in the same directory as libiso15118. If no `everest-cmake` is available, it is retrieved via FetchContent.
50+
51+
For Debian GNU/Linux 12 you will need the following dependencies:
52+
53+
```bash
54+
sudo apt update
55+
sudo apt install build-essential cmake libssl-dev
56+
```
57+
58+
For Fedora 41+ you will need the following dependencies:
59+
60+
```bash
61+
sudo dnf update
62+
sudo dnf install gcc gcc-c++ git make cmake openssl-devel
63+
```
64+
65+
OpenSSL version 3.0 or above is required. The build system `ninja` is optional.
5066

5167
Getting started
5268
---------------

0 commit comments

Comments
 (0)