The code.ill.fr has been recreated and upgraded with the latest version this weekend, If you encounter any problem please inform the Helpdesk.

Commit 46e44691 authored by Shervin Nourbakhsh's avatar Shervin Nourbakhsh
Browse files

Squashed 'cameo-api-cpp/' changes from 22a0c63b..8e5c618

8e5c618  - API version number set by CMake in cameo.h header file taking it from the project version set in CMakeLists.txt  - add Threads as public dependency  - CPack generating DEB packages  - split installation into components to create separate .deb packages with cpack  - the dynamic library is set to be installed  - the static library is also produced but not installed, it can only be used setting the build tree in the CMAKE_PREFIX_PATH of another project    This is done in order to embed the C++ API library into the python .so  - Improved README documentation about how to compile and install
0413d88 Instance::getOutputStreamSocket() now returns a unique_ptr<OutputStreamSocket>
cac464d Implemented OutputStreamSocket::receive() with optional Output result
4d60ff2 Merge commit 'ee5177b7'
ee5177b7 define default timeout as constexpr
a687b5a9 target compile features c++17
83244bce Merge branch 'main_master' into cpp_master
c231c54 dependencies in README
90aacda5 (split) dependencies in README
15263d86 Merge branch 'main_master' into cpp_master
4bfa20d1 dependencies in README
34ee2e8 Implemented Instance::getResult() with optional string result
2854efba (split) Implemented Instance::getResult() with optional string result
482b7b4 Implemented subscriber and requester with optional string result in receive() function
ce1e1776 (split) Implemented subscriber and requester with optional string result in receive() function
83a7429 Removed Option enum and defined OUTPUSTREAM as const int, added Instance::waitFor() and Instance::waitFor(int) for python binding
7c0d1ce5 (split) Removed Option enum and defined OUTPUSTREAM as const int, added Instance::waitFor() and Instance::waitFor(int) for python binding
2f86220a (split) Implemented InstanceArray as vector<unique_ptr<Instance>>
5586d41 Implemented InstanceArray as vector<unique_ptr<Instance>>
5abebb37 (split) (split) clang-format
b53d461 (split) clang-format
b32ea7e2 (split) Fixed Rapidjson download from GIT if not installed in the system
4073644 Fixed Rapidjson download from GIT if not installed in the system
330d7e63 (split) removed non-public headers from include
9987d44 removed non-public headers from include
ad01dd17 (split) Added documentation in Doxygen form
c46c2fe Added documentation in Doxygen form
fbc3fccc (split) Extract all doxygen
f36767c Extract all doxygen
e2d36f0f (split) Doctest header and as external project commented
8803083 Doctest header and as external project commented
47e7ba3c (split) Changelog
fd4440a Changelog
2116a68c (split) In Server constructor, moved retrieval of server version in try/catch to avoid exception when there is a timeout
262b684 In Server constructor, moved retrieval of server version in try/catch to avoid exception when there is a timeout
064e19ed (split) Changed version to 1.0.1 for C++ API
c7688c5 Changed version to 1.0.1 for C++ API
cdc2a348 (split) Some minor changes for Visual Studio 19
b144ebb Some minor changes for Visual Studio 19
7188c0d4 (split) Changed macros for version 1.0.0 in C++ API
1e80774 Changed macros for version 1.0.0 in C++ API
33226efc (split) Added operator== for Endpoint
3ec46f9 Added operator== for Endpoint
afb2a09b (split) Changelog
981153f Changelog
1f6d11d2 (split) Stopping time is only used when a stop handler is defined (by This handleStop() or executable, if passed in handleStop() it overrides the server value
7266387 Stopping time is only used when a stop handler is defined (by This handleStop() or executable, if passed in handleStop() it overrides the server value
c5eed0ac (split) Better exit with exception when an unmanaged C++ application is called with a bad info argument
1eda4d0 Better exit with exception when an unmanaged C++ application is called with a bad info argument
9ef053dd (split) Added This init with name and endpoint to facilitate unmanaged applications
f245d18 Added This init with name and endpoint to facilitate unmanaged applications
6238bc83 (split) Major case for first letter of exception messages
9d6b576 Major case for first letter of exception messages
de43a3bf (split) Corrected bug with stop handler: a call to the request socket was made into the stopping thread, that could be concurrent with other calls to the request socket
d8437cf Corrected bug with stop handler: a call to the request socket was made into the stopping thread, that could be concurrent with other calls to the request socket
80694629 (split) Changelogs
c8b3619 Changelogs
99d09eeb (split) Removed reference in a string return
85824d4 Removed reference in a string return
bd11b48c (split) Removed getStatusEndpoint from Instance
95fe834 Removed getStatusEndpoint from Instance
a3cb49fe (split) Removed some outputs
8f43036 Removed some outputs
3416699b (split) Starter info is used
93c062f Starter info is used
2324f6f4 (split) Comment on variable use
207f0ab Comment on variable use
0134ec44 (split) Removal of the url member in API classes and its consequences
a98d474 Removal of the url member in API classes and its consequences
5b6d5c01 (split) Removed port member from services classes
bb245de Removed port member from services classes
8853fa53 (split) Replaced string endpoint by Endpoint into the API services classes
ceb786c Replaced string endpoint by Endpoint into the API services classes
f1cc3517 (split) First step in json argument info
9143863 First step in json argument info
08b86819 (split) Removed optional use
7a9af8b Removed optional use
797008cd (split) Re-added some strings classes to prepare JSON argument info
7eb6fc6 Re-added some strings classes to prepare JSON argument info
9fad2883 (split) Re-added tcp:// in Endpoint
b9d5785 Re-added tcp:// in Endpoint
c49ff939 (split) Removed Some strings classes and preparing to JSON argument info
33164b2 Removed Some strings classes and preparing to JSON argument info
3f5fe061 (split) Switched to C++17
1df00cc Switched to C++17
49d854c2 (split) Finished tests for C++ Strings classes
b4c3a70 Finished tests for C++ Strings classes
4e686cd5 (split) Added strings classes in C++
f759ab9 Added strings classes in C++
b525fbd1 (split) Added test in cmake
288ea00 Added test in cmake
7a7d5a79 (split) Renamed Port application names
8bb2334 Renamed Port application names
3bec52f5 (split) Implemented ports request in APIs
b1a3e33 Implemented ports request in APIs
5b4a4ec8 (split) Changelog
5fd792e Changelog
c1e104a6 (split) Added port requests to the Com classes
6d99fb1 Added port requests to the Com classes
895e4d18 (split) Defined the Com class for Communication operations manager
72e5647 Defined the Com class for Communication operations manager
186976ca (split) Added test on value of output stream socket pointer in APIs
06165a7 Added test on value of output stream socket pointer in APIs
5fc163c0 (split) Renamed ListResponse into ApplicationConfigListResponse
973535b Renamed ListResponse into ApplicationConfigListResponse
680aa694 (split) Cameo server implemented new port requests
e92c90a Cameo server implemented new port requests
2837749f (split) Renamed requests (added suffix v0) that will become useless
92b7b25 Renamed requests (added suffix v0) that will become useless
8382ece9 (split) Changelogs
ca75fcb Changelogs
e6aac357 (split) Corrected subscription of KEYVALUE for the event subscribers
542d82c Corrected subscription of KEYVALUE for the event subscribers
9b2bf21b (split) Implemented waitFor() with KeyValue in Instance
cbe95b7 Implemented waitFor() with KeyValue in Instance
d7af35f2 (split) Simplified storage events into one single KeyEvent (server and APIs)
9088ad1 Simplified storage events into one single KeyEvent (server and APIs)
5d7fa164 (split) The cameo server sends the value in the remove key event
6a092a4 The cameo server sends the value in the remove key event
d5472078 (split) Reviewed public interface of waitFor
a61f343 Reviewed public interface of waitFor
bb2f5af5 (split) The cameo server sends the key value events and they are dispatched in the APIs
bcd247e The cameo server sends the key value events and they are dispatched in the APIs
2cc56d70 (split) Implemented sync stream
0156eca Implemented sync stream
d21184dc (split) Added SYNC_STREAM message type
2df2d34 Added SYNC_STREAM message type
51f37ae9 (split) Added connect with id request in cameo server and added the corresponding connect() in Server class
39007fa Added connect with id request in cameo server and added the corresponding connect() in Server class
48f37a3c (split) Replaced stdint.h by cstdint in JSON.h
37e202a Replaced stdint.h by cstdint in JSON.h
4ef77cd6 (split) Enabled multiple=yes and stream=yes
6b2efe6 Enabled multiple=yes and stream=yes
1717f6fb (split) Added getExitCode() in Instance, the server sends the status with the exit code
6d29c5a Added getExitCode() in Instance, the server sends the status with the exit code
77a8a9f2 (split) Status messages have exitCode when the process has terminated
6acf2b9 Status messages have exitCode when the process has terminated
7f923e4a (split) Changelog
1e55aa3 Changelog
1a97832a (split) Reimplemented getActualState() in Instance by calling request to GET_STATUS. Added getPastStates() in Instance
da2c7d0 Reimplemented getActualState() in Instance by calling request to GET_STATUS. Added getPastStates() in Instance
8db7a51b (split) Name correction
19b3047 Name correction
6732c381 (split) Renamed ALL_AVAILABLE into LIST
d1ae314 Renamed ALL_AVAILABLE into LIST
988c6d84 (split) Renamed OUTPUT to OUTPUT_PORT and OUTPUT_WITH_ID to OUTPUT_PORT_WITH_ID
b956a0c Renamed OUTPUT to OUTPUT_PORT and OUTPUT_WITH_ID to OUTPUT_PORT_WITH_ID
2eff23fc (split) Renamed SEND_PARAMETERS into WRITE_INPUT
e50b29d Renamed SEND_PARAMETERS into WRITE_INPUT
5870a8ca (split) Renamed SHOW into OUTPUT_WITH_ID
05036bf Renamed SHOW into OUTPUT_WITH_ID
3901d720 (split) Renamed SHOW_ALL into APPS
17ce9fb Renamed SHOW_ALL into APPS

git-subtree-dir: cameo-api-cpp
git-subtree-split: 8e5c61879c3ceb0bb1177fd2e2edd4d5bf6223b8
parent 22a0c63b
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: ForIndentation
BreakBeforeBraces: Linux
#UseTab: UT_AlignWithSpaces # available in release later than 9
UseTab: ForContinuationAndIndentation
BreakBeforeBraces: Custom
BraceWrapping:
AfterNamespace: false
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
ColumnLimit: 110
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AccessModifierOffset: 0
NamespaceIndentation: Inner
\ No newline at end of file
AlignConsecutiveDeclarations: false
AlignTrailingComments: true
AccessModifierOffset: -8 # It has to be equal to the tab size
NamespaceIndentation: None
PointerAlignment: Left
AlwaysBreakAfterReturnType: None
SortIncludes: false
This diff is collapsed.
......@@ -7,3 +7,4 @@
/Makefile.in
/.settings/
/Debug/
build/
\ No newline at end of file
if(NOT DEFINED PROJECT_NAME)
cmake_minimum_required(VERSION 3.7.2)
# Project name and version
project(cameo VERSION 1.0.0 LANGUAGES CXX)
endif()
cmake_minimum_required(VERSION 3.12.0)
project(cameo-api-cpp
VERSION 1.1.0
LANGUAGES CXX
HOMEPAGE_URL "https://code.ill.fr/cameo/cameo"
)
#--------------- Helpers
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(FetchContent)
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS True)
endif()
# name of the target library
set(LIBNAME ${PROJECT_NAME})
set(NAMESPACE Cameo)
set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/cameo/api)
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake)
set(component_runtime CAMEO_API_CPP_RUNTIME)
set(component_development CAMEO_API_CPP_DEVELOPMENT)
#--------------- Options
option(CAMEO_API_CPP_TESTS "Compiling the test programs" OFF)
if(NOT DEFINED CMAKE_CXX_STANDARD)
# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(NOT DEFINED ${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE "Release") # set Release by default
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# fix the RPATH for the linker
#if(not APPLE)
# set(CMAKE_INSTALL_RPATH $ORIGIN)
#endif()
if(NOT APPLE)
set(CMAKE_INSTALL_RPATH $ORIGIN)
endif()
#------------------------------------------------------------
# Dependencies
#------------------------------------------------------------
# this is needed when including this file as subdir
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(ZeroMQ REQUIRED)
find_package(Rapidjson REQUIRED)
find_package (Threads REQUIRED)
find_package(Rapidjson 1.1.0 QUIET)
if(NOT Rapidjson_FOUND)
message(WARNING "Using Rapidjson from GIT repository")
FetchContent_Declare(rapidjson
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
GIT_TAG v1.1.0
GIT_SHALLOW True
)
FetchContent_GetProperties(rapidjson)
FetchContent_Populate(rapidjson)
set(Rapidjson_ROOT ${rapidjson_SOURCE_DIR})
find_package(Rapidjson REQUIRED)
endif()
message(STATUS "Rapidjson found here: ${Rapidjson_INCLUDE_DIRS}")
#------------------------------------------------------------
#------------------------------------------------------------
# Libraries
#------------------------------------------------------------
#---------------
# Files
file(GLOB_RECURSE CAMEO_SOURCE_FILES "src/*.cpp")
#file(GLOB CAMEO_PUBLIC_HEADER_FILES "./*.h")
#message(${CAMEO_PUBLIC_HEADER_FILES})
#message(${CAMEO_SOURCE_FILES})
add_library(cameo ${CAMEO_SOURCE_FILES})
target_link_libraries(cameo PRIVATE zmq)
target_include_directories(cameo
file(GLOB_RECURSE CAMEO_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
configure_file(include/cameo.h.in ${INSTALL_INCLUDEDIR}/cameo.h )
add_library(${LIBNAME}-obj OBJECT ${CAMEO_SOURCE_FILES})
target_link_libraries(${LIBNAME}-obj PUBLIC zmq Threads::Threads)
target_include_directories(${LIBNAME}-obj
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/ # all the private headers
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> # here's the version
PUBLIC $<INSTALL_INTERFACE:${INSTALL_INCLUDEDIR}>
)
#target_compile_features(cameo PUBLIC cxx_std_11)
set_target_properties(cameo PROPERTIES
target_include_directories(${LIBNAME}-obj
SYSTEM PRIVATE ${Rapidjson_INCLUDE_DIRS}/
)
target_compile_features(${LIBNAME}-obj PUBLIC cxx_std_17)
set_target_properties(${LIBNAME}-obj PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
POSITION_INDEPENDENT_CODE 1 # this is needed for static compilation for cameo-api-python
)
message(${PROJECT_VERSION_MAJOR})
message(${PROJECT_VERSION})
#---------------
# Library version
write_basic_package_version_file(cameoConfigVersion.cmake
COMPATIBILITY SameMajorVersion
add_library(${LIBNAME}-static STATIC $<TARGET_OBJECTS:${LIBNAME}-obj>)
add_library(${LIBNAME} $<TARGET_OBJECTS:${LIBNAME}-obj>)
set_target_properties(${LIBNAME} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${PROJECT_VERSION}
POSITION_INDEPENDENT_CODE 1 # this is needed for static compilation for cameo-api-python
)
add_library(${NAMESPACE}::${LIBNAME} ALIAS ${LIBNAME})
add_library(${NAMESPACE}::${LIBNAME}-obj ALIAS ${LIBNAME}-obj)
add_library(${NAMESPACE}::${LIBNAME}-static ALIAS ${LIBNAME}-static)
target_include_directories(${LIBNAME}-static
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> # here's the version
)
target_compile_features(${LIBNAME}-static PUBLIC cxx_std_17)
target_link_libraries(${LIBNAME}-static PUBLIC zmq Threads::Threads)
#------------------------------------------------------------
include(GenerateExportHeader)
generate_export_header(${LIBNAME}
EXPORT_MACRO_NAME ${LIBNAME}_EXPORT
EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/${INSTALL_INCLUDEDIR}/export.h
)
#------------------------------------------------------------
# Install
#------------------------------------------------------------
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/cameoConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt
DESTINATION ${CMAKE_INSTALL_DOCDIR}/
RENAME copyright
COMPONENT ${component_runtime}
)
#---------------
# Library version
write_basic_package_version_file(${PROJECT_NAME}-config-version.cmake
COMPATIBILITY SameMajorVersion
VERSION ${PROJECT_VERSION}
)
write_basic_package_version_file(${PROJECT_NAME}-static-config-version.cmake
COMPATIBILITY SameMajorVersion
VERSION ${PROJECT_VERSION}
)
install(TARGETS ${LIBNAME}
EXPORT cameoTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # windows
COMPONENT ${component_runtime}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/cameo/ # dynamic
COMPONENT ${component_runtime}
NAMELINK_COMPONENT ${component_development} #from CMake 3.12
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/cameo/ # static
COMPONENT ${component_development}
PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDEDIR}
COMPONENT ${component_development}
INCLUDES DESTINATION ${INSTALL_INCLUDEDIR}
COMPONENT ${component_development}
)
# this is to install the headers
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ # don't forget the trailing /
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
DESTINATION ${INSTALL_INCLUDEDIR}
COMPONENT ${component_development}
FILES_MATCHING PATTERN *.h
)
# this is to install the version header that is generated by cmake
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/ # don't forget the trailing /
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT ${component_development}
FILES_MATCHING PATTERN *.h
)
# in CMake 3.14 you just need #install(TARGETS cameo)
install(TARGETS cameo
EXPORT cameoexport
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # windows
COMPONENT cameo_Runtime
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # dynamic
COMPONENT cameo_Runtime
# NAMELINK_COMPONENT cameo_Development #from CMake 3.12
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # static
COMPONENT cameo_Development
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
# this is for cameo-api-python to compile from the local build tree
export(TARGETS ${LIBNAME}-static
NAMESPACE ${NAMESPACE}::
FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-static-targets.cmake
)
export(EXPORT cameoTargets
# FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-${type}-targets.cmake
FILE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake
NAMESPACE ${NAMESPACE}::
)
configure_package_config_file(cmake/${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${ConfigPackageLocation}
)
configure_file(cmake/${PROJECT_NAME}-static-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-static-config.cmake
COPYONLY
)
install(EXPORT cameoTargets
FILE ${PROJECT_NAME}-targets.cmake
# FILE ${PROJECT_NAME}Config.cmake #${PROJECT_NAME}Targets.cmake
NAMESPACE ${NAMESPACE}::
DESTINATION ${ConfigPackageLocation}
COMPONENT ${component_development}
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION ${ConfigPackageLocation}
COMPONENT ${component_development}
)
# This makes the project importable from the install directory
# Put config file in per-project dir (name MUST match), can also
# just go into 'cmake'.
install(EXPORT cameoexport
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
FILE ${PROJECT_NAME}Config.cmake
)
# makes the project importable from the build directory
export(TARGETS cameo FILE ${CMAKE_BINARY_DIR}/${PROJECT_NAME}Config.cmake)
# the install_manifest file is created only after the installation....
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake
# RENAME cameo_install_manifest.txt
# )
#enable_testing()
#add_subdirectory(test)
if(UNIX)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
COMMAND gzip -cn9 ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/changelog"
COMMENT "Compressing changelog"
)
add_custom_target(changelog
ALL
# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
COMMAND gzip -cn9 ${CMAKE_CURRENT_SOURCE_DIR}/ChangeLog > ${CMAKE_CURRENT_BINARY_DIR}/changelog.gz
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT ${component_runtime}
)
endif(UNIX)
#include(CMakeFindDependencyMacro)
#find_dependency(
#include("${CMAKE_CURRENT_LIST_DIR}/cameo.cmake")
################ Doc
find_package(Doxygen)
#------------------------------------------------------------
# Doc
#------------------------------------------------------------
find_package(Doxygen QUIET)
if (DOXYGEN_FOUND)
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
......@@ -128,7 +233,7 @@ if (DOXYGEN_FOUND)
message("Doxygen build started")
# note the option ALL which allows to build the docs together with the application
add_custom_target( doc
add_custom_target( cameo_doc
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
......@@ -137,4 +242,17 @@ else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
#------------------------------------------------------------
# CPack
#------------------------------------------------------------
include(${CMAKE_CURRENT_SOURCE_DIR}/packaging/CPackConfig.cmake)
include(CPack)
#------------------------------------------------------------
# Tests
#------------------------------------------------------------
if(CAMEO_API_CPP_TESTS)
# Note: execute ctest --verbose to have more details
enable_testing()
add_subdirectory(tests)
endif(CAMEO_API_CPP_TESTS)
## Development
How to find the list of public headers and check that they are all in the include/ directory
1. move all the headers in src/
2. move cameo.h to include/
3. run the following command multiple times until there is no output
```
#!/bin/fish
set -l ORIG_DIR src
for f in (for file in include/*; grep include $file | grep '"'; end | sort | uniq | sed 's|.* "||;s|"||'); if [ -e $ORIG_DIR/$f ] ; echo $f; git mv $ORIG_DIR/$f include/; end; end
```
set(CPACK_PACKAGE_NAME cameo)
set (CPACK_PACKAGE_CHECKSUM MD5)
set (CPACK_COMPONENT_DEV_REQUIRED ON)
set (CPACK_COMPONENT_LIB_REQUIRED ON)
set (CPACK_COMPONENT_DEV_DEPENDS LIB )
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON )
set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON )
set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=" )
#set (CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
#set (DEBIAN_PACKAGE_BUILDS_DEPENDS "gcc (>=8), gcc-c++ (>=8), cmake (>=${CMAKE_MINIMUM_REQUIRED_VERSION})" )
set (CPACK_DEBIAN_LIB_PACKAGE_DEPENDS "cameo-server(>=1.0.2)" )
set(CPACK_DEBIAN_DEV_PACKAGE_NAME ${LIBNAME}-dev)
set(CPACK_DEBIAN_DEV_PACKAGE_NAME ${LIBNAME}-dev )
set(CPACK_DEBIAN_LIB_PACKAGE_NAME ${LIBNAME}-lib)
set(CPACK_DEBIAN_LIB_PACKAGE_NAME ${LIBNAME}-lib )
set(CPACK_DEBIAN_DEV_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_DEV_FILE_NAME ${CPACK_DEBIAN_DEV_PACKAGE_NAME}_${PROJECT_VERSION}_${CPACK_DEBIAN_DEV_PACKAGE_ARCHITECTURE}.deb )
set(CPACK_DEBIAN_LIB_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_LIB_FILE_NAME ${CPACK_DEBIAN_LIB_PACKAGE_NAME}_${PROJECT_VERSION}_${CPACK_DEBIAN_LIB_PACKAGE_ARCHITECTURE}.deb )
#if((${CMAKE_BUILD_TYPE} EQUAL "Debug") OR (${CMAKE_BUILD_TYPE} EQUAL "RelWithDebInfo"))
# set (CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)
# set (CPACK_RPM_DEBUGINFO_PACKAGE ON)
#endif()
####### CPACK RPM
#message("CPACK SYSTEM NAME: ${CMAKE_SYSTEM_NAME}")
# cpack_add_component(lib
# DISPLAY_NAME "LIBB"
# DESCRIPTION "runtime library"
# REQUIRED #[HIDDEN | REQUIRED | DISABLED ]
# GROUP LIBBB
# #DEPENDS
# #[INSTALL_TYPES type1 type2 ... ]
# #[DOWNLOADED]
# #[ARCHIVE_FILE filename]
# #[PLIST filename]
# )
# cpack_add_component(dev
# DISPLAY_NAME "DEVV"
# DESCRIPTION "library development"
# #REQUIRED #[HIDDEN | REQUIRED | DISABLED ]
# GROUP DEVVV
# DEPENDS lib
# #[INSTALL_TYPES type1 type2 ... ]
# #[DOWNLOADED]
# #[ARCHIVE_FILE filename]
# #[PLIST filename]
# )
include(CPackConfig.cmake)
set( CPACK_INSTALL_CMAKE_PROJECTS "build/;cameo-api-cpp;ALL;/")
set (CPACK_PACKAGE_CHECKSUM MD5)
set (CPACK_COMPONENT_DEV_REQUIRED ON)
set (CPACK_COMPONENT_LIB_REQUIRED ON)
set (CPACK_COMPONENT_DEV_DEPENDS LIB PARENT_SCOPE)
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON PARENT_SCOPE)
set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON PARENT_SCOPE)
set (CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=" PARENT_SCOPE)
#set (CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
#set (DEBIAN_PACKAGE_BUILDS_DEPENDS "gcc (>=8), gcc-c++ (>=8), cmake (>=${CMAKE_MINIMUM_REQUIRED_VERSION})" PARENT_SCOPE)
set (CPACK_DEBIAN_LIB_PACKAGE_DEPENDS "cameo-server(>=1.0.2)" PARENT_SCOPE)
set(CPACK_DEBIAN_DEV_PACKAGE_NAME ${LIBNAME}-dev)
set(CPACK_DEBIAN_DEV_PACKAGE_NAME ${LIBNAME}-dev PARENT_SCOPE)
set(CPACK_DEBIAN_LIB_PACKAGE_NAME ${LIBNAME}-lib)
set(CPACK_DEBIAN_LIB_PACKAGE_NAME ${LIBNAME}-lib PARENT_SCOPE)
set(CPACK_DEBIAN_DEV_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_DEV_FILE_NAME ${CPACK_DEBIAN_DEV_PACKAGE_NAME}_${PROJECT_VERSION}_${CPACK_DEBIAN_DEV_PACKAGE_ARCHITECTURE}.deb PARENT_SCOPE)
set(CPACK_DEBIAN_LIB_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_LIB_FILE_NAME ${CPACK_DEBIAN_LIB_PACKAGE_NAME}_${PROJECT_VERSION}_${CPACK_DEBIAN_LIB_PACKAGE_ARCHITECTURE}.deb PARENT_SCOPE)
#if((${CMAKE_BUILD_TYPE} EQUAL "Debug") OR (${CMAKE_BUILD_TYPE} EQUAL "RelWithDebInfo"))
# set (CPACK_DEBIAN_DEBUGINFO_PACKAGE ON)
# set (CPACK_RPM_DEBUGINFO_PACKAGE ON)
#endif()
####### CPACK RPM
#message("CPACK SYSTEM NAME: ${CMAKE_SYSTEM_NAME}")
1.1.0
-----
* Removed Option enum and defined OUTPUSTREAM as const int.
* Added Instance::waitFor() and Instance::waitFor(int) for python binding.
* Implemented subscriber and requester with optional string result in receive() function.
* Implemented Instance::getResult() with optional string result.
* Implemented OutputStreamSocket::receive() with optional Output result.
* Instance::getOutputStreamSocket() now returns a unique_ptr<OutputStreamSocket>.
1.0.2
-----
* Removed JSON.h from include.
* Implemented InstanceArray as vector<unique_ptr<Instance>>.
1.0.1
-----
* Some minor changes to compile under Visual Studio 19.
* In Server constructor, moved retrieval of server version in try/catch to avoid exception when there is a timeout.
1.0.0
-----
......@@ -5,7 +27,17 @@
* Added Server::getVersion() which returns the server version.
* Added Output::isEndOfLine() which returns true if the message terminates with an end of line.
* Removed Configuration::getRetries().
* Added storage functions: This::storeKeyValue(), This::getKeyValue(), This::removeKey(), Instance::getKeyValue().
* Added storage functions.
* Added Instance::getPastStates().
* Added Instance.getExitCode().
* Filter OutputStreamSocket on application id.
* Added Server::connect() with id.
* Output stream is synced.
* Added Instance::waitFor(KeyValue) to wait for a key value event.
* Added Com classes for port and storage requests.
* The functions getEndpoint() now return an Endpoint object.
* Argument info passed in JSON format.
* Added optional stopping time in This::handleStop() function.
0.3.3
-----
......
......@@ -346,13 +346,13 @@ LOOKUP_CACHE_SIZE = 0
# normally produced when WARNINGS is set to YES.
# The default value is: NO.
EXTRACT_ALL = NO
EXTRACT_ALL = YES
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
# be included in the documentation.
# The default value is: NO.
EXTRACT_PRIVATE = NO
EXTRACT_PRIVATE = YES
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
......@@ -1795,7 +1795,7 @@ DIA_PATH =
# and usage relations if the target is undocumented or is not a class.
# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
HIDE_UNDOC_RELATIONS = NO
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
# available from the path. This tool is part of Graphviz (see:
......@@ -1870,7 +1870,7 @@ GROUP_GRAPHS = YES
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
UML_LOOK = YES
# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
# class node. If there are many fields or methods and many nodes the graph may
......@@ -1978,7 +1978,7 @@ DOT_IMAGE_FORMAT = png
# The default value is: NO.
# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
INTERACTIVE_SVG = YES
# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
......
# cameo-api-cpp
## Dependencies
This library provides the C++ API for Cameo.
### CENTOS 8
List of packages:
- cmake
- cppzmq-devel
- rapidjson-devel
## Compilation dependencies
- cmake 3.12.0
- cppzmq
- [rapidjson](https://github.com/Tencent/rapidjson)
If not found on the system it is automatically downloaded and installed
- doxygen (optional)
For convenience, the packages for some major distributions are listed in the following:
- CENTOS 8: `yum install -y cmake cppzmq-devel rapidjson-devel`
- Debian 10:
- Ubuntu : `sudo apt install cmake libzmq3-dev rapidjson-dev`
## How to compile and install
```
pkgs="zeromq-devel rapidjson-devel"
yum install -y $pkgs
cmake -S . -B <build directory> -D<OPTION>
cmake --build <build directory>
```
Possible options are:
- CMAKE_INSTALL_PREFIX=<your_chosen_install_basepath>: to install in a non-standard directory
### Debian XXX
In order to install from source:
```
cmake --build <build directory> --target install
```
Debian packages can also be created by:
```
cpack -G DEB --config <build directory>/CPackConfig.cmake -B <build directory>/packaging
```
and be found in `<build directory>/packaging`
### Ubuntu XXX
```sudo apt install cmake libzmq3-dev rapidjson-dev```
Two packages are created:
- -lib: the runtime library for the user
- -dev: the development package with the public headers and cmake config files
## Compilation instructions
## Running tests
To compile also the with the test programs: