Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
f006f14
Refactored source files to mtconnect subdirectory
wsobel Dec 24, 2022
a301cdf
Packing changes to support conan and plugin development
wsobel Dec 24, 2022
50dd4f0
Added hooks for agent initialization, start, and stop
wsobel Dec 24, 2022
ebd08da
Added extra hooks for plugin dev
wsobel Dec 27, 2022
9c29b45
First cut at shared lib version of agent
wsobel Dec 28, 2022
223b444
Added default visibility to inline methods with static local vars.
wsobel Dec 28, 2022
50303fb
Formated with clang format
wsobel Dec 28, 2022
246dac2
Made boost static link to agent_lib. Now only have single dylib depend
wsobel Dec 28, 2022
5c2f56f
Added config with exports
wsobel Dec 29, 2022
0367e74
Exported all classes
wsobel Dec 29, 2022
091d4ea
First cut at windows port using shared libraries for agent lib
wsobel Dec 30, 2022
33287ad
Fixed shared lib settings
wsobel Dec 30, 2022
6572951
Made test util methods inline to remove multiple defined symbol issues
wsobel Dec 30, 2022
23591a3
Formatted
wsobel Dec 30, 2022
c61e797
merged changes from format
wsobel Dec 30, 2022
6dec8ee
added main to tests for shared windows
wsobel Dec 31, 2022
30949e8
Windows porting issues with strands when crossing dll boundry in tests
wsobel Dec 31, 2022
b661230
Fixed xml text to trim using boost
wsobel Dec 31, 2022
9b6b70f
package the lib files for windows.
wsobel Dec 31, 2022
ac6a6fb
set BOOST_ALL_DYN_LINK only for MSVC
simonyg Dec 31, 2022
26ad3a5
BOOST_ALL_DYN_LINK only for Windows
simonyg Dec 31, 2022
ddb7236
Merged
wsobel Jan 3, 2023
92563a2
Windows LNK2005 issue
simonyg Jan 3, 2023
b223896
Merge branch 'conan_package_for_plugins' of github.com:/mtconnect/cpp…
simonyg Jan 3, 2023
c1519a5
undo last changes
simonyg Jan 4, 2023
66c1427
added windows validation
wsobel Jan 5, 2023
4a7c386
refactored to use new hook manager
wsobel Jan 5, 2023
d663eb2
Version 2.0.0.12
wsobel Nov 17, 2022
591fa2d
Start clean ssessions with broker
wsobel Dec 21, 2022
60ec094
Added asset relationship to device model
wsobel Jan 5, 2023
629b2c6
merged in changes for asset relationship
wsobel Jan 11, 2023
93cb89c
Merged changes from master
wsobel Jan 13, 2023
9698b65
Added winver to conan package
wsobel Jan 14, 2023
9ae9ac9
Ported changed to windows
wsobel Jan 14, 2023
dcc799f
add dlls to installation of shared package
wsobel Jan 14, 2023
5b56084
added winver as a setting
wsobel Jan 15, 2023
8baed8e
Some changes for xp port
wsobel Jan 16, 2023
cd10cc9
Reverted back value types, causes issues when using in variant.
wsobel Jan 16, 2023
c40ce68
refactored to the timstamped entity to the timestamp extractor
wsobel Jan 23, 2023
030e168
Merge branch 'master' into conan_package_for_plugins
wsobel Jan 26, 2023
6e69cbd
Formatted code w/ clangformat
wsobel Jan 26, 2023
a56c263
Added shared matrix build
wsobel Jan 26, 2023
0b54ee3
Updated linux compiler for appveyor to gcc 11
wsobel Jan 26, 2023
1c1bbe2
sudo for apt install
wsobel Jan 26, 2023
34aa686
Added -y for install and python3
wsobel Jan 26, 2023
f2c5c17
Added shared profiles for VC builds
wsobel Jan 26, 2023
207b744
Debug appveyor
wsobel Jan 26, 2023
d6e3f6c
Debug appveyor for windows
wsobel Jan 26, 2023
15bc7b6
bind server ip for agent to 127.0.0.1
wsobel Jan 27, 2023
ac1fab2
Added run_for to let agent fully stop
wsobel Jan 27, 2023
c8653c5
Build macos first
wsobel Jan 27, 2023
eec2353
Made called static
wsobel Jan 27, 2023
5fc64a0
Fixed streaming sample race with service destruction.
wsobel Jan 27, 2023
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
28 changes: 16 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set(AGENT_VERSION_MAJOR 2)
set(AGENT_VERSION_MINOR 1)
set(AGENT_VERSION_PATCH 0)
set(AGENT_VERSION_BUILD 3)
set(AGENT_VERSION_RC "_RC2")
set(AGENT_VERSION_BUILD 2)
set(AGENT_VERSION_RC "_RC1")

# This minimum version is to support Visual Studio 2017 and C++ feature checking and FetchContent
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
Expand All @@ -15,6 +15,7 @@ if(POLICY CMP0077)
endif()

option(AGENT_ENABLE_UNITTESTS "Enables the agent's unit tests" ON)
option(SHARED_AGENT_LIB "Generate shared agent library. Conan options: shared" OFF)
set(INSTALL_GTEST OFF FORCE)

project(cppagent LANGUAGES C CXX)
Expand All @@ -24,9 +25,9 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CXX_COMPILE_FEATURES cxx_std_17)
set(SHARED_AGENT_LIB OFF CACHE BOOL "Build Agent Lib as shared library")

set(WITH_PYTHON OFF CACHE STRING "With Python Support")
set(WITH_RUBY OFF CACHE STRING "With Ruby Support")
set(WITH_RUBY ON CACHE STRING "With Ruby Support")

# By default only generate 2 configurations (Debug and Release) for simplicity.
# The user can change this option if required for the additional ones such as 'RelWithDebInfo'.
Expand Down Expand Up @@ -64,7 +65,11 @@ if(MSVC)
endif()

if (UNIX)
add_compile_options(-fPIC -Wno-psabi -fvisibility-inlines-hidden -fvisibility=hidden)
if (SHARED_AGENT_LIB)
add_compile_options(-fPIC -Wno-psabi -fvisibility-inlines-hidden)
else()
add_compile_options(-fPIC -Wno-psabi -fvisibility-inlines-hidden -fvisibility=hidden)
endif()
ENDIF()

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
Expand All @@ -73,17 +78,16 @@ if (CONAN_USER_MRUBY_mruby)
set(WITH_RUBY ON FORCE)
endif()

conan_basic_setup(TARGETS)
conan_basic_setup(KEEP_RPATHS TARGETS)

if(WITH_PYTHON)
set(Python_USE_STATIC_LIBS ON)
if(SHARED_AGENT_LIB)
set(CMAKE_BUILD_RPATH "@load_path/;@executable_path/;@load_path/../lib;@executable_path/../lib")

find_package(Python3 COMPONENTS Interpreter Development Development.Embed)
message("Include dirs of Python: " ${Python3_INCLUDE_DIRS} )
message("Libs of Python: " ${Python3_LIBRARIES} )
if (MSVC)
include(InstallRequiredSystemLibraries)
endif()
endif()

include(cmake/msvc_use_static_runtime.cmake)
include(cmake/osx_no_app_or_frameworks.cmake)
include(cmake/ClangFormat.cmake)
include(cmake/ClangTidy.cmake)
Expand Down
16 changes: 11 additions & 5 deletions agent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ if(WIN32)
# Version info
string(TIMESTAMP AGENT_VERSION_TIME "%Y-%m-%dT%H:%M:%SZ" UTC)
set(RESOURCE_FILE "${PROJECT_BINARY_DIR}/agent/version.rc")
configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.rc.in" "${RESOURCE_FILE}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/mtconnect/version.rc.in" "${RESOURCE_FILE}")
list(APPEND AGENT_SOURCES "${RESOURCE_FILE}")
endif()

add_executable(agent ${AGENT_SOURCES})

set_property(TARGET agent PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

if(WITH_PYTHON)
target_compile_definitions(
agent
Expand All @@ -36,11 +33,20 @@ endif()

target_link_libraries(
agent
PRIVATE
PUBLIC
agent_lib
$<$<PLATFORM_ID:Windows>:shlwapi>
)

target_clangtidy_setup(agent_lib)

install(TARGETS agent RUNTIME DESTINATION bin)


if(SHARED_AGENT_LIB AND MSVC)
set(CMAKE_INSTALL_DEBUG_LIBRARIES ON)
include(InstallRequiredSystemLibraries)
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT Libraries)
install(DIRECTORY "${PROJECT_BINARY_DIR}/bin/" DESTINATION bin COMPONENT Libraries
FILES_MATCHING PATTERN "*.dll")
endif()
8 changes: 4 additions & 4 deletions agent/cppagent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
//

#include <boost/asio.hpp>
#include "agent.hpp"
#include "configuration/agent_config.hpp"
#include "mtconnect/agent.hpp"
#include "mtconnect/configuration/agent_config.hpp"

#include "fcntl.h"
#include "sys/stat.h"
#include <fcntl.h>
#include <sys/stat.h>

#include <cstring>

Expand Down
Loading