File tree Expand file tree Collapse file tree 6 files changed +38
-20
lines changed
Expand file tree Collapse file tree 6 files changed +38
-20
lines changed Original file line number Diff line number Diff line change 1- [submodule "libs/cxxopts "]
2- path = libs/cxxopts
3- url = https://github.com/NikolasK-source/cxxopts.git
41[submodule "libs/libmodbus "]
52 path = libs/libmodbus
63 url = https://github.com/stephane/libmodbus
7- [submodule "libs/cxxshm "]
8- path = libs/cxxshm
9- url = https://github.com/NikolasK-source/cxxshm.git
10- [submodule "libs/cxxsemaphore "]
11- path = libs/cxxsemaphore
12- url = https://github.com/NikolasK-source/cxxsemaphore.git
Original file line number Diff line number Diff line change 22# ---------------------------------------- subdirectories --------------------------------------------------------------
33# ======================================================================================================================
44include (../modbus.cmake)
5- target_link_libraries (${Target} PRIVATE modbus)
5+
6+
7+ # ---------------------------------------- fetch content ---------------------------------------------------------------
8+ # ======================================================================================================================
9+ include (FetchContent)
10+
11+ # cxxopts (jarro2783)
12+ FetchContent_Declare(
13+ cxxopts
14+ GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
15+ GIT_TAG v3.2.0
16+ EXCLUDE_FROM_ALL
17+ )
18+
19+ set (CXXOPTS_STANDALONE_PROJECT ON CACHE BOOL "" FORCE)
20+ FetchContent_MakeAvailable(cxxopts)
21+
22+ # cxxshm
23+ FetchContent_Declare(
24+ cxxshm
25+ GIT_REPOSITORY https://github.com/NikolasK-source /cxxshm.git
26+ GIT_TAG v1.1.0
27+ EXCLUDE_FROM_ALL
28+ )
29+
30+ FetchContent_MakeAvailable(cxxshm)
31+
32+ # cxxsemaphore
33+ FetchContent_Declare(
34+ cxxsemaphore
35+ GIT_REPOSITORY https://github.com/NikolasK-source /cxxsemaphore.git
36+ GIT_TAG v1.0.1
37+ EXCLUDE_FROM_ALL
38+ )
39+
40+ FetchContent_MakeAvailable(cxxsemaphore)
641
742# ---------------------------------------- link libraries --------------------------------------------------------------
843# ======================================================================================================================
44+ target_link_libraries (${Target} PRIVATE modbus)
945target_link_libraries (${Target} PRIVATE rt)
10-
11- add_subdirectory (cxxopts EXCLUDE_FROM_ALL )
1246target_link_libraries (${Target} PRIVATE cxxopts)
13-
14- add_subdirectory (cxxshm EXCLUDE_FROM_ALL )
1547target_link_libraries (${Target} PRIVATE cxxshm)
16-
17- add_subdirectory (cxxsemaphore EXCLUDE_FROM_ALL )
1848target_link_libraries (${Target} PRIVATE cxxsemaphore)
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ int main(int argc, char **argv) {
183183 cxxopts::ParseResult args;
184184 try {
185185 args = options.parse (argc, argv);
186- } catch (cxxopts::OptionParseException &e) {
186+ } catch (cxxopts::exceptions::exception &e) {
187187 std::cerr << Print_Time::iso << " ERROR: Failed to parse arguments: " << e.what () << ' .' << std::endl;
188188 return exit_usage ();
189189 }
You can’t perform that action at this time.
0 commit comments