Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ add_library(tango SHARED $<TARGET_OBJECTS:log4tango_objects>
target_include_directories(tango PUBLIC ${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS} ${OMNIDYN_PKG_INCLUDE_DIRS})
target_link_libraries(tango PUBLIC ${ZMQ_PKG_LIBRARIES} ${OMNIORB_PKG_LIBRARIES} ${OMNICOS_PKG_LIBRARIES} ${OMNIDYN_PKG_LIBRARIES})
target_compile_options(tango PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER} ${OMNICOS_PKG_CFLAGS_OTHER} ${OMNIDYN_PKG_CFLAGS_OTHER})
target_compile_definitions(tango PUBLIC OMNI_UNLOADABLE_STUBS)

set_target_properties(tango PROPERTIES
VERSION ${LIBRARY_VERSION}
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[DRAFT]

# How to contribute

- fork
- clone fork
- do changes
- create pull request
151 changes: 151 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
[DRAFT]

# How to install

- clone
- cd into cloned repo
- mkdir build
- cd build
- cmake ..
- make [-j NUMBER_OF_CPUS]
- sudo make install

Typical output:

```
-- Install configuration: "DEBUG"
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/lib/libtango.so.9.2.5
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/lib/libtango.so.9
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/lib/libtango.so
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/lib/pkgconfig/tango.pc
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Appender.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/AppenderAttachable.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/LayoutAppender.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/FileAppender.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/RollingFileAppender.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/OstreamAppender.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Layout.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/PatternLayout.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/XmlLayout.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Logger.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/LogSeparator.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/LoggerStream.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/LogStream.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/LogStreambuf.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/LoggingEvent.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Level.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/NDC.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/TimeStamp.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Filter.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Export.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/Portability.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/config.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/threading/DummyThreads.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/threading/PThreads.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/threading/MSThreads.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango/threading/Threading.hh
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/accessproxy.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/apiexcept.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/cbthread.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/dbapi.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/devapi.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/devasyn.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/event.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/eventconsumer.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/filedatabase.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/group.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/lockthread.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/Database.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/DbDevice.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/ApiUtil.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/DeviceData.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/DeviceAttribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/DevicePipe.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/Connection.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/DeviceProxy.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/AttributeProxy.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/event.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/devapi_attr.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/devapi_utils.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/api_util.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/devapi_pipe.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/zmq.hpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/DeviceProxyHelper.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/PogoHelper.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/TangoExceptionsHelper.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/Xstring.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attrdesc.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attribute.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attrsetval.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attribute_spec.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attrmanip.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attrprop.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/attrprop.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/auto_tango_monitor.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/basiccommand.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/blackbox.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/classattribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/classpipe.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/command.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pipe.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pipe.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/coutappender.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/coutbuf.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/device.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/device_2.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/device_3.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/device_3.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/device_4.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/device_5.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/deviceclass.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/devintr.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/dintrthread.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/dserver.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/dserverclass.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/dserversignal.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/eventsupplier.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/except.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/fwdattrdesc.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/fwdattribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/fwdattribute.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/fwdattribute_spec.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/log4tango.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/logcmds.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/logging.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/logstream.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/multiattribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/ntservice.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pipedesc.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollcmds.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollext.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollext.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollobj.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollring.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollring.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollthread.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/pollthread.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/readers_writers_lock.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/rootattreg.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/seqvec.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/tango.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/tango_config.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/tango_const.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/tango_monitor.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/tangoappender.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/tangorollingfileappender.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/utils.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/utils.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/utils_spec.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w32win.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w_attribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w_attribute.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w_attrsetval.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w_attribute_spec.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w_pipe.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/w_pipe.tpp
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/subdev_diag.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/encoded_attribute.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/encoded_format.h
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/idl/tango.h
```
29 changes: 21 additions & 8 deletions configure/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE DEBUG)
endif()

if(IDL_BASE)
set(IDL_PKG_INCLUDE_DIRS ${IDL_BASE}/include)
else(IDL_BASE)
pkg_search_module(IDL_PKG REQUIRED tangoidl)
endif(IDL_BASE)

if(OMNI_BASE)
message("Using OMNI_BASE=${OMNI_BASE}")
set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include)
set(OMNIORB_PKG_LIBRARIES "-lomniORB4 -lomnithread -lCOS4 -lomniDynamic4")
set(OMNIIDL_PATH ${OMNI_BASE}/bin/)
include_directories(${OMNI_BASE}/include)
link_directories(${OMNI_BASE}/lib)
else()
else(OMNI_BASE)
#CORBA
pkg_search_module(OMNIORB_PKG REQUIRED omniORB4)
#COS
Expand All @@ -21,34 +28,40 @@ else()
if(NOT OMNIORB_PKG_FOUND)
message(FATAL "omniORB4 library is required for Tango")
endif()
endif()
endif(OMNI_BASE)

if(ZMQ_BASE)
message("Using ZMQ_BASE=${ZMQ_BASE}")
set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include)
set(ZMQ_PKG_LIBRARIES "-lzmq")
include_directories(${ZMQ_BASE}/include)
link_directories(${ZMQ_BASE}/lib)
else()
else(ZMQ_BASE)
pkg_search_module(ZMQ_PKG REQUIRED libzmq)
if(NOT ZMQ_PKG_FOUND)
message(FATAL "ZMQ library is required for Tango")
endif()
endif(ZMQ_BASE)

#assuming build platform == target
set(PLATFORM 32)
if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
set(PLATFORM 64)
endif()

#setup for GNU CXX compiler
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message("found GNU compiler ...")
if(CMAKE_BUILD_TYPE MATCHES RELEASE)
message("setup for release build ...")
add_definitions(-O2 -D_TANGO_LIB)
add_compile_options(-O2)
add_definitions( -D_TANGO_LIB -D_FORTIFY_SOURCE=2)
else()
message("setup for debug build ...")
add_definitions(-g -O0 -Wall -Wextra)# -pedantic
add_compile_options(-g -O0 -Wall -Wextra)# -pedantic
endif()
add_definitions(-std=c++11)
add_definitions(-DGNU_CXX -DOMNI_UNLOADABLE_STUBS -D_FORTIFY_SOURCE=2)
add_definitions(-fPIC)
add_compile_options(-std=c++11 -fPIC)
add_definitions(-DGNU_CXX)
endif()

include(GNUInstallDirs)
22 changes: 19 additions & 3 deletions cppapi/server/idl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
message("Generate tango.h, tangoSK.cpp and tangoDybSK.cpp from idl")
execute_process(COMMAND ${OMNIIDL_PATH}omniidl -I${IDL_PKG_INCLUDE_DIRS} -bcxx -Wbh=.h -Wbs=SK.cpp -Wbd=DynSK.cpp -Wba ${IDL_PKG_INCLUDE_DIRS}/tango.idl
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

FILE(GLOB ENHANCEMENTS Enhance*)

foreach(ENHANCEMENT ${ENHANCEMENTS})
message("Applying enhancement ${ENHANCEMENT}")
execute_process(COMMAND sed -i -f ${ENHANCEMENT} tango.h
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE FAILED)

#non-zero
if(${FAILED})
message(FATAL " Failed to apply ${ENHANCEMENT}. rv=${FAILED}")
endif()
endforeach(ENHANCEMENT)

set(SOURCES tangoSK.cpp
tangoDynSK.cpp)

add_library(idl_objects OBJECT ${SOURCES} tango.h)

#TODO generate source code from idl

install(FILES tango.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/idl")
install(FILES tango.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/idl")
7 changes: 7 additions & 0 deletions cppapi/server/idl/EnhanceAttributeValue_4
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/typedef\ _CORBA_ConstrType_Variable_Var<AttributeValue_4>/a \/\/Added by Tango team\
\t\tvirtual ~AttributeValue_4() {if (mut_ptr != NULL)mut_ptr->unlock();}\
\t\tAttributeValue_4() {mut_ptr=NULL;}\
\t\tvoid set_attr_mutex(omni_mutex *ptr) {mut_ptr=ptr;}\
\t\tvoid rel_attr_mutex() {if (mut_ptr != NULL){mut_ptr->unlock();mut_ptr=NULL;}}\
\t\tomni_mutex *get_attr_mutex() {return mut_ptr;}\
\t\tomni_mutex *mut_ptr;
7 changes: 7 additions & 0 deletions cppapi/server/idl/EnhanceAttributeValue_5
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/typedef\ _CORBA_ConstrType_Variable_Var<AttributeValue_5>/a \/\/Added by Tango team\
\t\tvirtual ~AttributeValue_5() {if (mut_ptr != NULL)mut_ptr->unlock();}\
\t\tAttributeValue_5() {mut_ptr=NULL;}\
\t\tvoid set_attr_mutex(omni_mutex *ptr) {mut_ptr=ptr;}\
\t\tvoid rel_attr_mutex() {if (mut_ptr != NULL){mut_ptr->unlock();mut_ptr=NULL;}}\
\t\tomni_mutex *get_attr_mutex() {return mut_ptr;}\
\t\tomni_mutex *mut_ptr;
6 changes: 6 additions & 0 deletions cppapi/server/idl/EnhanceDevPipeData
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/typedef\ _CORBA_ConstrType_Variable_Var<DevPipeData>/a \/\/Added by Tango team \
\t\tvirtual ~DevPipeData() {if (mut_ptr != NULL)mut_ptr->unlock();}\
\t\tDevPipeData() {mut_ptr=NULL;}\
\t\tvoid set_pipe_mutex(omni_mutex *ptr) {mut_ptr=ptr;}\
\t\tvoid rel_pipe_mutex() {if (mut_ptr != NULL){mut_ptr->unlock();mut_ptr=NULL;}}\
\t\tomni_mutex *mut_ptr;
Loading