Skip to content

Commit b55b040

Browse files
authored
Merge pull request #44 from nimbuscontrols/separate-vendor
separate vendor source files
2 parents b8a7ece + 68f1ccc commit b55b040

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(EIPSCANNER_FULL_VERSION ${EIPSCANNER_MAJOR_VERSION}.${EIPSCANNER_MINOR_VERSI
88
project(EIPScanner VERSION ${EIPSCANNER_FULL_VERSION})
99

1010
set(CMAKE_CXX_STANDARD 14)
11+
option(ENABLE_VENDOR_SRC "Enable vendor source" ON)
1112
option(TEST_ENABLED "Enable unit test" OFF)
1213
option(EXAMPLE_ENABLED "Build examples" OFF)
1314

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@ We welcome outside contributions for any improvements, features, or new devices
4949

5050
Our goal is to maintain an active device catalog of all EtherNet/IP devices and their objects that we encounter. We encourage others to contribute to this communal device catalog in /src/vendor/.
5151

52+
All vendor source files are automatically enabled. If you'd like to disable vendor files, you can disable with any of the below options.
53+
1) set this option in CMakeLists.txt
54+
```cmake
55+
option(ENABLE_VENDOR_SRC "Enable vendor source" OFF)
56+
```
57+
2) set the cmake build flag
58+
```shell
59+
-DENABLE_VENDOR_SRC=OFF
60+
```
61+
3) manually comment needed files in src/vendor/CMakeLists.txt
62+
5263
## Authors
5364

5465
Aleksey Timin

src/CMakeLists.txt

+7-10
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,6 @@ set(SOURCE_FILES
3434
utils/Logger.cpp
3535
utils/Buffer.cpp
3636

37-
vendor/ra/powerFlex525/DPIFaultManager.cpp
38-
vendor/ra/powerFlex525/DPIFaultObject.cpp
39-
vendor/ra/powerFlex525/DPIFaultCode.cpp
40-
vendor/ra/powerFlex525/DPIFaultParameter.cpp
41-
vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp
42-
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp
43-
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouterRequest.cpp
44-
4537
BaseObject.cpp
4638
ConnectionManager.cpp
4739
DiscoveryManager.cpp
@@ -52,8 +44,13 @@ set(SOURCE_FILES
5244
ParameterObject.cpp
5345
SessionInfo.cpp)
5446

55-
add_library(EIPScanner SHARED ${SOURCE_FILES})
56-
add_library(EIPScannerS STATIC ${SOURCE_FILES})
47+
# if vendor scripts are enabled
48+
if(ENABLE_VENDOR_SRC)
49+
add_subdirectory(vendor)
50+
endif()
51+
52+
add_library(EIPScanner SHARED ${SOURCE_FILES} ${VENDOR_FILES})
53+
add_library(EIPScannerS STATIC ${SOURCE_FILES} ${VENDOR_FILES})
5754

5855
if(WIN32)
5956
target_link_libraries(EIPScanner ws2_32)

src/vendor/CMakeLists.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
include_directories(ra/powerFlex525)
2+
include_directories(yaskawa/mp3300iec)
3+
4+
set( VENDOR_FILES
5+
# ra
6+
vendor/ra/powerFlex525/DPIFaultManager.cpp
7+
vendor/ra/powerFlex525/DPIFaultObject.cpp
8+
vendor/ra/powerFlex525/DPIFaultCode.cpp
9+
vendor/ra/powerFlex525/DPIFaultParameter.cpp
10+
11+
# yaskawa
12+
vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp
13+
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp
14+
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouterRequest.cpp
15+
16+
PARENT_SCOPE
17+
)

0 commit comments

Comments
 (0)