Dhanya Thattil 05f657c106
Versioning (#568)
- removed getClientServerAPIVersion in server (not used)
- removed rxr side (clientversion compatibility check), removed enum as well as it is now done on the client side.
- versionAPI.h
   - GITBRANCH changed to RELEASE
   - dates for all API changed to "sem_version date". Scripts to compile servers modified for this. Empty "branch" name will end up with developer for sem_version.

- Version class with constructor taking in the long version (APILIB date). Other member functions including concise(to get sem_version for new releases and date for old releases), 
  
- bypassing initial tests, also now bypasses the client-rxr compatibility check (at rx_hostname command)

- previously, compatibility between client-det was ensuring both had the same detector API (eg. same APIJUNGFRAU)
   - Now, compatibility only checks APILIB (client side) and detector API(eg. APIJUNGFRAU) (detector side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If server is from an older release, it will compare dates like previous implementation (APIJUNGFRAU from both client and det)
 
- - previously, compatibility between client-rxr was ensuring both had the same APIRECEIVER
   - Now, compatibility only checks APILIB (client side) and APIRECEIVER (rxr side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. 
   - If rxr is from an older release, it will compare dates like previous implementation (APIRECEIVER from both client and rxr)

- removed APIGUI, evalVersionVariables.sh, genVersionHeader.sh (not needed or not used)

- clientVersion, rxrversion and detectorserverversion all return strings and not integers (in hex) anymore. Depending if it has semantic versioning, it will print that or the date if it is too old.

- fixed in python (strings for versions)
- check_version function in detector server changed to "initial checks" as it only checks server-firmware compatibility and initial server checks. Client compatibilities are moved to client side.
- --version gives sem_version and date? Is date needed as well. The clientversion, detserverversion and rxrversion API gives only sem_version (no date)
- - formatting
2022-11-09 11:13:09 +01:00

145 lines
4.1 KiB
CMake
Executable File

# SPDX-License-Identifier: LGPL-3.0-or-other
# Copyright (C) 2021 Contributors to the SLS Detector Package
set(SOURCES
src/string_utils.cpp
src/file_utils.cpp
src/ClientSocket.cpp
src/DataSocket.cpp
src/ServerSocket.cpp
src/ServerInterface.cpp
src/ToString.cpp
src/network_utils.cpp
src/ZmqSocket.cpp
src/UdpRxSocket.cpp
src/sls_detector_exceptions.cpp
src/md5_helper.cpp
src/Version.cpp
)
# Header files to install as a part of the library
set(PUBLICHEADERS
include/sls/sls_detector_defs.h
include/sls/sls_detector_exceptions.h
include/sls/container_utils.h
include/sls/string_utils.h
include/sls/network_utils.h
include/sls/ToString.h
include/sls/TypeTraits.h
include/sls/TimeHelper.h
)
# Additional headers to be installed if SLS_DEVEL_HEADERS
# is specified as an option. Aim is to give the developer
# access to utilities in the support library while
# at the same time offer a minimal install
if(SLS_DEVEL_HEADERS)
set(PUBLICHEADERS
${PUBLICHEADERS}
include/sls/ansi.h
include/sls/logger.h
include/sls/file_utils.h
include/sls/sls_detector_funcs.h
include/sls/ClientSocket.h
include/sls/DataSocket.h
include/sls/ServerSocket.h
include/sls/ServerInterface.h
include/sls/Timer.h
include/sls/StaticVector.h
include/sls/UdpRxSocket.h
include/sls/versionAPI.h
include/sls/ZmqSocket.h
include/sls/bit_utils.h
include/sls/md5.h
include/sls/md5_helper.h
include/sls/Version.h
)
endif()
# Library for md5 c code that we are using (and potentially other c code)
# Maybe this should be broken out into it's own folder etc.
add_library(md5sls STATIC
src/md5.c
)
target_include_directories(md5sls
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
# Create an object library to avoid building the library twice
add_library(slsSupportObject OBJECT
${SOURCES}
${HEADERS}
)
target_include_directories(slsSupportObject
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
PRIVATE
${SLS_INTERNAL_RAPIDJSON_DIR}
)
message(STATUS "RAPID: ${SLS_INTERNAL_RAPIDJSON_DIR}")
target_link_libraries(slsSupportObject
PUBLIC
slsProjectOptions
libzmq
PRIVATE
slsProjectWarnings
md5sls
)
if (SLS_USE_TESTS)
add_subdirectory(tests)
endif(SLS_USE_TESTS)
#List of targets to support adding removing targets as config
set(SUPPORT_LIBRARY_TARGETS slsSupportObject)
# Add shared library version of the support lib
if(SLS_BUILD_SHARED_LIBRARIES)
add_library(slsSupportShared SHARED $<TARGET_OBJECTS:slsSupportObject>)
target_link_libraries(slsSupportShared PUBLIC slsSupportObject)
set_target_properties(slsSupportShared PROPERTIES
VERSION ${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}
SOVERSION ${PACKAGE_VERSION_MAJOR}
LIBRARY_OUTPUT_NAME SlsSupport
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
PUBLIC_HEADER "${PUBLICHEADERS}"
)
list(APPEND SUPPORT_LIBRARY_TARGETS slsSupportShared)
endif(SLS_BUILD_SHARED_LIBRARIES)
# Add static version of the support lib
add_library(slsSupportStatic STATIC $<TARGET_OBJECTS:slsSupportObject>)
target_link_libraries(slsSupportStatic PUBLIC slsSupportObject)
set_target_properties(slsSupportStatic PROPERTIES
ARCHIVE_OUTPUT_NAME SlsSupportStatic
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
PUBLIC_HEADER "${PUBLICHEADERS}"
)
list(APPEND SUPPORT_LIBRARY_TARGETS slsSupportStatic)
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
set_property(TARGET ${SUPPORT_LIBRARY_TARGETS} PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
endif()
list(APPEND SUPPORT_LIBRARY_TARGETS md5sls)
install(TARGETS ${SUPPORT_LIBRARY_TARGETS}
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/sls
)