Skip to content
Snippets Groups Projects
Commit 2e54011b authored by Martin Killenberg's avatar Martin Killenberg
Browse files
parents 0f5759b8 a69c8099
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@
######################
build
.project
.cproject
.settings
.kdev4
*.kdev4
.vscode
......
......@@ -72,7 +72,19 @@ if (";${DOOCS_FIND_COMPONENTS};" MATCHES ";daqreader;")
set(DOOCS_LIBRARIES ${DOOCS_LIBRARIES} DAQReader TTF2evutl TTF2XML lzo2 DAQsvrutil)
endif()
set(DOOCS_LIBRARIES ${DOOCS_LIBRARIES} DOOCSapi nsl dl pthread m rt ldap gul)
#This is for the transition only. The logic is not bullet proof, but in almost all cases
#if there is libgul14.so, it means DOOCS brought it and needs it.
FIND_LIBRARY(LIB_GULOLD libgul.so ${DOOCS_DIR})
FIND_LIBRARY(LIB_GUL14 libgul14.so ${DOOCS_DIR})
message("LIB_GULOLD ${LIB_GULOLD} , LIB_GUL14 ${LIB_GUL14}")
if ("${LIB_GUL14}" MATCHES "LIB_GUL14-NOTFOUND")
set(LIB_GUL "gul")
else()
set(LIB_GUL "gul14")
endif()
set(DOOCS_LIBRARIES ${DOOCS_LIBRARIES} DOOCSapi nsl dl pthread m rt ldap ${LIB_GUL})
message("DOOCS_LIBRARIES ${DOOCS_LIBRARIES}")
# now set the required variables based on the determined DOOCS_DIR
set(DOOCS_INCLUDE_DIRS ${DOOCS_DIR}/include)
......
......@@ -34,6 +34,8 @@ FIND_LIBRARY(@PROJECT_NAME@_LIBRARY @PROJECT_NAME@
NO_DEFAULT_PATH
)
@@PROJECT_NAME@_PUBLIC_DEPENDENCIES_L@
# Since this file is already part of the installation to be found, the configuration can be hard-coded at
# installation time
set(@PROJECT_NAME@_VERSION "@@PROJECT_NAME@_SOVERSION@")
......
......@@ -48,11 +48,19 @@ foreach(LIBRARY ${LIST})
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} ${LIBRARY}")
elseif(LIBRARY MATCHES "^-l") # library name does not contain slashes but already the -l option: directly quote it
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} ${LIBRARY}")
elseif(LIBRARY MATCHES "::") # library name is an exported target - we need to resolve it for Makefiles
get_property(lib_loc TARGET ${LIBRARY} PROPERTY LOCATION)
string(APPEND ${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE " ${lib_loc}")
else() # link against library with -l option
set(${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE "${${PROJECT_NAME}_LINKER_FLAGS_MAKEFILE} -l${LIBRARY}")
endif()
endforeach()
set(${PROJECT_NAME}_PUBLIC_DEPENDENCIES_L "")
foreach(DEPENDENCY ${${PROJECT_NAME}_PUBLIC_DEPENDENCIES})
string(APPEND ${PROJECT_NAME}_PUBLIC_DEPENDENCIES_L "find_package(${DEPENDENCY} REQUIRED)\n")
endforeach()
# we have nested @-statements, so we have to parse twice:
# create the cmake find_package configuration file
......
#######################################################################################################################
# set_control_system_adapter.cmake
#
# Set the ControlSystemAdapter for a ApplicationCore server
#
# Expects the following input variable:
# ADAPTER - String specifiing the adapter, either DOOCS, OPCUA or EPICSIOC
#
# This macro will add the selected adapter as a dependency and set the following variables:
#
# Adapter_LINK_FLAGS - Link flags provided by the adapter library
# Adapter_LIBRARIES - Libraries that are dependencies of the adapter
#
#######################################################################################################################
#######################################################################################################################
#
# IMPORTANT NOTE:
#
# DO NOT MODIFY THIS FILE inside a project. Instead update the project-template repository and pull the change from
# there. Make sure to keep the file generic, since it will be used by other projects, too.
#
# If you have modified this file inside a project despite this warning, make sure to cherry-pick all your changes
# into the project-template repository immediately.
#
#######################################################################################################################
# Select control system adapter
IF(ADAPTER STREQUAL "OPCUA")
message("Building against the OPC UA ControlSystemAdater")
add_dependency(ChimeraTK-ControlSystemAdapter-OPCUAAdapter REQUIRED)
set(Adapter_LINK_FLAGS ${ChimeraTK-ControlSystemAdapter-OPCUAAdapter_LINK_FLAGS})
set(Adapter_LIBRARIES ${ChimeraTK-ControlSystemAdapter-OPCUAAdapter_LIBRARIES})
ELSEIF(ADAPTER STREQUAL "DOOCS")
message("Building against the DOOCS ControlSystemAdater")
add_dependency(ChimeraTK-ControlSystemAdapter-DoocsAdapter REQUIRED)
set(Adapter_LINK_FLAGS ${ChimeraTK-ControlSystemAdapter-DoocsAdapter_LINK_FLAGS})
set(Adapter_LIBRARIES ${ChimeraTK-ControlSystemAdapter-DoocsAdapter_LIBRARIES})
ELSEIF(ADAPTER STREQUAL "EPICSIOC")
message("Building against the EPICS IOC ControlSystemAdater")
add_dependency(ChimeraTK-ControlSystemAdapter-EPICS-IOC-Adapter REQUIRED)
set(Adapter_LINK_FLAGS ${ChimeraTK-ControlSystemAdapter-EPICS-IOC-Adapter_LINK_FLAGS})
set(Adapter_LIBRARIES ${ChimeraTK-ControlSystemAdapter-EPICS-IOC-Adapter_LIBRARIES})
ELSE()
message(FATAL_ERROR "Please select your ControlSystemAdapter to use by passing to the cmake command line:\n"
" -DADAPTER=DOOCS to build a DOOCS server\n"
" -DADAPTER=OPCUA to build an OPC UA server\n"
" -DADAPTER=EPICSIOC to build an EPICS IOC")
ENDIF()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment