Skip to content

Commit

Permalink
Merge pull request #44 from nimbuscontrols/separate-vendor
Browse files Browse the repository at this point in the history
separate vendor source files
  • Loading branch information
jadamroth authored Feb 16, 2021
2 parents b8a7ece + 68f1ccc commit b55b040
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(EIPSCANNER_FULL_VERSION ${EIPSCANNER_MAJOR_VERSION}.${EIPSCANNER_MINOR_VERSI
project(EIPScanner VERSION ${EIPSCANNER_FULL_VERSION})

set(CMAKE_CXX_STANDARD 14)
option(ENABLE_VENDOR_SRC "Enable vendor source" ON)
option(TEST_ENABLED "Enable unit test" OFF)
option(EXAMPLE_ENABLED "Build examples" OFF)

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ We welcome outside contributions for any improvements, features, or new devices

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/.

All vendor source files are automatically enabled. If you'd like to disable vendor files, you can disable with any of the below options.
1) set this option in CMakeLists.txt
```cmake
option(ENABLE_VENDOR_SRC "Enable vendor source" OFF)
```
2) set the cmake build flag
```shell
-DENABLE_VENDOR_SRC=OFF
```
3) manually comment needed files in src/vendor/CMakeLists.txt

## Authors

Aleksey Timin
Expand Down
17 changes: 7 additions & 10 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ set(SOURCE_FILES
utils/Logger.cpp
utils/Buffer.cpp

vendor/ra/powerFlex525/DPIFaultManager.cpp
vendor/ra/powerFlex525/DPIFaultObject.cpp
vendor/ra/powerFlex525/DPIFaultCode.cpp
vendor/ra/powerFlex525/DPIFaultParameter.cpp
vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouterRequest.cpp

BaseObject.cpp
ConnectionManager.cpp
DiscoveryManager.cpp
Expand All @@ -52,8 +44,13 @@ set(SOURCE_FILES
ParameterObject.cpp
SessionInfo.cpp)

add_library(EIPScanner SHARED ${SOURCE_FILES})
add_library(EIPScannerS STATIC ${SOURCE_FILES})
# if vendor scripts are enabled
if(ENABLE_VENDOR_SRC)
add_subdirectory(vendor)
endif()

add_library(EIPScanner SHARED ${SOURCE_FILES} ${VENDOR_FILES})
add_library(EIPScannerS STATIC ${SOURCE_FILES} ${VENDOR_FILES})

if(WIN32)
target_link_libraries(EIPScanner ws2_32)
Expand Down
17 changes: 17 additions & 0 deletions src/vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
include_directories(ra/powerFlex525)
include_directories(yaskawa/mp3300iec)

set( VENDOR_FILES
# ra
vendor/ra/powerFlex525/DPIFaultManager.cpp
vendor/ra/powerFlex525/DPIFaultObject.cpp
vendor/ra/powerFlex525/DPIFaultCode.cpp
vendor/ra/powerFlex525/DPIFaultParameter.cpp

# yaskawa
vendor/yaskawa/mp3300iec/Yaskawa_EPath.cpp
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.cpp
vendor/yaskawa/mp3300iec/Yaskawa_MessageRouterRequest.cpp

PARENT_SCOPE
)

0 comments on commit b55b040

Please sign in to comment.