Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include all EIPScanner files based on library-path #115

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
052df80
Added build directories to the .gitignore
jan-ati Sep 10, 2024
194da53
Began updating library include paths to use the root directory
jan-ati Sep 10, 2024
3d15fe9
Changed header paths to be the full path from the base directory
jan-ati Sep 11, 2024
044f63f
Updates all include paths to be the full paths to the source of the E…
jan-ati Sep 11, 2024
f24f0f1
Created libraries for all of the submodules and linked them to the pa…
jan-ati Sep 11, 2024
7a437fc
Moved the EIPScanner files to a root EIPScanner directory so that all…
jan-ati Sep 11, 2024
1d29b69
Updated the examples projects to use the full project path
jan-ati Sep 11, 2024
c7a5f77
Updated the paths for the testing files to use the root directory of …
jan-ati Sep 11, 2024
10aa69e
Updated the paths in the testing files to use the full paths of EIPSc…
jan-ati Sep 11, 2024
f7bb13e
Build the examples targets when the option is set
jan-ati Sep 24, 2024
0dbd377
Updated lingering include paths for the EIPScanner/vendor files
jan-ati Sep 25, 2024
32bb5da
Update CMakeLists.txt
jan-ati Sep 26, 2024
bc88252
Added back CMakeLists lines that actually installed the shared librar…
jan-ati Sep 26, 2024
2a5cc4d
Changed the default installation for the header files to only be the …
Sep 26, 2024
450758e
Modified the CMakeLists.txt files to include the sources of every sub…
jan-ati Sep 26, 2024
d2a0c50
Added the teknic vendor sources
jan-ati Sep 27, 2024
9a64903
Merge pull request #2 from ATIinc/EN-426-fix-EIPScanner-include-paths…
jan-ati Oct 2, 2024
b6f4faf
Merge pull request #1 from ATIinc/EN-426-fix-EIPScanner-include-paths
jan-ati Oct 2, 2024
a635b30
Update MessageRouter.cpp
jan-ati Oct 7, 2024
4d96bca
Removed the teknic vendor source files
Oct 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/cmake-*
/build
build/
examples/build/
.idea
docs/build/
docs/source/doxyoutput/
Expand Down
21 changes: 17 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,23 @@ if (WIN32)
endif()
endif()

add_subdirectory(src)
# Setup the include structure so that every file is based off of the root of the project
include_directories(src)

# Actually add the source files for the project
add_subdirectory(src/${CMAKE_PROJECT_NAME})

if (EXAMPLE_ENABLED)
add_subdirectory(examples)
set(EXAMPLES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/examples)

# Create the build directory if it doesn't exist
file(MAKE_DIRECTORY ${EXAMPLES_DIR}/build)

# Run the other CMakeLists.txt file without any dependencies on this file
execute_process(COMMAND ${CMAKE_COMMAND} ${EXAMPLES_DIR} WORKING_DIRECTORY ${EXAMPLES_DIR}/build)

# Execute code during a `cmake --build` command
add_custom_target(EXAMPLES_TARGETS ALL COMMAND ${CMAKE_COMMAND} --build ${EXAMPLES_DIR}/build WORKING_DIRECTORY ${EXAMPLES_DIR}/build COMMENT "Building the examples sub-project")
endif()

if (TEST_ENABLED)
Expand All @@ -38,5 +52,4 @@ endif()

configure_file(EIPScanner.pc.in EIPScanner.pc @ONLY)

install(FILES ${CMAKE_BINARY_DIR}/EIPScanner.pc
DESTINATION lib/pkgconfig)
install(FILES ${CMAKE_BINARY_DIR}/EIPScanner.pc DESTINATION lib/pkgconfig)
2 changes: 1 addition & 1 deletion EIPScanner.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Name: @CMAKE_PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Version: @EIPSCANNER_FULL_VERSION@
Cflags: -I"${includedir}" -I"${includedir}/@CMAKE_PROJECT_NAME@"
Cflags: -I"${includedir}"
Libs: -L"${libdir}" -l@CMAKE_PROJECT_NAME@
20 changes: 12 additions & 8 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
include_directories("${PROJECT_SOURCE_DIR}/src")
cmake_minimum_required(VERSION 3.5)

# Remember to update the LIBRARY_PATH and LD_LIBRARY_PATH environment variables
# * export LIBRARY_PATH=/usr/local/include/
# * export LD_LIBRARY_PATH=/usr/local/lib/

add_executable(explicit_messaging ExplicitMessagingExample.cpp)
target_link_libraries(explicit_messaging EIPScanner)
target_link_libraries(explicit_messaging PUBLIC EIPScanner)

add_executable(file_object_example FileObjectExample.cpp)
target_link_libraries(file_object_example EIPScanner)
target_link_libraries(file_object_example PUBLIC EIPScanner)

add_executable(identity_object_example IdentityObjectExample.cpp)
target_link_libraries(identity_object_example EIPScanner)
target_link_libraries(identity_object_example PUBLIC EIPScanner)

add_executable(implicit_messaging ImplicitMessagingExample.cpp)
target_link_libraries(implicit_messaging EIPScanner)
target_link_libraries(implicit_messaging PUBLIC EIPScanner)

add_executable(parameter_object_example ParameterObjectExample.cpp)
target_link_libraries(parameter_object_example EIPScanner)
target_link_libraries(parameter_object_example PUBLIC EIPScanner)

add_executable(discovery_example DiscoveryManagerExample.cpp)
target_link_libraries(discovery_example EIPScanner)
target_link_libraries(discovery_example PUBLIC EIPScanner)

add_executable(yaskawa_assembly_object_example vendors/yaskawa/mp3300iec/Yaskawa_AssemblyObjectExample.cpp)
target_link_libraries(yaskawa_assembly_object_example EIPScanner)
target_link_libraries(yaskawa_assembly_object_example PUBLIC EIPScanner)

if(WIN32)
target_link_libraries(explicit_messaging ws2_32)
Expand Down
4 changes: 2 additions & 2 deletions examples/DiscoveryManagerExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#define OS_Windows (1)
#endif

#include <DiscoveryManager.h>
#include <utils/Logger.h>
#include <EIPScanner/DiscoveryManager.h>
#include <EIPScanner/utils/Logger.h>

using eipScanner::DiscoveryManager;
using eipScanner::utils::Logger;
Expand Down
12 changes: 6 additions & 6 deletions examples/ExplicitMessagingExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

#include <cstdlib>
#include <sstream>
#include <cip/connectionManager/NetworkConnectionParams.h>
#include "SessionInfo.h"
#include "MessageRouter.h"
#include "ConnectionManager.h"
#include "utils/Logger.h"
#include "utils/Buffer.h"
#include <EIPScanner/cip/connectionManager/NetworkConnectionParams.h>
#include <EIPScanner/SessionInfo.h>
#include <EIPScanner/MessageRouter.h>
#include <EIPScanner/ConnectionManager.h>
#include <EIPScanner/utils/Logger.h>
#include <EIPScanner/utils/Buffer.h>

using namespace eipScanner::cip;
using eipScanner::SessionInfo;
Expand Down
6 changes: 3 additions & 3 deletions examples/FileObjectExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#endif

#include <fstream>
#include "FileObject.h"
#include "utils/Logger.h"
#include "fileObject/FileObjectState.h"
#include <EIPScanner/FileObject.h>
#include <EIPScanner/utils/Logger.h>
#include <EIPScanner/fileObject/FileObjectState.h>

using namespace eipScanner::cip;
using eipScanner::SessionInfo;
Expand Down
4 changes: 2 additions & 2 deletions examples/IdentityObjectExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#define OS_Windows (1)
#endif

#include "IdentityObject.h"
#include "utils/Logger.h"
#include <EIPScanner/IdentityObject.h>
#include <EIPScanner/utils/Logger.h>

using eipScanner::IdentityObject;
using eipScanner::SessionInfo;
Expand Down
10 changes: 5 additions & 5 deletions examples/ImplicitMessagingExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
#endif

#include <sstream>
#include <cip/connectionManager/NetworkConnectionParams.h>
#include "SessionInfo.h"
#include "ConnectionManager.h"
#include "utils/Logger.h"
#include "utils/Buffer.h"
#include <EIPScanner/cip/connectionManager/NetworkConnectionParams.h>
#include <EIPScanner/SessionInfo.h>
#include <EIPScanner/ConnectionManager.h>
#include <EIPScanner/utils/Logger.h>
#include <EIPScanner/utils/Buffer.h>

using namespace eipScanner::cip;
using eipScanner::SessionInfo;
Expand Down
6 changes: 3 additions & 3 deletions examples/ParameterObjectExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#define OS_Windows (1)
#endif

#include "ParameterObject.h"
#include "utils/Logger.h"
#include "utils/Buffer.h"
#include <EIPScanner/ParameterObject.h>
#include <EIPScanner/utils/Logger.h>
#include <EIPScanner/utils/Buffer.h>

using namespace eipScanner::cip;
using eipScanner::SessionInfo;
Expand Down
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Examples

These examples use the installed library.

Therefore the paths are `<EIPScanner/...>` rather than `"EIPScanner/..."`
* * The source files are linked in the `/usr/local/lib` shared object file
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@
#define OS_Windows (1)
#endif

#include "cip/Types.h"
#include <functional>
#include <sstream>
#include <fstream>
#include <cip/connectionManager/NetworkConnectionParams.h>
#include "ConnectionManager.h"
#include <DiscoveryManager.h>
#include "FileObject.h"
#include "fileObject/FileObjectState.h"
#include "IdentityObject.h"
#include "IOConnection.h"
#include "ParameterObject.h"
#include "SessionInfo.h"
#include "utils/Logger.h"
#include "utils/Buffer.h"

#include "vendor/yaskawa/mp3300iec/Yaskawa_EPath.h"
#include "vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h"
#include "vendor/yaskawa/mp3300iec/Yaskawa_MessageRouterRequest.h"
#include <EIPScanner/cip/connectionManager/NetworkConnectionParams.h>
#include <EIPScanner/ConnectionManager.h>
#include <EIPScanner/DiscoveryManager.h>

#include <EIPScanner/cip/Types.h>
#include <EIPScanner/FileObject.h>
#include <EIPScanner/fileObject/FileObjectState.h>
#include <EIPScanner/IdentityObject.h>
#include <EIPScanner/IOConnection.h>
#include <EIPScanner/ParameterObject.h>
#include <EIPScanner/SessionInfo.h>
#include <EIPScanner/utils/Logger.h>
#include <EIPScanner/utils/Buffer.h>

#include <EIPScanner/vendor/yaskawa/mp3300iec/Yaskawa_EPath.h>
#include <EIPScanner/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouter.h>
#include <EIPScanner/vendor/yaskawa/mp3300iec/Yaskawa_MessageRouterRequest.h>

using namespace eipScanner::cip;
using eipScanner::ConnectionManager;
Expand Down
75 changes: 0 additions & 75 deletions src/CMakeLists.txt

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion src/BaseObject.h → src/EIPScanner/BaseObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef EIPSCANNER_BASEOBJECT_H
#define EIPSCANNER_BASEOBJECT_H

#include "cip/Types.h"
#include "EIPScanner/cip/Types.h"

namespace eipScanner {
/**
Expand Down
51 changes: 51 additions & 0 deletions src/EIPScanner/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Add library target for common source files
set(SOURCE_FILES
BaseObject.cpp
ConnectionManager.cpp
DiscoveryManager.cpp
FileObject.cpp
IdentityObject.cpp
IOConnection.cpp
MessageRouter.cpp
ParameterObject.cpp
SessionInfo.cpp)

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


add_subdirectory(cip)
add_subdirectory(eip)
add_subdirectory(fileObject)
add_subdirectory(sockets)
add_subdirectory(utils)


# if vendor scripts are enabled
if(ENABLE_VENDOR_SRC)
add_subdirectory(vendor/ra)
add_subdirectory(vendor/yaskawa)
endif()


if(WIN32)
target_link_libraries(EIPScanner ws2_32)
target_link_libraries(EIPScannerS ws2_32)
endif()


set_target_properties(
EIPScanner
PROPERTIES
VERSION ${EIPSCANNER_FULL_VERSION}
SOVERSION ${EIPSCANNER_MAJOR_VERSION})

install(TARGETS EIPScanner EIPScannerS
LIBRARY
DESTINATION lib
ARCHIVE
DESTINATION lib)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/
DESTINATION include
FILES_MATCHING PATTERN "*.h*")
20 changes: 10 additions & 10 deletions src/ConnectionManager.cpp → src/EIPScanner/ConnectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
#include <cstdlib>
#include <random>

#include "ConnectionManager.h"
#include "eip/CommonPacket.h"
#include "cip/connectionManager/ForwardOpenRequest.h"
#include "cip/connectionManager/ForwardCloseRequest.h"
#include "cip/connectionManager/LargeForwardOpenRequest.h"
#include "cip/connectionManager/ForwardOpenResponse.h"
#include "cip/connectionManager/NetworkConnectionParams.h"
#include "cip/connectionManager/NetworkConnectionParametersBuilder.h"
#include "utils/Logger.h"
#include "utils/Buffer.h"
#include "EIPScanner/ConnectionManager.h"
#include "EIPScanner/eip/CommonPacket.h"
#include "EIPScanner/cip/connectionManager/ForwardOpenRequest.h"
#include "EIPScanner/cip/connectionManager/ForwardCloseRequest.h"
#include "EIPScanner/cip/connectionManager/LargeForwardOpenRequest.h"
#include "EIPScanner/cip/connectionManager/ForwardOpenResponse.h"
#include "EIPScanner/cip/connectionManager/NetworkConnectionParams.h"
#include "EIPScanner/cip/connectionManager/NetworkConnectionParametersBuilder.h"
#include "EIPScanner/utils/Logger.h"
#include "EIPScanner/utils/Buffer.h"

namespace eipScanner {
using namespace cip::connectionManager;
Expand Down
Loading