Skip to content

Commit 6a28995

Browse files
Revert "remove submodules (replaced with FetchContent)"
This reverts commit 5384e9d.
1 parent 61f94d8 commit 6a28995

File tree

6 files changed

+20
-38
lines changed

6 files changed

+20
-38
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
[submodule "libs/cxxopts"]
2+
path = libs/cxxopts
3+
url = https://github.com/NikolasK-source/cxxopts.git
14
[submodule "libs/libmodbus"]
25
path = libs/libmodbus
36
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

libs/CMakeLists.txt

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,17 @@
22
# ---------------------------------------- subdirectories --------------------------------------------------------------
33
# ======================================================================================================================
44
include(../modbus.cmake)
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)
5+
target_link_libraries(${Target} PRIVATE modbus)
416

427
# ---------------------------------------- link libraries --------------------------------------------------------------
438
# ======================================================================================================================
44-
target_link_libraries(${Target} PRIVATE modbus)
459
target_link_libraries(${Target} PRIVATE rt)
10+
11+
add_subdirectory(cxxopts EXCLUDE_FROM_ALL)
4612
target_link_libraries(${Target} PRIVATE cxxopts)
13+
14+
add_subdirectory(cxxshm EXCLUDE_FROM_ALL)
4715
target_link_libraries(${Target} PRIVATE cxxshm)
16+
17+
add_subdirectory(cxxsemaphore EXCLUDE_FROM_ALL)
4818
target_link_libraries(${Target} PRIVATE cxxsemaphore)

libs/cxxopts

Submodule cxxopts added at c74846a

libs/cxxsemaphore

Submodule cxxsemaphore added at c5aec9e

libs/cxxshm

Submodule cxxshm added at fc145c4

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ int main(int argc, char **argv) {
184184
cxxopts::ParseResult args;
185185
try {
186186
args = options.parse(argc, argv);
187-
} catch (cxxopts::exceptions::exception &e) {
187+
} catch (cxxopts::OptionParseException &e) {
188188
std::cerr << Print_Time::iso << " ERROR: Failed to parse arguments: " << e.what() << ".'\n";
189189
return exit_usage();
190190
}

0 commit comments

Comments
 (0)