From ade9c958f9147fc363c6eee511eca45f2d591a51 Mon Sep 17 00:00:00 2001 From: ingvord Date: Tue, 13 Sep 2016 17:53:25 +0300 Subject: [PATCH 01/48] TANGO-678 progress (migrate to cmake) --- CMakeLists.txt | 27 +++++ cppapi/CMakeLists.txt | 12 +++ cppapi/client/CMakeLists.txt | 60 ++++++++++++ cppapi/server/CMakeLists.txt | 63 ++++++++++++ cppapi/server/jpeg/CMakeLists.txt | 8 ++ cppapi/server/jpeg_mmx/CMakeLists.txt | 5 + log4tango/CMakeLists.txt | 15 +++ log4tango/include/CMakeLists.txt | 32 ++++++ log4tango/include/config.h.cmake | 98 +++++++++++++++++++ log4tango/include/log4tango/CMakeLists.txt | 29 ++++++ .../log4tango/threading/CMakeLists.txt | 8 ++ log4tango/src/CMakeLists.txt | 30 ++++++ log4tango/tests/CMakeLists.txt | 8 ++ 13 files changed, 395 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cppapi/CMakeLists.txt create mode 100644 cppapi/client/CMakeLists.txt create mode 100644 cppapi/server/CMakeLists.txt create mode 100644 cppapi/server/jpeg/CMakeLists.txt create mode 100644 cppapi/server/jpeg_mmx/CMakeLists.txt create mode 100644 log4tango/CMakeLists.txt create mode 100644 log4tango/include/CMakeLists.txt create mode 100644 log4tango/include/config.h.cmake create mode 100644 log4tango/include/log4tango/CMakeLists.txt create mode 100644 log4tango/include/log4tango/threading/CMakeLists.txt create mode 100644 log4tango/src/CMakeLists.txt create mode 100644 log4tango/tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..57dc8901b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.0) +project(libtango) +include(CTest) + +#need to define the version of the library +set(MAJOR_VERSION "9") +set(MINOR_VERSION "2") +set(PATCH_VERSION "5") +set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") +set(SO_VERSION "2") + + +set (PACKAGE_URL "https://github.com/tango-controls/cppTango") +set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") +set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") + +#source code +add_subdirectory("log4tango") +add_subdirectory("cppapi") +#add_subdirectory("cpp_test_ds") +#add_subdirectory("cpp_test_suite") + +add_library(libtango SHARED $ + $ + $ + $ + $) diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt new file mode 100644 index 000000000..6b02764d4 --- /dev/null +++ b/cppapi/CMakeLists.txt @@ -0,0 +1,12 @@ +include_directories("client" "client/helpers") +include_directories("server" "server/idl") + + +add_subdirectory("client") +add_subdirectory("server") + + +#link_libraries() + +#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" +# DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") \ No newline at end of file diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt new file mode 100644 index 000000000..0b618afbf --- /dev/null +++ b/cppapi/client/CMakeLists.txt @@ -0,0 +1,60 @@ +set(SOURCES dbapi_class.cpp + dbapi_server.cpp + dbapi_datum.cpp + dbapi_base.cpp + dbapi_device.cpp + dbapi_history.cpp + dbapi_attribute.cpp + dbapi_cache.cpp + dbapi_serverdata.cpp + devapi_attr.cpp + devapi_base.cpp + devapi_data.cpp + devapi_datahist.cpp + devapi_utils.cpp + devapi_pipe.cpp + api_util.cpp + asynreq.cpp + cbthread.cpp + proxy_asyn.cpp + proxy_asyn_cb.cpp + attr_proxy.cpp + group.cpp + filedatabase.cpp + apiexcept.cpp + accessproxy.cpp + lockthread.cpp + event.cpp + eventkeepalive.cpp + eventqueue.cpp + notifdeventconsumer.cpp + zmqeventconsumer.cpp) + +set(HEADERS accessproxy.h + apiexcept.h + cbthread.h + dbapi.h + devapi.h + devasyn.h + event.h + eventconsumer.h + filedatabase.h + group.h + lockthread.h + Database.h + DbDevice.h + ApiUtil.h + DeviceData.h + DeviceAttribute.h + DevicePipe.h + Connection.h + DeviceProxy.h + AttributeProxy.h + event.tpp + devapi_attr.tpp + devapi_utils.tpp + api_util.tpp + devapi_pipe.tpp + zmq.hpp) + +add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt new file mode 100644 index 000000000..154ceea59 --- /dev/null +++ b/cppapi/server/CMakeLists.txt @@ -0,0 +1,63 @@ +set(SOURCES attrdesc.cpp + attrgetsetprop.cpp + attribute.cpp + attrsetval.cpp + attrmanip.cpp + basiccommand.cpp + blackbox.cpp + class_factory.cpp + classattribute.cpp + command.cpp + coutappender.cpp + classpipe.cpp + dev_event.cpp + dev_poll.cpp + device.cpp + device_2.cpp + device_3.cpp + device_4.cpp + device_5.cpp + deviceclass.cpp + devicelog.cpp + devintr.cpp + dintrthread.cpp + dserver.cpp + dserverclass.cpp + dserverlock.cpp + dserverlog.cpp + dserverpoll.cpp + dserversignal.cpp + encoded_attribute.cpp + eventcmds.cpp + eventsupplier.cpp + except.cpp + fwdattrdesc.cpp + fwdattribute.cpp + logcmds.cpp + logging.cpp + logstream.cpp + multiattribute.cpp + notifdeventsupplier.cpp + pipe.cpp + pollcmds.cpp + pollobj.cpp + pollring.cpp + pollthread.cpp + rootattreg.cpp + seqvec.cpp + subdev_diag.cpp + tangoappender.cpp + tangorollingfileappender.cpp + templ_inst.cpp + thsig.cpp + utils.cpp + utils_polling.cpp + utils_shut.cpp + w_attribute.cpp + w_pipe.cpp + zmqeventsupplier.cpp) + +add_subdirectory("jpeg") +add_subdirectory("jpeg_mmx") + +add_library(server_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/cppapi/server/jpeg/CMakeLists.txt b/cppapi/server/jpeg/CMakeLists.txt new file mode 100644 index 000000000..d1160fd59 --- /dev/null +++ b/cppapi/server/jpeg/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SOURCES jpeg_bitstream.cpp + jpeg_color.cpp + jpeg_dct.cpp + jpeg_decoder.cpp + jpeg_encoder.cpp + jpeg_memory.cpp) + +add_library(jpeg_objects OBJECT ${SOURCES}) diff --git a/cppapi/server/jpeg_mmx/CMakeLists.txt b/cppapi/server/jpeg_mmx/CMakeLists.txt new file mode 100644 index 000000000..762b3a151 --- /dev/null +++ b/cppapi/server/jpeg_mmx/CMakeLists.txt @@ -0,0 +1,5 @@ +set(SOURCES + jpeg_color_mmx.cpp + jpeg_dct_mmx.cpp) + +add_library(jpeg_mmx_objects OBJECT ${SOURCES}) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt new file mode 100644 index 000000000..2333ff515 --- /dev/null +++ b/log4tango/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# +1 : ? : +1 == new interface that does not break old one +# +1 : ? : 0 == new interface that breaks old one +# ? : ? : 0 == no new interfaces, but breaks apps +# ? :+1 : ? == just some internal changes, nothing breaks but might work +# better +# CURRENT : REVISION : AGE +set(LT_VERSION "5:1:0") + +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") + +add_subdirectory(include) +add_subdirectory(src) +add_subdirectory(tests) \ No newline at end of file diff --git a/log4tango/include/CMakeLists.txt b/log4tango/include/CMakeLists.txt new file mode 100644 index 000000000..5b1b51caf --- /dev/null +++ b/log4tango/include/CMakeLists.txt @@ -0,0 +1,32 @@ +include(CheckIncludeFile) +include(CheckFunctionExists) +include(FindThreads) + +#TODO config.h.in stamp-h.in +CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) +CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) +CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) + +#check function +CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) +CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) + +#check compiler feature + +#check threads +check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) +check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) +check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) +check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) + +configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/log4tango/include/log4tango/config.h) + +add_subdirectory(log4tango) \ No newline at end of file diff --git a/log4tango/include/config.h.cmake b/log4tango/include/config.h.cmake new file mode 100644 index 000000000..e82211e6b --- /dev/null +++ b/log4tango/include/config.h.cmake @@ -0,0 +1,98 @@ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H + +/* Define to 1 if you have the `ftime' function. */ +#cmakedefine HAVE_FTIME + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine HAVE_GETTIMEOFDAY + +/* define if the compiler has int64_t */ +#cmakedefine HAVE_INT64_T + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IO_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H + +/* define if the compiler implements namespaces */ +#cmakedefine HAVE_NAMESPACES + +/* define if the C library has snprintf */ +#cmakedefine HAVE_SNPRINTF + +/* define if the compiler has stringstream */ +#cmakedefine HAVE_SSTREAM + +/* define if you have the header file. */ +#cmakedefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H + +/* define if threading is enabled */ +#cmakedefine HAVE_THREADING + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. */ +#cmakedefine LT_OBJDIR + +/* Name of package */ +#cmakedefine PACKAGE "${CMAKE_PROJECT_NAME}" + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME "${CMAKE_PROJECT_NAME}" + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#cmakedefine PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION "${LIBRARY_VERSION}" + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS + +/* define if pthread library is available */ +#cmakedefine HAVE_PTHREAD_ATTR_GET_NP 1 +#cmakedefine HAVE_PTHREAD_GETATTR_NP 1 +#cmakedefine HAVE_PTHREAD_CREATE 1 +#cmakedefine HAVE_PTHREAD_NP_H 1 +#if defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_CREATE) || defined(HAVE_PTHREAD_NP_H) +#define USE_PTHREADS 1 +#endif + +/* Version number of package */ +#cmakedefine VERSION "@LIBRARY_VERSION@" + +/* If we're running on darwin/MacOsX */ +#cmakedefine __darwin__ + +/* If we're running on FreeBSD */ +#cmakedefine __freebsd__ \ No newline at end of file diff --git a/log4tango/include/log4tango/CMakeLists.txt b/log4tango/include/log4tango/CMakeLists.txt new file mode 100644 index 000000000..538b6c1b3 --- /dev/null +++ b/log4tango/include/log4tango/CMakeLists.txt @@ -0,0 +1,29 @@ +set(HEADER_FILES + Appender.hh + AppenderAttachable.hh + LayoutAppender.hh + FileAppender.hh + RollingFileAppender.hh + OstreamAppender.hh + Layout.hh + PatternLayout.hh + XmlLayout.hh + Logger.hh + LogSeparator.hh + LoggerStream.hh + LogStream.hh + LogStreambuf.hh + LoggingEvent.hh + Level.hh + NDC.hh + TimeStamp.hh + Filter.hh + Export.hh + Portability.hh + config.h + config-win32.h) + +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango) + +add_subdirectory(threading) \ No newline at end of file diff --git a/log4tango/include/log4tango/threading/CMakeLists.txt b/log4tango/include/log4tango/threading/CMakeLists.txt new file mode 100644 index 000000000..8f1fe8272 --- /dev/null +++ b/log4tango/include/log4tango/threading/CMakeLists.txt @@ -0,0 +1,8 @@ +set(HEADER_FILES + DummyThreads.hh + PThreads.hh + MSThreads.hh + Threading.hh) + +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango/threading) \ No newline at end of file diff --git a/log4tango/src/CMakeLists.txt b/log4tango/src/CMakeLists.txt new file mode 100644 index 000000000..e10ce35c0 --- /dev/null +++ b/log4tango/src/CMakeLists.txt @@ -0,0 +1,30 @@ +set(SOURCES + Appender.cpp + AppenderAttachable.cpp + LayoutAppender.cpp + FileAppender.cpp + RollingFileAppender.cpp + OstreamAppender.cpp + Layout.cpp + PatternLayout.cpp + XmlLayout.cpp + Logger.cpp + LogSeparator.cpp + LoggerStream.cpp + LoggingEvent.cpp + Level.cpp + NDC.cpp + Filter.cpp + TimeStamp.cpp + StringUtil.hh + StringUtil.cpp + DllMain.cpp + DummyThreads.cpp + MSThreads.cpp + PThreads.cpp + PortabilityImpl.hh + PortabilityImpl.cpp) + +add_library(log4tango_objects OBJECT ${SOURCES}) + +#target_link_libraries(log4tango_objects -version-info ${LT_VERSION}) \ No newline at end of file diff --git a/log4tango/tests/CMakeLists.txt b/log4tango/tests/CMakeLists.txt new file mode 100644 index 000000000..f9421fffe --- /dev/null +++ b/log4tango/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +set(LOG4TANGO_TEST_SOURCES test_log4tango.cpp) +set(BENCH_TEST_SOURCES clock.cpp clock.hh test_bench.cpp) + +add_executable(test_log4tango ${LOG4TANGO_TEST_SOURCES} $) +add_executable(test_bench ${BENCH_TEST_SOURCES} $) + +add_test("log4tango test" test_log4tango) +add_test("log4tango benchmark" test_bench) \ No newline at end of file From beb2c8e9c8948b6b498ee4700fc2b9522f689182 Mon Sep 17 00:00:00 2001 From: ingvord Date: Tue, 13 Sep 2016 21:30:56 +0300 Subject: [PATCH 02/48] TANGO-678 progress (migrate to cmake) --- log4tango/CMakeLists.txt | 2 + log4tango/config/check_sstream.cpp | 16 ++++++ log4tango/config/config.cmake | 51 +++++++++++++++++++ .../config.h.cmake => config/config.h.in} | 36 ++++++------- log4tango/include/CMakeLists.txt | 31 ----------- 5 files changed, 87 insertions(+), 49 deletions(-) create mode 100644 log4tango/config/check_sstream.cpp create mode 100644 log4tango/config/config.cmake rename log4tango/{include/config.h.cmake => config/config.h.in} (78%) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index 2333ff515..86034f7ff 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -7,6 +7,8 @@ # CURRENT : REVISION : AGE set(LT_VERSION "5:1:0") +include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") diff --git a/log4tango/config/check_sstream.cpp b/log4tango/config/check_sstream.cpp new file mode 100644 index 000000000..984d56ec4 --- /dev/null +++ b/log4tango/config/check_sstream.cpp @@ -0,0 +1,16 @@ +// +// Created by ingvord on 9/13/16. +// +#include + +int main(int argc,char **arv) +{ + std::ostringstream oss; + + oss << "Hello"; + + std::cout << oss << std::endl; + + return 0; +} + diff --git a/log4tango/config/config.cmake b/log4tango/config/config.cmake new file mode 100644 index 000000000..c1f31865a --- /dev/null +++ b/log4tango/config/config.cmake @@ -0,0 +1,51 @@ +include(CheckIncludeFile) +include(CheckFunctionExists) +include(FindThreads) +include(CheckCXXSourceCompiles) +include(CheckTypeSize) + +macro (LOG4TANGO_CHECK_INCLUDE_FILE header var) + CHECK_INCLUDE_FILE("${header}" LOG4TANGO_${var} ) +endmacro() + +LOG4TANGO_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +LOG4TANGO_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) +LOG4TANGO_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) +LOG4TANGO_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) +LOG4TANGO_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +LOG4TANGO_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +LOG4TANGO_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +LOG4TANGO_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +LOG4TANGO_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +LOG4TANGO_CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) +LOG4TANGO_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) + +macro (LOG4TANGO_CHECK_FUNCTION_EXISTS function var) + CHECK_FUNCTION_EXISTS("${function}" LOG4TANGO_${var} ) +endmacro() +#check function +LOG4TANGO_CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) +LOG4TANGO_CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) + + +#check threads +check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) +check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) +check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) +check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) + +#check compiler features +file(READ "config/check_sstream.cpp" SSTREAM_CHECK_SOURCE) +check_cxx_source_compiles("${SSTREAM_CHECK_SOURCE}" SSTREAM_CHECK) +if(NOT BIND_COMPILER_CHECK) + set(LOG4TANGO_HAVE_SSTREAM "/**/") +endif() + +#check types +check_type_size(int64_t INT64_SIZE) +if(${INT64_SIZE} EQUAL 8) + set(LOG4TANGO_HAVE_INT64_T "/**/") +endif() + + +configure_file(config/config.h.in ${PROJECT_BINARY_DIR}/log4tango/include/log4tango/config.h) \ No newline at end of file diff --git a/log4tango/include/config.h.cmake b/log4tango/config/config.h.in similarity index 78% rename from log4tango/include/config.h.cmake rename to log4tango/config/config.h.in index e82211e6b..bac7627a5 100644 --- a/log4tango/include/config.h.cmake +++ b/log4tango/config/config.h.in @@ -1,56 +1,56 @@ /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_DLFCN_H +#cmakedefine LOG4TANGO_HAVE_DLFCN_H /* Define to 1 if you have the `ftime' function. */ -#cmakedefine HAVE_FTIME +#cmakedefine LOG4TANGO_HAVE_FTIME /* Define to 1 if you have the `gettimeofday' function. */ -#cmakedefine HAVE_GETTIMEOFDAY +#cmakedefine LOG4TANGO_HAVE_GETTIMEOFDAY /* define if the compiler has int64_t */ -#cmakedefine HAVE_INT64_T +#cmakedefine LOG4TANGO_HAVE_INT64_T /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_INTTYPES_H +#cmakedefine LOG4TANGO_HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_IO_H +#cmakedefine LOG4TANGO_HAVE_IO_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MEMORY_H +#cmakedefine LOG4TANGO_HAVE_MEMORY_H /* define if the compiler implements namespaces */ -#cmakedefine HAVE_NAMESPACES +#cmakedefine LOG4TANGO_HAVE_NAMESPACES /* define if the C library has snprintf */ -#cmakedefine HAVE_SNPRINTF +#cmakedefine LOG4TANGO_HAVE_SNPRINTF /* define if the compiler has stringstream */ -#cmakedefine HAVE_SSTREAM +#cmakedefine LOG4TANGO_HAVE_SSTREAM /* define if you have the header file. */ -#cmakedefine HAVE_STDINT_H +#cmakedefine LOG4TANGO_HAVE_STDINT_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDLIB_H +#cmakedefine LOG4TANGO_HAVE_STDLIB_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRINGS_H +#cmakedefine LOG4TANGO_HAVE_STRINGS_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRING_H +#cmakedefine LOG4TANGO_HAVE_STRING_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_STAT_H +#cmakedefine LOG4TANGO_HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TYPES_H +#cmakedefine LOG4TANGO_HAVE_SYS_TYPES_H /* define if threading is enabled */ -#cmakedefine HAVE_THREADING +#cmakedefine LOG4TANGO_HAVE_THREADING /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UNISTD_H +#cmakedefine LOG4TANGO_HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #cmakedefine LT_OBJDIR diff --git a/log4tango/include/CMakeLists.txt b/log4tango/include/CMakeLists.txt index 5b1b51caf..1f661a3b0 100644 --- a/log4tango/include/CMakeLists.txt +++ b/log4tango/include/CMakeLists.txt @@ -1,32 +1 @@ -include(CheckIncludeFile) -include(CheckFunctionExists) -include(FindThreads) - -#TODO config.h.in stamp-h.in -CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) -CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) -CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) -CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) -CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) -CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) -CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) -CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) -CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) - -#check function -CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) -CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) - -#check compiler feature - -#check threads -check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) -check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) -check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) -check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) - -configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/log4tango/include/log4tango/config.h) - add_subdirectory(log4tango) \ No newline at end of file From 5e8f4bd30c99c7ef1c277a2c2b11ca71ce4f4451 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 15:12:04 +0300 Subject: [PATCH 03/48] TANGO-678 progress: log4tango compiles --- log4tango/config/check_namespace.cpp | 9 +++++++++ log4tango/config/check_snprintf.cpp | 6 ++++++ log4tango/config/check_sstream.cpp | 8 +++----- log4tango/config/config.cmake | 25 ++++++++++++++++++++----- log4tango/config/config.h.in | 2 +- 5 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 log4tango/config/check_namespace.cpp create mode 100644 log4tango/config/check_snprintf.cpp diff --git a/log4tango/config/check_namespace.cpp b/log4tango/config/check_namespace.cpp new file mode 100644 index 000000000..fb399f347 --- /dev/null +++ b/log4tango/config/check_namespace.cpp @@ -0,0 +1,9 @@ +// +// Created by ingvord on 9/14/16. +// +namespace Outer { namespace Inner { int i = 0; }} +int main(int argc, char* argv[]) +{ + using namespace Outer::Inner; return i; +} + diff --git a/log4tango/config/check_snprintf.cpp b/log4tango/config/check_snprintf.cpp new file mode 100644 index 000000000..a278aa177 --- /dev/null +++ b/log4tango/config/check_snprintf.cpp @@ -0,0 +1,6 @@ +// +// Created by ingvord on 9/14/16. +// +#include +int main () { int l = snprintf(NULL,0,"%d",100); return (!((3 <= l) || (-1 == l))); } + diff --git a/log4tango/config/check_sstream.cpp b/log4tango/config/check_sstream.cpp index 984d56ec4..3cf5390c1 100644 --- a/log4tango/config/check_sstream.cpp +++ b/log4tango/config/check_sstream.cpp @@ -1,15 +1,13 @@ // // Created by ingvord on 9/13/16. // -#include +#include int main(int argc,char **arv) { - std::ostringstream oss; + std::stringstream ss; - oss << "Hello"; - - std::cout << oss << std::endl; + ss << "Hello"; return 0; } diff --git a/log4tango/config/config.cmake b/log4tango/config/config.cmake index c1f31865a..6fb74c100 100644 --- a/log4tango/config/config.cmake +++ b/log4tango/config/config.cmake @@ -34,13 +34,28 @@ check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) -#check compiler features -file(READ "config/check_sstream.cpp" SSTREAM_CHECK_SOURCE) -check_cxx_source_compiles("${SSTREAM_CHECK_SOURCE}" SSTREAM_CHECK) -if(NOT BIND_COMPILER_CHECK) - set(LOG4TANGO_HAVE_SSTREAM "/**/") +if(CMAKE_THREAD_LIBS_INIT) + set(LOG4TANGO_HAVE_THREADING "/**/") endif() +#check compiler features +macro (LOG4TANGO_CHECK_COMPILER_FEATURE source var) + file(READ "${source}" ${var}_CHECK_SOURCE) + check_cxx_source_compiles("${${var}_CHECK_SOURCE}" ${var}_CHECK) + if(${var}_CHECK) + set(LOG4TANGO_HAVE_${var} "/**/") + endif() +endmacro() + +#sstream +LOG4TANGO_CHECK_COMPILER_FEATURE("config/check_sstream.cpp" SSTREAM) + +#namespace +LOG4TANGO_CHECK_COMPILER_FEATURE("config/check_namespace.cpp" NAMESPACES) + +#snprintf +LOG4TANGO_CHECK_COMPILER_FEATURE("config/check_snprintf.cpp" SNPRINTF) + #check types check_type_size(int64_t INT64_SIZE) if(${INT64_SIZE} EQUAL 8) diff --git a/log4tango/config/config.h.in b/log4tango/config/config.h.in index bac7627a5..05a7f33d1 100644 --- a/log4tango/config/config.h.in +++ b/log4tango/config/config.h.in @@ -85,7 +85,7 @@ #cmakedefine HAVE_PTHREAD_CREATE 1 #cmakedefine HAVE_PTHREAD_NP_H 1 #if defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_CREATE) || defined(HAVE_PTHREAD_NP_H) -#define USE_PTHREADS 1 +#define LOG4TANGO_USE_PTHREADS 1 #endif /* Version number of package */ From 865aca0782a3e61329f77e3b7e41d18930443fd7 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 15:23:26 +0300 Subject: [PATCH 04/48] TANGO-678 progress: downgrade cmake minimum version; add c++11 flags --- CMakeLists.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57dc8901b..bedef8423 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 2.8) project(libtango) include(CTest) @@ -14,6 +14,26 @@ set (PACKAGE_URL "https://github.com/tango-controls/cppTango") set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") +# Initialize CXXFLAGS. +set(CMAKE_CXX_FLAGS "-Wall -std=c++11") +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + +# Compiler-specific C++11 activation. +if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + execute_process( + COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) + if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)) + message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.") + endif () +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +else () + message(FATAL_ERROR "Your C++ compiler does not support C++11.") +endif () + #source code add_subdirectory("log4tango") add_subdirectory("cppapi") From 17c7feb46c733047f5b6d90a7e03ed51f4d90ac1 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 16:03:04 +0300 Subject: [PATCH 05/48] TANGO-678 progress: libtango compiles --- CMakeLists.txt | 5 ++++- cppapi/server/jpeg_mmx/CMakeLists.txt | 2 ++ log4tango/CMakeLists.txt | 3 --- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bedef8423..2f4eec9d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") # Initialize CXXFLAGS. -set(CMAKE_CXX_FLAGS "-Wall -std=c++11") +set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -fPIC") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") @@ -34,6 +34,9 @@ else () message(FATAL_ERROR "Your C++ compiler does not support C++11.") endif () + +include_directories("log4tango/include") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") #source code add_subdirectory("log4tango") add_subdirectory("cppapi") diff --git a/cppapi/server/jpeg_mmx/CMakeLists.txt b/cppapi/server/jpeg_mmx/CMakeLists.txt index 762b3a151..2f085d761 100644 --- a/cppapi/server/jpeg_mmx/CMakeLists.txt +++ b/cppapi/server/jpeg_mmx/CMakeLists.txt @@ -1,3 +1,5 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../jpeg) + set(SOURCES jpeg_color_mmx.cpp jpeg_dct_mmx.cpp) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index 86034f7ff..df95988ab 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -9,9 +9,6 @@ set(LT_VERSION "5:1:0") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") -include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") - add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) \ No newline at end of file From 6900fad05f9703b685f100e9a55b8e710918eff0 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 18:10:06 +0300 Subject: [PATCH 06/48] TANGO-678 progress --- CMakeLists.txt | 29 +++-------- configure/CMakeLists.txt | 89 ++++++++++++++++++++++++++++++++ cpp_test_suite/CMakeLists.txt | 0 cppapi/CMakeLists.txt | 6 +-- cppapi/client/CMakeLists.txt | 3 +- cppapi/server/CMakeLists.txt | 5 +- cppapi/server/idl/CMakeLists.txt | 8 +++ log4tango/CMakeLists.txt | 2 + 8 files changed, 115 insertions(+), 27 deletions(-) create mode 100644 configure/CMakeLists.txt create mode 100644 cpp_test_suite/CMakeLists.txt create mode 100644 cppapi/server/idl/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f4eec9d4..c7e5b468e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,37 +14,24 @@ set (PACKAGE_URL "https://github.com/tango-controls/cppTango") set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") -# Initialize CXXFLAGS. -set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -fPIC") -set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") - -# Compiler-specific C++11 activation. -if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)) - message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.") - endif () -elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -else () - message(FATAL_ERROR "Your C++ compiler does not support C++11.") -endif () - +include(configure/CMakeLists.txt) +include_directories("cppapi/client") +include_directories("cppapi/client/helpers") +include_directories("cppapi/server") +include_directories("cppapi/server/idl") include_directories("log4tango/include") include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") #source code add_subdirectory("log4tango") add_subdirectory("cppapi") -#add_subdirectory("cpp_test_ds") #add_subdirectory("cpp_test_suite") +#add_subdirectory("cpp_test_ds") add_library(libtango SHARED $ $ + $ $ $ $) +target_link_libraries(libtango ) diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt new file mode 100644 index 000000000..c003826c3 --- /dev/null +++ b/configure/CMakeLists.txt @@ -0,0 +1,89 @@ +include(FindPkgConfig) + +#cNp from Make.rules +if(NOT TANGO_HOME) + set(TANGO_HOME /segfs/tango) + message("Using TANGO_HOME=${TANGO_HOME}") +endif() + +if(NOT ubuntu) + execute_process(COMMAND /csadmin/common/scripts/get_os.share + OUTPUT_VARIABLE OS) +endif() + +if(NOT OS) + if(dev) + set(OS ubuntu1404) + else() + set(OS ubuntu1204) + endif() +endif() + +if(NOT OS) + set(BIN_DIR ${OS}) + message("Using BIN_DIR=${BIN_DIR}") +endif() + +if(NOT BIN_DIR) + set(BIN_DIR ${OS}) + message("Using BIN_DIR=${BIN_DIR}") +endif() + +if(NOT OMNI_BASE) + set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/bin) + message("Using OMNI_BASE=${OMNI_BASE}") +endif() + +if(NOT ZMQ_BASE) + set(ZMQ_BASE ${TANGO_HOME}/transport/zmq4.0.5/bin) + message("Using ZMQ_BASE=${ZMQ_BASE}") +endif() + +#setup for GNU CXX compiler +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + message("found GNU compiler ...") + add_definitions(-g -Wall)#-Wextra -pedantic + if(CMAKE_BUILD_TYPE MATCHES RELEASE) + message("setup for release build ...") + add_definitions(-O3) + elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) + message("setup for debug build ...") + add_definitions(-O0) + add_definitions(-DDEBUG) + endif() + + add_definitions(-std=c++11) + add_definitions(-DGNU_CXX) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + message("found clang compiler...") + + add_definitions(-Wextra -pedantic -Wall) + if(CMAKE_BUILD_TYPE MATCHES RELEASE) + message("setup for release build ...") + add_definitions(-O3 -g) + elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) + message("setup for debug build ...") + add_definitions(-O0 -g -fno-inline -DDEBUG) + endif() + + #for this version the compiler has to support c++11 flag + add_definitions(-std=c++11) + add_definitions(-DCLANG_CXX) +endif() + +#find libraries +pkg_search_module(ZMQ_PKG REQUIRED libzmq) +if(NOT ZMQ_PKG_FOUND) + set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include) +endif() + +pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) +if(NOT OMNIORB_PKG_FOUND) + set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) +endif() + + + + diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 6b02764d4..6192812a8 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,7 +1,7 @@ -include_directories("client" "client/helpers") -include_directories("server" "server/idl") - +link_directories(${ZMQ_PKG_LIBRARY_DIRS} ${OMNIORB_PKG_LIBRARY_DIRS}) +include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) +add_definitions(-fPIC) add_subdirectory("client") add_subdirectory("server") diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index 0b618afbf..6d852e611 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,4 +57,5 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) -add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file +add_library(client_objects OBJECT ${SOURCES}) +target_compile_options(client_objects PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 154ceea59..1005d827d 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -57,7 +57,8 @@ set(SOURCES attrdesc.cpp w_pipe.cpp zmqeventsupplier.cpp) -add_subdirectory("jpeg") -add_subdirectory("jpeg_mmx") +add_subdirectory(idl) +add_subdirectory(jpeg) +add_subdirectory(jpeg_mmx) add_library(server_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt new file mode 100644 index 000000000..009b8e735 --- /dev/null +++ b/cppapi/server/idl/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SOURCES tangoSK.cpp + tangoDynSK.cpp) + +add_library(idl_objects OBJECT ${SOURCES}) +target_include_directories(idl_objects PUBLIC ${OMNIORB_PKG_INCLUDE_DIRS}) +target_compile_options(idl_objects PUBLIC ${OMNIORB_PKG_CFLAGS_OTHER}) + +#TODO install \ No newline at end of file diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index df95988ab..bf467bd1a 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -9,6 +9,8 @@ set(LT_VERSION "5:1:0") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) +add_definitions(-fPIC) + add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) \ No newline at end of file From aec75fa10abd601d9ae58ff00948e8e05f6e1afe Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 18:15:05 +0300 Subject: [PATCH 07/48] TANGO-678 progress: minor changes --- CMakeLists.txt | 2 ++ cppapi/CMakeLists.txt | 1 - cppapi/client/CMakeLists.txt | 3 +-- log4tango/CMakeLists.txt | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7e5b468e..b33db5c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") include(configure/CMakeLists.txt) +add_definitions(-fPIC) + include_directories("cppapi/client") include_directories("cppapi/client/helpers") include_directories("cppapi/server") diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 6192812a8..7922dceb0 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,7 +1,6 @@ link_directories(${ZMQ_PKG_LIBRARY_DIRS} ${OMNIORB_PKG_LIBRARY_DIRS}) include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) -add_definitions(-fPIC) add_subdirectory("client") add_subdirectory("server") diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index 6d852e611..0b618afbf 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,5 +57,4 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) -add_library(client_objects OBJECT ${SOURCES}) -target_compile_options(client_objects PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) \ No newline at end of file +add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index bf467bd1a..df95988ab 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -9,8 +9,6 @@ set(LT_VERSION "5:1:0") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) -add_definitions(-fPIC) - add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) \ No newline at end of file From a93c9375713319662a50742aa21760ea8b8fcbc1 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 22:19:08 +0300 Subject: [PATCH 08/48] TANGO-678 progress --- CMakeLists.txt | 13 ++++-- configure/CMakeLists.txt | 4 +- cppapi/CMakeLists.txt | 3 -- cppapi/server/CMakeLists.txt | 76 +++++++++++++++++++++++++++++++- cppapi/server/idl/CMakeLists.txt | 4 +- log4tango/tests/CMakeLists.txt | 4 +- 6 files changed, 90 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b33db5c1c..76c67a716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) project(libtango) include(CTest) +enable_testing() #need to define the version of the library set(MAJOR_VERSION "9") set(MINOR_VERSION "2") @@ -23,17 +24,23 @@ include_directories("cppapi/client/helpers") include_directories("cppapi/server") include_directories("cppapi/server/idl") include_directories("log4tango/include") +#required for generated config.h include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") +#externals +include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) #source code add_subdirectory("log4tango") add_subdirectory("cppapi") #add_subdirectory("cpp_test_suite") #add_subdirectory("cpp_test_ds") -add_library(libtango SHARED $ +add_library(tango SHARED $ $ - $ + #$ $ $ $) -target_link_libraries(libtango ) +target_link_libraries(tango PUBLIC ${ZMQ_PKG_LIBRARIES} ${OMNIORB_PKG_LIBRARIES}) +target_compile_options(tango PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) + +#install diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index c003826c3..3624c2a79 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -74,16 +74,16 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() #find libraries +#ZMQ pkg_search_module(ZMQ_PKG REQUIRED libzmq) if(NOT ZMQ_PKG_FOUND) set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include) endif() +#CORBA pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) if(NOT OMNIORB_PKG_FOUND) set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) endif() - - diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 7922dceb0..99da93d54 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,6 +1,3 @@ -link_directories(${ZMQ_PKG_LIBRARY_DIRS} ${OMNIORB_PKG_LIBRARY_DIRS}) -include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) - add_subdirectory("client") add_subdirectory("server") diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 1005d827d..524f52995 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -57,7 +57,81 @@ set(SOURCES attrdesc.cpp w_pipe.cpp zmqeventsupplier.cpp) -add_subdirectory(idl) +set(HEADERS attrdesc.h + attribute.h + attribute.tpp + attrsetval.tpp + attribute_spec.tpp + attrmanip.h + attrprop.h + attrprop.tpp + auto_tango_monitor.h + basiccommand.h + blackbox.h + classattribute.h + classpipe.h + command.h + pipe.h + pipe.tpp + coutappender.h + coutbuf.h + device.h + device_2.h + device_3.h + device_3.tpp + device_4.h + device_5.h + deviceclass.h + devintr.h + dintrthread.h + dserver.h + dserverclass.h + dserversignal.h + eventsupplier.h + except.h + fwdattrdesc.h + fwdattribute.h + fwdattribute.tpp + fwdattribute_spec.tpp + log4tango.h + logcmds.h + logging.h + logstream.h + multiattribute.h + ntservice.h + pipedesc.h + pollcmds.h + pollext.h + pollext.tpp + pollobj.h + pollring.h + pollring.tpp + pollthread.h + pollthread.tpp + readers_writers_lock.h + rootattreg.h + seqvec.h + tango.h + tango_config.h + tango_const.h + tango_monitor.h + tangoappender.h + tangorollingfileappender.h + utils.h + utils.tpp + utils_spec.tpp + w32win.h + w_attribute.h + w_attribute.tpp + w_attrsetval.tpp + w_attribute_spec.tpp + w_pipe.h + w_pipe.tpp + subdev_diag.h + encoded_attribute.h + encoded_format.h) + +#add_subdirectory(idl) add_subdirectory(jpeg) add_subdirectory(jpeg_mmx) diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt index 009b8e735..44d13493a 100644 --- a/cppapi/server/idl/CMakeLists.txt +++ b/cppapi/server/idl/CMakeLists.txt @@ -1,8 +1,6 @@ set(SOURCES tangoSK.cpp tangoDynSK.cpp) -add_library(idl_objects OBJECT ${SOURCES}) -target_include_directories(idl_objects PUBLIC ${OMNIORB_PKG_INCLUDE_DIRS}) -target_compile_options(idl_objects PUBLIC ${OMNIORB_PKG_CFLAGS_OTHER}) +add_library(idl_objects OBJECT ${SOURCES} tango.h) #TODO install \ No newline at end of file diff --git a/log4tango/tests/CMakeLists.txt b/log4tango/tests/CMakeLists.txt index f9421fffe..5c476dfec 100644 --- a/log4tango/tests/CMakeLists.txt +++ b/log4tango/tests/CMakeLists.txt @@ -4,5 +4,5 @@ set(BENCH_TEST_SOURCES clock.cpp clock.hh test_bench.cpp) add_executable(test_log4tango ${LOG4TANGO_TEST_SOURCES} $) add_executable(test_bench ${BENCH_TEST_SOURCES} $) -add_test("log4tango test" test_log4tango) -add_test("log4tango benchmark" test_bench) \ No newline at end of file +add_test("log4tango_test" test_log4tango) +add_test("log4tango_benchmark" test_bench) \ No newline at end of file From 08e74bd770f45825d7be0b3c7ca5306630590875 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 23:03:25 +0300 Subject: [PATCH 09/48] TANGO-678 progress --- CMakeLists.txt | 6 ++--- configure/CMakeLists.txt | 49 +++++++++++------------------------- cppapi/server/CMakeLists.txt | 2 +- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76c67a716..742e13caf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,6 @@ set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") include(configure/CMakeLists.txt) -add_definitions(-fPIC) - include_directories("cppapi/client") include_directories("cppapi/client/helpers") include_directories("cppapi/server") @@ -26,8 +24,10 @@ include_directories("cppapi/server/idl") include_directories("log4tango/include") #required for generated config.h include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") + #externals include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) + #source code add_subdirectory("log4tango") add_subdirectory("cppapi") @@ -36,7 +36,7 @@ add_subdirectory("cppapi") add_library(tango SHARED $ $ - #$ + $ $ $ $) diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 3624c2a79..c7d2ce318 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -39,40 +39,6 @@ if(NOT ZMQ_BASE) message("Using ZMQ_BASE=${ZMQ_BASE}") endif() -#setup for GNU CXX compiler -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - message("found GNU compiler ...") - add_definitions(-g -Wall)#-Wextra -pedantic - if(CMAKE_BUILD_TYPE MATCHES RELEASE) - message("setup for release build ...") - add_definitions(-O3) - elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) - message("setup for debug build ...") - add_definitions(-O0) - add_definitions(-DDEBUG) - endif() - - add_definitions(-std=c++11) - add_definitions(-DGNU_CXX) -endif() - -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - message("found clang compiler...") - - add_definitions(-Wextra -pedantic -Wall) - if(CMAKE_BUILD_TYPE MATCHES RELEASE) - message("setup for release build ...") - add_definitions(-O3 -g) - elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) - message("setup for debug build ...") - add_definitions(-O0 -g -fno-inline -DDEBUG) - endif() - - #for this version the compiler has to support c++11 flag - add_definitions(-std=c++11) - add_definitions(-DCLANG_CXX) -endif() - #find libraries #ZMQ pkg_search_module(ZMQ_PKG REQUIRED libzmq) @@ -86,4 +52,17 @@ if(NOT OMNIORB_PKG_FOUND) set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) 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) + else() + message("setup for debug build ...") + add_definitions(-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) +endif() \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 524f52995..23fdf374c 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -131,7 +131,7 @@ set(HEADERS attrdesc.h encoded_attribute.h encoded_format.h) -#add_subdirectory(idl) +add_subdirectory(idl) add_subdirectory(jpeg) add_subdirectory(jpeg_mmx) From e1ef1b77ea33fbc87e2a72b6fcc8bad4ce8b45fe Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 23:23:44 +0300 Subject: [PATCH 10/48] TANGO-678 progress: failed compilation temporary fix --- cppapi/server/idl/tangoDynSK.cpp | 2 +- cppapi/server/idl/tangoSK.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cppapi/server/idl/tangoDynSK.cpp b/cppapi/server/idl/tangoDynSK.cpp index d5763133c..677d83aa9 100644 --- a/cppapi/server/idl/tangoDynSK.cpp +++ b/cppapi/server/idl/tangoDynSK.cpp @@ -4,7 +4,7 @@ OMNI_USING_NAMESPACE(omni) -static const char* _0RL_dyn_library_version = omniORB_4_2_dyn; +//static const char* _0RL_dyn_library_version = omniORB_4_2_dyn; static ::CORBA::TypeCode::_Tracker _0RL_tcTrack(__FILE__); diff --git a/cppapi/server/idl/tangoSK.cpp b/cppapi/server/idl/tangoSK.cpp index c47610d94..d2fa6a436 100644 --- a/cppapi/server/idl/tangoSK.cpp +++ b/cppapi/server/idl/tangoSK.cpp @@ -10,7 +10,7 @@ OMNI_USING_NAMESPACE(omni) -static const char* _0RL_library_version = omniORB_4_2; +//static const char* _0RL_library_version = omniORB_4_2; From 134046318c69838b877e0cd9b5ef415f009db2b2 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 14:09:09 +0300 Subject: [PATCH 11/48] TANGO-678 progress: add cpp_test_suite --- CMakeLists.txt | 23 +++++------ configure/CMakeLists.txt | 6 +++ cpp_test_suite/CMakeLists.txt | 13 ++++++ cpp_test_suite/asyn/CMakeLists.txt | 17 ++++++++ cpp_test_suite/event/CMakeLists.txt | 29 +++++++++++++ cpp_test_suite/new_tests/CMakeLists.txt | 6 +++ cpp_test_suite/old_tests/CMakeLists.txt | 55 +++++++++++++++++++++++++ 7 files changed, 137 insertions(+), 12 deletions(-) create mode 100644 cpp_test_suite/asyn/CMakeLists.txt create mode 100644 cpp_test_suite/event/CMakeLists.txt create mode 100644 cpp_test_suite/new_tests/CMakeLists.txt create mode 100644 cpp_test_suite/old_tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 742e13caf..1fafb470c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,25 +13,23 @@ set(SO_VERSION "2") set (PACKAGE_URL "https://github.com/tango-controls/cppTango") set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") -set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") +set (PACKAGE_STRING "${CMAKE_PROJECT_NAME}-${LIBRARY_VERSION}") include(configure/CMakeLists.txt) -include_directories("cppapi/client") -include_directories("cppapi/client/helpers") -include_directories("cppapi/server") -include_directories("cppapi/server/idl") -include_directories("log4tango/include") +include_directories(cppapi/client) +include_directories(cppapi/client/helpers) +include_directories(cppapi/server) +include_directories(cppapi/server/idl) +include_directories(log4tango/include) #required for generated config.h -include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") +include_directories(${CMAKE_CURRENT_BINARY_DIR}/log4tango/include) -#externals -include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) #source code add_subdirectory("log4tango") add_subdirectory("cppapi") -#add_subdirectory("cpp_test_suite") +add_subdirectory("cpp_test_suite") #add_subdirectory("cpp_test_ds") add_library(tango SHARED $ @@ -40,7 +38,8 @@ add_library(tango SHARED $ $ $ $) -target_link_libraries(tango PUBLIC ${ZMQ_PKG_LIBRARIES} ${OMNIORB_PKG_LIBRARIES}) -target_compile_options(tango PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) +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}) #install diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index c7d2ce318..095bb2e43 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -52,6 +52,12 @@ if(NOT OMNIORB_PKG_FOUND) set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) endif() +#COS +pkg_search_module(OMNICOS_PKG REQUIRED omniCOS4) + +#dynamic CORBA +pkg_search_module(OMNIDYN_PKG REQUIRED omniDynamic4) + #setup for GNU CXX compiler if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message("found GNU compiler ...") diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt index e69de29bb..c4d6a231d 100644 --- a/cpp_test_suite/CMakeLists.txt +++ b/cpp_test_suite/CMakeLists.txt @@ -0,0 +1,13 @@ +macro(TEST_SUITE_ADD_TEST test) + message("Add test ${test}") + add_executable(${test} ${test}.cpp) + target_compile_definitions(${test} PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") + target_include_directories(${test} PUBLIC ../cxxtest/include) + target_link_libraries(${test} ${CMAKE_DL_LIBS} tango) + add_test(NAME "${test}" COMMAND $) +endmacro() + +add_subdirectory(asyn) +add_subdirectory(event) +#add_subdirectory(old_tests) +add_subdirectory(new_tests) \ No newline at end of file diff --git a/cpp_test_suite/asyn/CMakeLists.txt b/cpp_test_suite/asyn/CMakeLists.txt new file mode 100644 index 000000000..b2936c69a --- /dev/null +++ b/cpp_test_suite/asyn/CMakeLists.txt @@ -0,0 +1,17 @@ +set(TESTS asyn_attr_cb + asyn_attr + asyn_attr_multi + asyn_cb2 + asyn_cb_cmd + asyn_cb + asyn_cmd + asyn_faf + asyn_thread + asyn_write_attr + asyn_write_attr_multi + asyn_write_cb + auto_asyn_cmd) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file diff --git a/cpp_test_suite/event/CMakeLists.txt b/cpp_test_suite/event/CMakeLists.txt new file mode 100644 index 000000000..8e778954d --- /dev/null +++ b/cpp_test_suite/event/CMakeLists.txt @@ -0,0 +1,29 @@ +set(TESTS archive_event + att_conf_event + back_ch_event + change_event64 + change_event + data_ready_event + event_lock + multi_event + pipe_event + reco_svc + scan + state_event + user_event + att_conf_event_buffer + att_type_event + back_per_event + change_event_buffer + data_ready_event_buffer + dev_intr_event + multi_dev_event + per_event + reco_event + reco_zmq + server_event + stateless_sub) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt new file mode 100644 index 000000000..6e5c180af --- /dev/null +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -0,0 +1,6 @@ +set(TESTS conf_devtest + ) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file diff --git a/cpp_test_suite/old_tests/CMakeLists.txt b/cpp_test_suite/old_tests/CMakeLists.txt new file mode 100644 index 000000000..9133ca7b1 --- /dev/null +++ b/cpp_test_suite/old_tests/CMakeLists.txt @@ -0,0 +1,55 @@ +set(TESTS 64 + acc_right + add_rem_attr + add_rem_dev + allowed_cmd + att_conf + attr_conf_test + attr_manip + attr_misc + attr_proxy + attr_types + cmd_inout + cmd_types + ConfEventBugClient + copy_devproxy + ds_cache + helper + lock + locked_device + mem_att + misc_devattr + misc_devdata + misc_devproxy + multiple_new + new_devproxy + obj_prop + poll_attr + Poll + poll_except + poll_met + poll_pool + print_data + print_data_hist + prop_list + rds + read_attr + read_hist + read_hist_ext + reconnect_attr + reconnect + restart_device + ring_depth + size + state_attr + StopPoll + sub_dev + unlock + wait_mcast_dev + w_r_attr + write_attr_3 + write_attr) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file From 428b0e5c907a6d1a1faa162763c5cd4eb188a300 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 15:40:47 +0300 Subject: [PATCH 12/48] TANGO-678 progress: add cpp_test_suite/cxxtest --- cpp_test_suite/CMakeLists.txt | 5 +- cpp_test_suite/cxxtest/CMakeLists.txt | 72 +++++++++++++++++++++++++ cpp_test_suite/new_tests/CMakeLists.txt | 4 +- 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 cpp_test_suite/cxxtest/CMakeLists.txt diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt index c4d6a231d..a07b15f08 100644 --- a/cpp_test_suite/CMakeLists.txt +++ b/cpp_test_suite/CMakeLists.txt @@ -2,7 +2,7 @@ macro(TEST_SUITE_ADD_TEST test) message("Add test ${test}") add_executable(${test} ${test}.cpp) target_compile_definitions(${test} PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") - target_include_directories(${test} PUBLIC ../cxxtest/include) +# target_include_directories(${test} PUBLIC ../cxxtest/include) target_link_libraries(${test} ${CMAKE_DL_LIBS} tango) add_test(NAME "${test}" COMMAND $) endmacro() @@ -10,4 +10,5 @@ endmacro() add_subdirectory(asyn) add_subdirectory(event) #add_subdirectory(old_tests) -add_subdirectory(new_tests) \ No newline at end of file +add_subdirectory(new_tests) +add_subdirectory(cxxtest) \ No newline at end of file diff --git a/cpp_test_suite/cxxtest/CMakeLists.txt b/cpp_test_suite/cxxtest/CMakeLists.txt new file mode 100644 index 000000000..4260b478d --- /dev/null +++ b/cpp_test_suite/cxxtest/CMakeLists.txt @@ -0,0 +1,72 @@ +message("Generate runner.cpp") +execute_process(COMMAND python cxxtestgen.py --template=${CMAKE_CURRENT_SOURCE_DIR}/template/tango_template.tpl + -o ${CMAKE_CURRENT_SOURCE_DIR}/runner.cpp + ../../new_tests/cxx_syntax.cpp + ../../new_tests/cxx_poll.cpp + ../../new_tests/cxx_poll_admin.cpp + ../../new_tests/cxx_dserver_cmd.cpp + ../../new_tests/cxx_dserver_misc.cpp + ../../new_tests/cxx_always_hook.cpp + ../../new_tests/cxx_blackbox.cpp + ../../new_tests/cxx_attr_misc.cpp + ../../new_tests/cxx_attrprop.cpp + ../../new_tests/cxx_attr_write.cpp + ../../new_tests/cxx_attr_conf.cpp + ../../new_tests/cxx_attr.cpp + ../../new_tests/cxx_misc_util.cpp + ../../new_tests/cxx_templ_cmd.cpp + ../../new_tests/cxx_exception.cpp + ../../new_tests/cxx_cmd_query.cpp + ../../new_tests/cxx_seq_vec.cpp + ../../new_tests/cxx_test_state_on.cpp + ../../new_tests/cxx_misc.cpp + ../../new_tests/cxx_cmd_types.cpp + ../../new_tests/cxx_group.cpp + ../../new_tests/cxx_encoded.cpp + ../../new_tests/cxx_database.cpp + ../../new_tests/cxx_mem_attr.cpp + ../../new_tests/cxx_enum_att.cpp + ../../new_tests/cxx_write_attr_hard.cpp + ../../new_tests/cxx_fwd_att.cpp + ../../new_tests/cxx_pipe_conf.cpp + ../../new_tests/cxx_pipe.cpp + ../../new_tests/cxx_z00_dyn_cmd.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) + +add_executable(runner $ ${CMAKE_CURRENT_SOURCE_DIR}/runner.cpp) +target_include_directories(runner PUBLIC include) +target_link_libraries(runner PUBLIC ${CMAKE_DL_LIBS} tango) + +#TODO different OS +set(DEV1 "test/debian8/10") +set(DEV2 "test/debian8/11") +set(DEV3 "test/debian8/12") +set(FWD_DEV "test/fwd_debian8/10") +set(SERV_NAME "devTest") +set(INST_NAME "debian8") +set(DEV1_ALIAS "debian8_alias") +set(ATTR_ALIAS "debian8_attr_alias") +cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME) +set(FULL_HOSTNAME "${HOST_NAME}:10000") + +add_test("CXX::runner" runner + --device1=${DEV1} + --device2=${DEV2} + --device3=${DEV3} + --fwd_device=${FWD_DEV} + --loop=1 + --fulldsname=${SERV_NAME}/${INST_NAME} + --serverhost=${FULL_HOSTNAME} + --clienthost=${FULL_HOSTNAME} + --serverversion=5 + --docurl=http://www.tango-controls.org + --devtype=TestDevice + --dbserver=sys/database/2 + --outpath=/tmp/ + --refpath=${CMAKE_CURRENT_SOURCE_DIR}/../new_tests/out/ + --loglevel=0 + --dsloglevel=3 + --suiteloop=1 + --devicealias=${DEV1_ALIAS} + --attributealias=${ATTR_ALIAS} +) \ No newline at end of file diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt index 6e5c180af..59b14bf22 100644 --- a/cpp_test_suite/new_tests/CMakeLists.txt +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -3,4 +3,6 @@ set(TESTS conf_devtest foreach(TEST ${TESTS}) TEST_SUITE_ADD_TEST(${TEST}) -endforeach(TEST) \ No newline at end of file +endforeach(TEST) + +add_library(compare_test_object OBJECT compare_test.cpp compare_test.h) \ No newline at end of file From b027ad27685c9deadfa9ba5efc724cc814c869b5 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 16:10:55 +0300 Subject: [PATCH 13/48] TANGO-678 progress: add cpp_test_ds; devTest does not compile - missing IOLong.h --- CMakeLists.txt | 2 +- cpp_test_ds/CMakeLists.txt | 25 +++++++++++++++++++++++++ cpp_test_ds/fwd_ds/CMakeLists.txt | 9 +++++++++ cpp_test_suite/CMakeLists.txt | 14 +++++++++++++- cpp_test_suite/cxxtest/CMakeLists.txt | 13 +------------ 5 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 cpp_test_ds/CMakeLists.txt create mode 100644 cpp_test_ds/fwd_ds/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fafb470c..e877ba66a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/log4tango/include) add_subdirectory("log4tango") add_subdirectory("cppapi") add_subdirectory("cpp_test_suite") -#add_subdirectory("cpp_test_ds") +add_subdirectory("cpp_test_ds") add_library(tango SHARED $ $ diff --git a/cpp_test_ds/CMakeLists.txt b/cpp_test_ds/CMakeLists.txt new file mode 100644 index 000000000..49d5b7296 --- /dev/null +++ b/cpp_test_ds/CMakeLists.txt @@ -0,0 +1,25 @@ +set(SOURCES classfactory.cpp + DevTest.cpp + IOAddAttribute.cpp + IOArray2.cpp + IOMisc.cpp + IOSetAttr.cpp + IOStr2.cpp + IOStruct.cpp +# main_win.cpp + TypeCmds.cpp + DevTestClass.cpp + FileDb.cpp + IOArray1.cpp + IOLongVar.cpp + IOSeqVec.cpp + IOStr1.cpp + IOStrArray.cpp + main.cpp + SigThrow.cpp) + +add_subdirectory(fwd_ds) + +add_executable(devTest ${SOURCES}) +target_include_directories(devTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(devTest PUBLIC ${CMAKE_DL_LIBS} tango) diff --git a/cpp_test_ds/fwd_ds/CMakeLists.txt b/cpp_test_ds/fwd_ds/CMakeLists.txt new file mode 100644 index 000000000..e589c4386 --- /dev/null +++ b/cpp_test_ds/fwd_ds/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES ClassFactory.cpp + FwdTestClass.cpp + FwdTest.cpp + FwdTestStateMachine.cpp + main.cpp) + +add_executable(FwdTest ${SOURCES}) +target_include_directories(FwdTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(FwdTest PUBLIC ${CMAKE_DL_LIBS} tango) diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt index a07b15f08..1cd9cb3f5 100644 --- a/cpp_test_suite/CMakeLists.txt +++ b/cpp_test_suite/CMakeLists.txt @@ -1,10 +1,22 @@ +#TODO different OS +set(DEV1 "test/debian8/10") +set(DEV2 "test/debian8/11") +set(DEV3 "test/debian8/12") +set(FWD_DEV "test/fwd_debian8/10") +set(SERV_NAME "devTest") +set(INST_NAME "debian8") +set(DEV1_ALIAS "debian8_alias") +set(ATTR_ALIAS "debian8_attr_alias") +cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME) +set(FULL_HOSTNAME "${HOST_NAME}:10000") + macro(TEST_SUITE_ADD_TEST test) message("Add test ${test}") add_executable(${test} ${test}.cpp) target_compile_definitions(${test} PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") # target_include_directories(${test} PUBLIC ../cxxtest/include) target_link_libraries(${test} ${CMAKE_DL_LIBS} tango) - add_test(NAME "${test}" COMMAND $) + add_test(NAME "CPP::${test}" COMMAND $ ${DEV1}) endmacro() add_subdirectory(asyn) diff --git a/cpp_test_suite/cxxtest/CMakeLists.txt b/cpp_test_suite/cxxtest/CMakeLists.txt index 4260b478d..16fb2bd31 100644 --- a/cpp_test_suite/cxxtest/CMakeLists.txt +++ b/cpp_test_suite/cxxtest/CMakeLists.txt @@ -36,18 +36,7 @@ execute_process(COMMAND python cxxtestgen.py --template=${CMAKE_CURRENT_SOURCE_D add_executable(runner $ ${CMAKE_CURRENT_SOURCE_DIR}/runner.cpp) target_include_directories(runner PUBLIC include) target_link_libraries(runner PUBLIC ${CMAKE_DL_LIBS} tango) - -#TODO different OS -set(DEV1 "test/debian8/10") -set(DEV2 "test/debian8/11") -set(DEV3 "test/debian8/12") -set(FWD_DEV "test/fwd_debian8/10") -set(SERV_NAME "devTest") -set(INST_NAME "debian8") -set(DEV1_ALIAS "debian8_alias") -set(ATTR_ALIAS "debian8_attr_alias") -cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME) -set(FULL_HOSTNAME "${HOST_NAME}:10000") +target_compile_definitions(runner PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") add_test("CXX::runner" runner --device1=${DEV1} From 06566d7b8e77e6b7418c31af8eb5eb0a2bbb9357 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 17:29:39 +0300 Subject: [PATCH 14/48] TANGO-678 progress: install --- CMakeLists.txt | 17 +++++++++++++++-- configure/CMakeLists.txt | 4 +++- cppapi/client/CMakeLists.txt | 4 +++- cppapi/server/CMakeLists.txt | 4 +++- cppapi/server/idl/CMakeLists.txt | 2 +- log4tango/include/log4tango/CMakeLists.txt | 12 ++++++------ .../include/log4tango/threading/CMakeLists.txt | 2 +- tango.pc.cmake | 11 +++++++++++ 8 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 tango.pc.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e877ba66a..a1fe16d57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,10 @@ enable_testing() set(MAJOR_VERSION "9") set(MINOR_VERSION "2") set(PATCH_VERSION "5") + +#convenient versions set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") -set(SO_VERSION "2") +set(SO_VERSION "${MAJOR_VERSION}") set (PACKAGE_URL "https://github.com/tango-controls/cppTango") @@ -42,4 +44,15 @@ target_include_directories(tango PUBLIC ${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_IN 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}) -#install +set_target_properties(tango PROPERTIES + VERSION ${LIBRARY_VERSION} + SOVERSION ${SO_VERSION}) + +#install code +install(TARGETS tango LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") + +#TODO +#configure_file(tango.pc.cmake tango.pc @ONLY) + +#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" +# DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 095bb2e43..327b9992e 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -71,4 +71,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_definitions(-std=c++11) add_definitions(-DGNU_CXX -DOMNI_UNLOADABLE_STUBS -D_FORTIFY_SOURCE=2) add_definitions(-fPIC) -endif() \ No newline at end of file +endif() + +include(GNUInstallDirs) \ No newline at end of file diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index 0b618afbf..be2d1a3fb 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,4 +57,6 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) -add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file +add_library(client_objects OBJECT ${SOURCES}) + +install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 23fdf374c..794e15c03 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -135,4 +135,6 @@ add_subdirectory(idl) add_subdirectory(jpeg) add_subdirectory(jpeg_mmx) -add_library(server_objects OBJECT ${SOURCES}) \ No newline at end of file +add_library(server_objects OBJECT ${SOURCES}) + +install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt index 44d13493a..5f8aa1a8f 100644 --- a/cppapi/server/idl/CMakeLists.txt +++ b/cppapi/server/idl/CMakeLists.txt @@ -3,4 +3,4 @@ set(SOURCES tangoSK.cpp add_library(idl_objects OBJECT ${SOURCES} tango.h) -#TODO install \ No newline at end of file +#TODO generate source code from idl \ No newline at end of file diff --git a/log4tango/include/log4tango/CMakeLists.txt b/log4tango/include/log4tango/CMakeLists.txt index 538b6c1b3..3b32cf48e 100644 --- a/log4tango/include/log4tango/CMakeLists.txt +++ b/log4tango/include/log4tango/CMakeLists.txt @@ -19,11 +19,11 @@ set(HEADER_FILES TimeStamp.hh Filter.hh Export.hh - Portability.hh - config.h - config-win32.h) + Portability.hh) -install(FILES ${HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango) +add_subdirectory(threading) -add_subdirectory(threading) \ No newline at end of file +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/log4tango) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/log4tango) +#TODO if windows 32 install config-win32.h \ No newline at end of file diff --git a/log4tango/include/log4tango/threading/CMakeLists.txt b/log4tango/include/log4tango/threading/CMakeLists.txt index 8f1fe8272..71f3669f2 100644 --- a/log4tango/include/log4tango/threading/CMakeLists.txt +++ b/log4tango/include/log4tango/threading/CMakeLists.txt @@ -5,4 +5,4 @@ set(HEADER_FILES Threading.hh) install(FILES ${HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango/threading) \ No newline at end of file + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/log4tango/threading) \ No newline at end of file diff --git a/tango.pc.cmake b/tango.pc.cmake new file mode 100644 index 000000000..d9aff0550 --- /dev/null +++ b/tango.pc.cmake @@ -0,0 +1,11 @@ +prefix = @CMAKE_INSTALL_PREFIX@ +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${prefix}/@CMAKE_INSTALL_LIBDIR@ + +Name: @CMAKE_PROJECT_NAME@ +Description: Tango client/server API library +Version: @LIBRARY_VERSION@ +Cflags: -I${includedir} +Requires: libzmq omniORB4 omniCOS4 omniDynamic4 +Libs: -L${libdir} -ltango \ No newline at end of file From a689c1d0e561e291efd01959280339aa42a70b8b Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 17:33:10 +0300 Subject: [PATCH 15/48] TANGO-678 progress: install idl header --- cppapi/server/idl/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt index 5f8aa1a8f..7683100e1 100644 --- a/cppapi/server/idl/CMakeLists.txt +++ b/cppapi/server/idl/CMakeLists.txt @@ -3,4 +3,6 @@ set(SOURCES tangoSK.cpp add_library(idl_objects OBJECT ${SOURCES} tango.h) -#TODO generate source code from idl \ No newline at end of file +#TODO generate source code from idl + +install(FILES tango.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/idl") \ No newline at end of file From 4c7d5d28eaf6ddcbaa13084f2a3e04aeeeccd355 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 10:24:30 +0300 Subject: [PATCH 16/48] TANGO-678 progress: fix devTest compilation failure --- cpp_test_ds/CMakeLists.txt | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/cpp_test_ds/CMakeLists.txt b/cpp_test_ds/CMakeLists.txt index 49d5b7296..d09944dde 100644 --- a/cpp_test_ds/CMakeLists.txt +++ b/cpp_test_ds/CMakeLists.txt @@ -1,22 +1,20 @@ -set(SOURCES classfactory.cpp - DevTest.cpp - IOAddAttribute.cpp - IOArray2.cpp +set(SOURCES main.cpp + TypeCmds.cpp + SigThrow.cpp IOMisc.cpp - IOSetAttr.cpp + IOStr1.cpp IOStr2.cpp - IOStruct.cpp -# main_win.cpp - TypeCmds.cpp - DevTestClass.cpp - FileDb.cpp IOArray1.cpp - IOLongVar.cpp - IOSeqVec.cpp - IOStr1.cpp + IOArray2.cpp IOStrArray.cpp - main.cpp - SigThrow.cpp) + IOStruct.cpp + IOSetAttr.cpp + IOAddAttribute.cpp + IOSeqVec.cpp + FileDb.cpp + classfactory.cpp + DevTestClass.cpp + DevTest.cpp) add_subdirectory(fwd_ds) From e364199ea7c46ffe93366430e88824ef58aac793 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 10:35:45 +0300 Subject: [PATCH 17/48] TANGO-678 progress: minor changes --- CMakeLists.txt | 7 +- cpp_test_ds/IOLongVar.cpp | 85 ------------------------- cpp_test_suite/new_tests/CMakeLists.txt | 8 +-- tango.pc.cmake | 2 +- 4 files changed, 5 insertions(+), 97 deletions(-) delete mode 100644 cpp_test_ds/IOLongVar.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index a1fe16d57..e02cce67b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,7 @@ set_target_properties(tango PROPERTIES #install code install(TARGETS tango LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") -#TODO -#configure_file(tango.pc.cmake tango.pc @ONLY) +configure_file(tango.pc.cmake tango.pc @ONLY) -#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" -# DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") diff --git a/cpp_test_ds/IOLongVar.cpp b/cpp_test_ds/IOLongVar.cpp deleted file mode 100644 index 13cd0c845..000000000 --- a/cpp_test_ds/IOLongVar.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "IOLong.h" - -//+---------------------------------------------------------------------------- -// -// method : IOLong::IOLong() -// -// description : constructor for the IOLong command of the -// DevTest. -// -// In : - name : The command name -// - in : The input parameter type -// - out : The output parameter type -// - in_desc : The input parameter description -// - out_desc : The output parameter description -// -//----------------------------------------------------------------------------- - -IOLong::IOLong(const char *name,Tango_CmdArgType in, - Tango_CmdArgType out,const char *in_desc, - const char *out_desc) -:Command(name,in,out,in_desc,out_desc) -{ -} - -//+---------------------------------------------------------------------------- -// -// method : IOLong::is_allowed() -// -// description : method to test whether command is allowed or not in this -// state. In this case, the command is allowed only if -// the device is in ON state -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : boolean - true == is allowed , false == not allowed -// -//----------------------------------------------------------------------------- - -bool IOLong::is_allowed(DeviceImpl *device, const CORBA_Any &in_any) -{ - -// -// command allowed only if the device is on -// - - if (device->get_state() == Tango_ON) - return(true); - else - return(false); -} - -//+---------------------------------------------------------------------------- -// -// method : IOLong::execute() -// -// description : method to trigger the execution of the IOLong -// command -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- - - -CORBA_Any *IOLong::execute(DeviceImpl *device,const CORBA_Any &in_any) -{ - try { - Tango_DevLong theNumber; - extract(in_any,theNumber); - cout << "[IOLong::execute] received number " << theNumber << endl; - theNumber = theNumber * 2; - cout << "[IOLong::execute] return number " << theNumber << endl; - return insert(theNumber); - } - catch (CORBA_Exception &e) - { - Tango::Except::print_exception(e); - throw ; - } -} - - diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt index 59b14bf22..d4eda463c 100644 --- a/cpp_test_suite/new_tests/CMakeLists.txt +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -1,8 +1,2 @@ -set(TESTS conf_devtest - ) - -foreach(TEST ${TESTS}) - TEST_SUITE_ADD_TEST(${TEST}) -endforeach(TEST) - +add_executable(conf_devtest conf_devtest.cpp) add_library(compare_test_object OBJECT compare_test.cpp compare_test.h) \ No newline at end of file diff --git a/tango.pc.cmake b/tango.pc.cmake index d9aff0550..1260febd4 100644 --- a/tango.pc.cmake +++ b/tango.pc.cmake @@ -8,4 +8,4 @@ Description: Tango client/server API library Version: @LIBRARY_VERSION@ Cflags: -I${includedir} Requires: libzmq omniORB4 omniCOS4 omniDynamic4 -Libs: -L${libdir} -ltango \ No newline at end of file +Libs: -L${libdir} -ltango -lzmq -lomniORB4 -lomnithread -lCOS4 -lomniDynamic4 \ No newline at end of file From a3f212163024b7ee76102c2b762f7c607ce9f611 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 11:06:32 +0300 Subject: [PATCH 18/48] TANGO-678 progress: add doc target --- cppapi/CMakeLists.txt | 5 +++-- cppapi/doxygen/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 cppapi/doxygen/CMakeLists.txt diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 99da93d54..aaaea6e97 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,5 +1,6 @@ -add_subdirectory("client") -add_subdirectory("server") +add_subdirectory(doxygen) +add_subdirectory(client) +add_subdirectory(server) #link_libraries() diff --git a/cppapi/doxygen/CMakeLists.txt b/cppapi/doxygen/CMakeLists.txt new file mode 100644 index 000000000..89b1b8e2c --- /dev/null +++ b/cppapi/doxygen/CMakeLists.txt @@ -0,0 +1,3 @@ +add_custom_target(doc doxygen ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../server + SOURCES Doxyfile) \ No newline at end of file From 5c2ea6c1ccf3ee3a9171b0a790458da36ac3373d Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 11:07:08 +0300 Subject: [PATCH 19/48] TANGO-678 progress: fix missing headers in installation --- cppapi/client/CMakeLists.txt | 2 ++ cppapi/client/helpers/CMakeLists.txt | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 cppapi/client/helpers/CMakeLists.txt diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index be2d1a3fb..e7d4ab161 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,6 +57,8 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) +add_subdirectory(helpers) + add_library(client_objects OBJECT ${SOURCES}) install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file diff --git a/cppapi/client/helpers/CMakeLists.txt b/cppapi/client/helpers/CMakeLists.txt new file mode 100644 index 000000000..e54af39b7 --- /dev/null +++ b/cppapi/client/helpers/CMakeLists.txt @@ -0,0 +1,6 @@ +set(HELPERS DeviceProxyHelper.h + PogoHelper.h + TangoExceptionsHelper.h + Xstring.h) + +install(FILES ${HELPERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file From 60ce939fab1e9bb2c6972ed358deb7b9419a9545 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 11:39:01 +0300 Subject: [PATCH 20/48] TANGO-678 progress: add readme; use XXX_BASE over pkg-config if present --- CMakeLists.txt | 2 +- README.md | 6 +++ configure/CMakeLists.txt | 54 ++++++++++++++----------- cpp_test_suite/new_tests/CMakeLists.txt | 1 + 4 files changed, 39 insertions(+), 24 deletions(-) create mode 100644 README.md diff --git a/CMakeLists.txt b/CMakeLists.txt index e02cce67b..5c3303919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ add_subdirectory("cppapi") add_subdirectory("cpp_test_suite") add_subdirectory("cpp_test_ds") -add_library(tango SHARED $ +add_library(tango SHARED $ $ $ $ diff --git a/README.md b/README.md new file mode 100644 index 000000000..db2df96df --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Welcome + +# How to build and install using cmake + +`mkdir build; cd build; cmake .. [-DCMAKE_INSTALL_PREFIX=] [-DOMNI_BASE=] [-DZMQ_BASE=] [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG]; make; make install` + diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 327b9992e..5cc3e5761 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -1,5 +1,10 @@ include(FindPkgConfig) +if(NOT CMAKE_BUILD_TYPE) + message("No build type specified - default is DEBUG") + set(CMAKE_BUILD_TYPE DEBUG) +endif() + #cNp from Make.rules if(NOT TANGO_HOME) set(TANGO_HOME /segfs/tango) @@ -21,7 +26,7 @@ endif() if(NOT OS) set(BIN_DIR ${OS}) - message("Using BIN_DIR=${BIN_DIR}") + message("Using OS=${OS}") endif() if(NOT BIN_DIR) @@ -29,35 +34,38 @@ if(NOT BIN_DIR) message("Using BIN_DIR=${BIN_DIR}") endif() -if(NOT OMNI_BASE) - set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/bin) +if(OMNI_BASE) + set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/${BIN_DIR}) + set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) + set(OMNICOS_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) + set(OMNIDYN_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) + set(OMNIORB_PKG_LIBRARIES "-lomniORB4 -lomnithread -lCOS4 -lomniDynamic4") + link_directories(${OMNI_BASE}/lib) message("Using OMNI_BASE=${OMNI_BASE}") +else() + #CORBA + pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) + #COS + pkg_search_module(OMNICOS_PKG REQUIRED omniCOS4) + #dynamic CORBA + pkg_search_module(OMNIDYN_PKG REQUIRED omniDynamic4) + if(NOT OMNIORB_PKG_FOUND) + message(FATAL "omniORB4 library is required for Tango") + endif() endif() -if(NOT ZMQ_BASE) - set(ZMQ_BASE ${TANGO_HOME}/transport/zmq4.0.5/bin) +if(ZMQ_BASE) message("Using ZMQ_BASE=${ZMQ_BASE}") -endif() - -#find libraries -#ZMQ -pkg_search_module(ZMQ_PKG REQUIRED libzmq) -if(NOT ZMQ_PKG_FOUND) set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include) + set(ZMQ_PKG_LIBRARIES "-lzmq") + link_directories(${ZMQ_BASE}/lib) +else() + pkg_search_module(ZMQ_PKG REQUIRED libzmq) + if(NOT ZMQ_PKG_FOUND) + message(FATAL "ZMQ library is required for Tango") + endif() endif() -#CORBA -pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) -if(NOT OMNIORB_PKG_FOUND) - set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) -endif() - -#COS -pkg_search_module(OMNICOS_PKG REQUIRED omniCOS4) - -#dynamic CORBA -pkg_search_module(OMNIDYN_PKG REQUIRED omniDynamic4) - #setup for GNU CXX compiler if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message("found GNU compiler ...") diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt index d4eda463c..65a26a8b4 100644 --- a/cpp_test_suite/new_tests/CMakeLists.txt +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -1,2 +1,3 @@ add_executable(conf_devtest conf_devtest.cpp) +target_link_libraries(conf_devtest PUBLIC ${CMAKE_DL_LIBS} tango) add_library(compare_test_object OBJECT compare_test.cpp compare_test.h) \ No newline at end of file From 61ff4c0f8a6e67f84f2be98bd292b1870e75076b Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 12:04:11 +0300 Subject: [PATCH 21/48] TANGO-678 progress: fix cmake configuration for ESRF --- configure/CMakeLists.txt | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 5cc3e5761..b21ee8879 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -5,43 +5,12 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE DEBUG) endif() -#cNp from Make.rules -if(NOT TANGO_HOME) - set(TANGO_HOME /segfs/tango) - message("Using TANGO_HOME=${TANGO_HOME}") -endif() - -if(NOT ubuntu) - execute_process(COMMAND /csadmin/common/scripts/get_os.share - OUTPUT_VARIABLE OS) -endif() - -if(NOT OS) - if(dev) - set(OS ubuntu1404) - else() - set(OS ubuntu1204) - endif() -endif() - -if(NOT OS) - set(BIN_DIR ${OS}) - message("Using OS=${OS}") -endif() - -if(NOT BIN_DIR) - set(BIN_DIR ${OS}) - message("Using BIN_DIR=${BIN_DIR}") -endif() - if(OMNI_BASE) - set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/${BIN_DIR}) + message("Using OMNI_BASE=${OMNI_BASE}") set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) - set(OMNICOS_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) - set(OMNIDYN_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) set(OMNIORB_PKG_LIBRARIES "-lomniORB4 -lomnithread -lCOS4 -lomniDynamic4") + include_directories(${OMNI_BASE}/include) link_directories(${OMNI_BASE}/lib) - message("Using OMNI_BASE=${OMNI_BASE}") else() #CORBA pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) From 13dd752965d88ecb43e4b04fbe166043102407c1 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 12:05:39 +0300 Subject: [PATCH 22/48] TANGO-678 progress: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db2df96df..9231f00fc 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,5 @@ # How to build and install using cmake -`mkdir build; cd build; cmake .. [-DCMAKE_INSTALL_PREFIX=] [-DOMNI_BASE=] [-DZMQ_BASE=] [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG]; make; make install` +`mkdir build; cd build; cmake .. [-DCMAKE_INSTALL_PREFIX=] [-DOMNI_BASE=] [-DZMQ_BASE=] [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_VERBOSE_MAKEFILE=true]; make; make install` From 2b56ca4ea99e2aec5c2e25f6c9b7e27a43fc62bc Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 12:56:17 +0300 Subject: [PATCH 23/48] TANGO-678 progress: fix compilation warning related to PACKAGE_URL being overridden --- CMakeLists.txt | 5 ----- log4tango/CMakeLists.txt | 3 ++- log4tango/src/CMakeLists.txt | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c3303919..2eb779d1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,11 +12,6 @@ set(PATCH_VERSION "5") set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") set(SO_VERSION "${MAJOR_VERSION}") - -set (PACKAGE_URL "https://github.com/tango-controls/cppTango") -set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") -set (PACKAGE_STRING "${CMAKE_PROJECT_NAME}-${LIBRARY_VERSION}") - include(configure/CMakeLists.txt) include_directories(cppapi/client) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index df95988ab..d5e9fc42e 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -5,7 +5,8 @@ # ? :+1 : ? == just some internal changes, nothing breaks but might work # better # CURRENT : REVISION : AGE -set(LT_VERSION "5:1:0") +set (LOG4TANGO_PACKAGE_URL "https://github.com/tango-controls/cppTango/log4tango") +set (LOG4TANGO_PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) diff --git a/log4tango/src/CMakeLists.txt b/log4tango/src/CMakeLists.txt index e10ce35c0..091813f12 100644 --- a/log4tango/src/CMakeLists.txt +++ b/log4tango/src/CMakeLists.txt @@ -25,6 +25,4 @@ set(SOURCES PortabilityImpl.hh PortabilityImpl.cpp) -add_library(log4tango_objects OBJECT ${SOURCES}) - -#target_link_libraries(log4tango_objects -version-info ${LT_VERSION}) \ No newline at end of file +add_library(log4tango_objects OBJECT ${SOURCES}) \ No newline at end of file From f66d6ee7b81809d2d49ed7403c49cf7722de757a Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 13:58:46 +0300 Subject: [PATCH 24/48] TANGO-678 progress: fix compilation warning related to PACKAGE_URL being overridden --- log4tango/config/config.h.in | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/log4tango/config/config.h.in b/log4tango/config/config.h.in index 05a7f33d1..db1d25b0b 100644 --- a/log4tango/config/config.h.in +++ b/log4tango/config/config.h.in @@ -52,32 +52,14 @@ /* Define to 1 if you have the header file. */ #cmakedefine LOG4TANGO_HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. */ -#cmakedefine LT_OBJDIR - -/* Name of package */ -#cmakedefine PACKAGE "${CMAKE_PROJECT_NAME}" - /* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" - -/* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "${CMAKE_PROJECT_NAME}" - -/* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" - -/* Define to the one symbol short name of this package. */ -#cmakedefine PACKAGE_TARNAME +#cmakedefine LOG4TANGO_PACKAGE_BUGREPORT "@LOG4TANGO_PACKAGE_BUGREPORT@" /* Define to the home page for this package. */ -#cmakedefine PACKAGE_URL "@PACKAGE_URL@" +#cmakedefine LOG4TANGO_PACKAGE_URL "@LOG4TANGO_PACKAGE_URL@" /* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "${LIBRARY_VERSION}" - -/* Define to 1 if you have the ANSI C header files. */ -#cmakedefine STDC_HEADERS +#cmakedefine LOG4TANGO_PACKAGE_VERSION "${LIBRARY_VERSION}" /* define if pthread library is available */ #cmakedefine HAVE_PTHREAD_ATTR_GET_NP 1 @@ -89,7 +71,7 @@ #endif /* Version number of package */ -#cmakedefine VERSION "@LIBRARY_VERSION@" +#cmakedefine LOG4TANGO_VERSION "@LIBRARY_VERSION@" /* If we're running on darwin/MacOsX */ #cmakedefine __darwin__ From a5972484dd21ce117aacba290692c1d574cc19f8 Mon Sep 17 00:00:00 2001 From: ingvord Date: Tue, 13 Sep 2016 17:53:25 +0300 Subject: [PATCH 25/48] TANGO-678 progress (migrate to cmake) --- CMakeLists.txt | 27 +++++ cppapi/CMakeLists.txt | 12 +++ cppapi/client/CMakeLists.txt | 60 ++++++++++++ cppapi/server/CMakeLists.txt | 63 ++++++++++++ cppapi/server/jpeg/CMakeLists.txt | 8 ++ cppapi/server/jpeg_mmx/CMakeLists.txt | 5 + log4tango/CMakeLists.txt | 15 +++ log4tango/include/CMakeLists.txt | 32 ++++++ log4tango/include/config.h.cmake | 98 +++++++++++++++++++ log4tango/include/log4tango/CMakeLists.txt | 29 ++++++ .../log4tango/threading/CMakeLists.txt | 8 ++ log4tango/src/CMakeLists.txt | 30 ++++++ log4tango/tests/CMakeLists.txt | 8 ++ 13 files changed, 395 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cppapi/CMakeLists.txt create mode 100644 cppapi/client/CMakeLists.txt create mode 100644 cppapi/server/CMakeLists.txt create mode 100644 cppapi/server/jpeg/CMakeLists.txt create mode 100644 cppapi/server/jpeg_mmx/CMakeLists.txt create mode 100644 log4tango/CMakeLists.txt create mode 100644 log4tango/include/CMakeLists.txt create mode 100644 log4tango/include/config.h.cmake create mode 100644 log4tango/include/log4tango/CMakeLists.txt create mode 100644 log4tango/include/log4tango/threading/CMakeLists.txt create mode 100644 log4tango/src/CMakeLists.txt create mode 100644 log4tango/tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..57dc8901b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.0) +project(libtango) +include(CTest) + +#need to define the version of the library +set(MAJOR_VERSION "9") +set(MINOR_VERSION "2") +set(PATCH_VERSION "5") +set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") +set(SO_VERSION "2") + + +set (PACKAGE_URL "https://github.com/tango-controls/cppTango") +set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") +set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") + +#source code +add_subdirectory("log4tango") +add_subdirectory("cppapi") +#add_subdirectory("cpp_test_ds") +#add_subdirectory("cpp_test_suite") + +add_library(libtango SHARED $ + $ + $ + $ + $) diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt new file mode 100644 index 000000000..6b02764d4 --- /dev/null +++ b/cppapi/CMakeLists.txt @@ -0,0 +1,12 @@ +include_directories("client" "client/helpers") +include_directories("server" "server/idl") + + +add_subdirectory("client") +add_subdirectory("server") + + +#link_libraries() + +#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" +# DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") \ No newline at end of file diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt new file mode 100644 index 000000000..0b618afbf --- /dev/null +++ b/cppapi/client/CMakeLists.txt @@ -0,0 +1,60 @@ +set(SOURCES dbapi_class.cpp + dbapi_server.cpp + dbapi_datum.cpp + dbapi_base.cpp + dbapi_device.cpp + dbapi_history.cpp + dbapi_attribute.cpp + dbapi_cache.cpp + dbapi_serverdata.cpp + devapi_attr.cpp + devapi_base.cpp + devapi_data.cpp + devapi_datahist.cpp + devapi_utils.cpp + devapi_pipe.cpp + api_util.cpp + asynreq.cpp + cbthread.cpp + proxy_asyn.cpp + proxy_asyn_cb.cpp + attr_proxy.cpp + group.cpp + filedatabase.cpp + apiexcept.cpp + accessproxy.cpp + lockthread.cpp + event.cpp + eventkeepalive.cpp + eventqueue.cpp + notifdeventconsumer.cpp + zmqeventconsumer.cpp) + +set(HEADERS accessproxy.h + apiexcept.h + cbthread.h + dbapi.h + devapi.h + devasyn.h + event.h + eventconsumer.h + filedatabase.h + group.h + lockthread.h + Database.h + DbDevice.h + ApiUtil.h + DeviceData.h + DeviceAttribute.h + DevicePipe.h + Connection.h + DeviceProxy.h + AttributeProxy.h + event.tpp + devapi_attr.tpp + devapi_utils.tpp + api_util.tpp + devapi_pipe.tpp + zmq.hpp) + +add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt new file mode 100644 index 000000000..154ceea59 --- /dev/null +++ b/cppapi/server/CMakeLists.txt @@ -0,0 +1,63 @@ +set(SOURCES attrdesc.cpp + attrgetsetprop.cpp + attribute.cpp + attrsetval.cpp + attrmanip.cpp + basiccommand.cpp + blackbox.cpp + class_factory.cpp + classattribute.cpp + command.cpp + coutappender.cpp + classpipe.cpp + dev_event.cpp + dev_poll.cpp + device.cpp + device_2.cpp + device_3.cpp + device_4.cpp + device_5.cpp + deviceclass.cpp + devicelog.cpp + devintr.cpp + dintrthread.cpp + dserver.cpp + dserverclass.cpp + dserverlock.cpp + dserverlog.cpp + dserverpoll.cpp + dserversignal.cpp + encoded_attribute.cpp + eventcmds.cpp + eventsupplier.cpp + except.cpp + fwdattrdesc.cpp + fwdattribute.cpp + logcmds.cpp + logging.cpp + logstream.cpp + multiattribute.cpp + notifdeventsupplier.cpp + pipe.cpp + pollcmds.cpp + pollobj.cpp + pollring.cpp + pollthread.cpp + rootattreg.cpp + seqvec.cpp + subdev_diag.cpp + tangoappender.cpp + tangorollingfileappender.cpp + templ_inst.cpp + thsig.cpp + utils.cpp + utils_polling.cpp + utils_shut.cpp + w_attribute.cpp + w_pipe.cpp + zmqeventsupplier.cpp) + +add_subdirectory("jpeg") +add_subdirectory("jpeg_mmx") + +add_library(server_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/cppapi/server/jpeg/CMakeLists.txt b/cppapi/server/jpeg/CMakeLists.txt new file mode 100644 index 000000000..d1160fd59 --- /dev/null +++ b/cppapi/server/jpeg/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SOURCES jpeg_bitstream.cpp + jpeg_color.cpp + jpeg_dct.cpp + jpeg_decoder.cpp + jpeg_encoder.cpp + jpeg_memory.cpp) + +add_library(jpeg_objects OBJECT ${SOURCES}) diff --git a/cppapi/server/jpeg_mmx/CMakeLists.txt b/cppapi/server/jpeg_mmx/CMakeLists.txt new file mode 100644 index 000000000..762b3a151 --- /dev/null +++ b/cppapi/server/jpeg_mmx/CMakeLists.txt @@ -0,0 +1,5 @@ +set(SOURCES + jpeg_color_mmx.cpp + jpeg_dct_mmx.cpp) + +add_library(jpeg_mmx_objects OBJECT ${SOURCES}) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt new file mode 100644 index 000000000..2333ff515 --- /dev/null +++ b/log4tango/CMakeLists.txt @@ -0,0 +1,15 @@ +# +# +1 : ? : +1 == new interface that does not break old one +# +1 : ? : 0 == new interface that breaks old one +# ? : ? : 0 == no new interfaces, but breaks apps +# ? :+1 : ? == just some internal changes, nothing breaks but might work +# better +# CURRENT : REVISION : AGE +set(LT_VERSION "5:1:0") + +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") + +add_subdirectory(include) +add_subdirectory(src) +add_subdirectory(tests) \ No newline at end of file diff --git a/log4tango/include/CMakeLists.txt b/log4tango/include/CMakeLists.txt new file mode 100644 index 000000000..5b1b51caf --- /dev/null +++ b/log4tango/include/CMakeLists.txt @@ -0,0 +1,32 @@ +include(CheckIncludeFile) +include(CheckFunctionExists) +include(FindThreads) + +#TODO config.h.in stamp-h.in +CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) +CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) +CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) + +#check function +CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) +CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) + +#check compiler feature + +#check threads +check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) +check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) +check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) +check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) + +configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/log4tango/include/log4tango/config.h) + +add_subdirectory(log4tango) \ No newline at end of file diff --git a/log4tango/include/config.h.cmake b/log4tango/include/config.h.cmake new file mode 100644 index 000000000..e82211e6b --- /dev/null +++ b/log4tango/include/config.h.cmake @@ -0,0 +1,98 @@ +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_DLFCN_H + +/* Define to 1 if you have the `ftime' function. */ +#cmakedefine HAVE_FTIME + +/* Define to 1 if you have the `gettimeofday' function. */ +#cmakedefine HAVE_GETTIMEOFDAY + +/* define if the compiler has int64_t */ +#cmakedefine HAVE_INT64_T + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_IO_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_MEMORY_H + +/* define if the compiler implements namespaces */ +#cmakedefine HAVE_NAMESPACES + +/* define if the C library has snprintf */ +#cmakedefine HAVE_SNPRINTF + +/* define if the compiler has stringstream */ +#cmakedefine HAVE_SSTREAM + +/* define if you have the header file. */ +#cmakedefine HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_TYPES_H + +/* define if threading is enabled */ +#cmakedefine HAVE_THREADING + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. */ +#cmakedefine LT_OBJDIR + +/* Name of package */ +#cmakedefine PACKAGE "${CMAKE_PROJECT_NAME}" + +/* Define to the address where bug reports for this package should be sent. */ +#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" + +/* Define to the full name of this package. */ +#cmakedefine PACKAGE_NAME "${CMAKE_PROJECT_NAME}" + +/* Define to the full name and version of this package. */ +#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" + +/* Define to the one symbol short name of this package. */ +#cmakedefine PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#cmakedefine PACKAGE_URL "@PACKAGE_URL@" + +/* Define to the version of this package. */ +#cmakedefine PACKAGE_VERSION "${LIBRARY_VERSION}" + +/* Define to 1 if you have the ANSI C header files. */ +#cmakedefine STDC_HEADERS + +/* define if pthread library is available */ +#cmakedefine HAVE_PTHREAD_ATTR_GET_NP 1 +#cmakedefine HAVE_PTHREAD_GETATTR_NP 1 +#cmakedefine HAVE_PTHREAD_CREATE 1 +#cmakedefine HAVE_PTHREAD_NP_H 1 +#if defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_CREATE) || defined(HAVE_PTHREAD_NP_H) +#define USE_PTHREADS 1 +#endif + +/* Version number of package */ +#cmakedefine VERSION "@LIBRARY_VERSION@" + +/* If we're running on darwin/MacOsX */ +#cmakedefine __darwin__ + +/* If we're running on FreeBSD */ +#cmakedefine __freebsd__ \ No newline at end of file diff --git a/log4tango/include/log4tango/CMakeLists.txt b/log4tango/include/log4tango/CMakeLists.txt new file mode 100644 index 000000000..538b6c1b3 --- /dev/null +++ b/log4tango/include/log4tango/CMakeLists.txt @@ -0,0 +1,29 @@ +set(HEADER_FILES + Appender.hh + AppenderAttachable.hh + LayoutAppender.hh + FileAppender.hh + RollingFileAppender.hh + OstreamAppender.hh + Layout.hh + PatternLayout.hh + XmlLayout.hh + Logger.hh + LogSeparator.hh + LoggerStream.hh + LogStream.hh + LogStreambuf.hh + LoggingEvent.hh + Level.hh + NDC.hh + TimeStamp.hh + Filter.hh + Export.hh + Portability.hh + config.h + config-win32.h) + +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango) + +add_subdirectory(threading) \ No newline at end of file diff --git a/log4tango/include/log4tango/threading/CMakeLists.txt b/log4tango/include/log4tango/threading/CMakeLists.txt new file mode 100644 index 000000000..8f1fe8272 --- /dev/null +++ b/log4tango/include/log4tango/threading/CMakeLists.txt @@ -0,0 +1,8 @@ +set(HEADER_FILES + DummyThreads.hh + PThreads.hh + MSThreads.hh + Threading.hh) + +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango/threading) \ No newline at end of file diff --git a/log4tango/src/CMakeLists.txt b/log4tango/src/CMakeLists.txt new file mode 100644 index 000000000..e10ce35c0 --- /dev/null +++ b/log4tango/src/CMakeLists.txt @@ -0,0 +1,30 @@ +set(SOURCES + Appender.cpp + AppenderAttachable.cpp + LayoutAppender.cpp + FileAppender.cpp + RollingFileAppender.cpp + OstreamAppender.cpp + Layout.cpp + PatternLayout.cpp + XmlLayout.cpp + Logger.cpp + LogSeparator.cpp + LoggerStream.cpp + LoggingEvent.cpp + Level.cpp + NDC.cpp + Filter.cpp + TimeStamp.cpp + StringUtil.hh + StringUtil.cpp + DllMain.cpp + DummyThreads.cpp + MSThreads.cpp + PThreads.cpp + PortabilityImpl.hh + PortabilityImpl.cpp) + +add_library(log4tango_objects OBJECT ${SOURCES}) + +#target_link_libraries(log4tango_objects -version-info ${LT_VERSION}) \ No newline at end of file diff --git a/log4tango/tests/CMakeLists.txt b/log4tango/tests/CMakeLists.txt new file mode 100644 index 000000000..f9421fffe --- /dev/null +++ b/log4tango/tests/CMakeLists.txt @@ -0,0 +1,8 @@ +set(LOG4TANGO_TEST_SOURCES test_log4tango.cpp) +set(BENCH_TEST_SOURCES clock.cpp clock.hh test_bench.cpp) + +add_executable(test_log4tango ${LOG4TANGO_TEST_SOURCES} $) +add_executable(test_bench ${BENCH_TEST_SOURCES} $) + +add_test("log4tango test" test_log4tango) +add_test("log4tango benchmark" test_bench) \ No newline at end of file From 894179c376bfccabb93c3e1530abd3623019ad94 Mon Sep 17 00:00:00 2001 From: ingvord Date: Tue, 13 Sep 2016 21:30:56 +0300 Subject: [PATCH 26/48] TANGO-678 progress (migrate to cmake) --- log4tango/CMakeLists.txt | 2 + log4tango/config/check_sstream.cpp | 16 ++++++ log4tango/config/config.cmake | 51 +++++++++++++++++++ .../config.h.cmake => config/config.h.in} | 36 ++++++------- log4tango/include/CMakeLists.txt | 31 ----------- 5 files changed, 87 insertions(+), 49 deletions(-) create mode 100644 log4tango/config/check_sstream.cpp create mode 100644 log4tango/config/config.cmake rename log4tango/{include/config.h.cmake => config/config.h.in} (78%) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index 2333ff515..86034f7ff 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -7,6 +7,8 @@ # CURRENT : REVISION : AGE set(LT_VERSION "5:1:0") +include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) + include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") diff --git a/log4tango/config/check_sstream.cpp b/log4tango/config/check_sstream.cpp new file mode 100644 index 000000000..984d56ec4 --- /dev/null +++ b/log4tango/config/check_sstream.cpp @@ -0,0 +1,16 @@ +// +// Created by ingvord on 9/13/16. +// +#include + +int main(int argc,char **arv) +{ + std::ostringstream oss; + + oss << "Hello"; + + std::cout << oss << std::endl; + + return 0; +} + diff --git a/log4tango/config/config.cmake b/log4tango/config/config.cmake new file mode 100644 index 000000000..c1f31865a --- /dev/null +++ b/log4tango/config/config.cmake @@ -0,0 +1,51 @@ +include(CheckIncludeFile) +include(CheckFunctionExists) +include(FindThreads) +include(CheckCXXSourceCompiles) +include(CheckTypeSize) + +macro (LOG4TANGO_CHECK_INCLUDE_FILE header var) + CHECK_INCLUDE_FILE("${header}" LOG4TANGO_${var} ) +endmacro() + +LOG4TANGO_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) +LOG4TANGO_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) +LOG4TANGO_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) +LOG4TANGO_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) +LOG4TANGO_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) +LOG4TANGO_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) +LOG4TANGO_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) +LOG4TANGO_CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) +LOG4TANGO_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) +LOG4TANGO_CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) +LOG4TANGO_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) + +macro (LOG4TANGO_CHECK_FUNCTION_EXISTS function var) + CHECK_FUNCTION_EXISTS("${function}" LOG4TANGO_${var} ) +endmacro() +#check function +LOG4TANGO_CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) +LOG4TANGO_CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) + + +#check threads +check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) +check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) +check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) +check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) + +#check compiler features +file(READ "config/check_sstream.cpp" SSTREAM_CHECK_SOURCE) +check_cxx_source_compiles("${SSTREAM_CHECK_SOURCE}" SSTREAM_CHECK) +if(NOT BIND_COMPILER_CHECK) + set(LOG4TANGO_HAVE_SSTREAM "/**/") +endif() + +#check types +check_type_size(int64_t INT64_SIZE) +if(${INT64_SIZE} EQUAL 8) + set(LOG4TANGO_HAVE_INT64_T "/**/") +endif() + + +configure_file(config/config.h.in ${PROJECT_BINARY_DIR}/log4tango/include/log4tango/config.h) \ No newline at end of file diff --git a/log4tango/include/config.h.cmake b/log4tango/config/config.h.in similarity index 78% rename from log4tango/include/config.h.cmake rename to log4tango/config/config.h.in index e82211e6b..bac7627a5 100644 --- a/log4tango/include/config.h.cmake +++ b/log4tango/config/config.h.in @@ -1,56 +1,56 @@ /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_DLFCN_H +#cmakedefine LOG4TANGO_HAVE_DLFCN_H /* Define to 1 if you have the `ftime' function. */ -#cmakedefine HAVE_FTIME +#cmakedefine LOG4TANGO_HAVE_FTIME /* Define to 1 if you have the `gettimeofday' function. */ -#cmakedefine HAVE_GETTIMEOFDAY +#cmakedefine LOG4TANGO_HAVE_GETTIMEOFDAY /* define if the compiler has int64_t */ -#cmakedefine HAVE_INT64_T +#cmakedefine LOG4TANGO_HAVE_INT64_T /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_INTTYPES_H +#cmakedefine LOG4TANGO_HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_IO_H +#cmakedefine LOG4TANGO_HAVE_IO_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MEMORY_H +#cmakedefine LOG4TANGO_HAVE_MEMORY_H /* define if the compiler implements namespaces */ -#cmakedefine HAVE_NAMESPACES +#cmakedefine LOG4TANGO_HAVE_NAMESPACES /* define if the C library has snprintf */ -#cmakedefine HAVE_SNPRINTF +#cmakedefine LOG4TANGO_HAVE_SNPRINTF /* define if the compiler has stringstream */ -#cmakedefine HAVE_SSTREAM +#cmakedefine LOG4TANGO_HAVE_SSTREAM /* define if you have the header file. */ -#cmakedefine HAVE_STDINT_H +#cmakedefine LOG4TANGO_HAVE_STDINT_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STDLIB_H +#cmakedefine LOG4TANGO_HAVE_STDLIB_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRINGS_H +#cmakedefine LOG4TANGO_HAVE_STRINGS_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_STRING_H +#cmakedefine LOG4TANGO_HAVE_STRING_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_STAT_H +#cmakedefine LOG4TANGO_HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TYPES_H +#cmakedefine LOG4TANGO_HAVE_SYS_TYPES_H /* define if threading is enabled */ -#cmakedefine HAVE_THREADING +#cmakedefine LOG4TANGO_HAVE_THREADING /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UNISTD_H +#cmakedefine LOG4TANGO_HAVE_UNISTD_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #cmakedefine LT_OBJDIR diff --git a/log4tango/include/CMakeLists.txt b/log4tango/include/CMakeLists.txt index 5b1b51caf..1f661a3b0 100644 --- a/log4tango/include/CMakeLists.txt +++ b/log4tango/include/CMakeLists.txt @@ -1,32 +1 @@ -include(CheckIncludeFile) -include(CheckFunctionExists) -include(FindThreads) - -#TODO config.h.in stamp-h.in -CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) -CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE("io.h" HAVE_IO_H) -CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H) -CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) -CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) -CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H) -CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H) -CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H) -CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H) - -#check function -CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) -CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) - -#check compiler feature - -#check threads -check_library_exists(pthread pthread_attr_get_np "" HAVE_PTHREAD_ATTR_GET_NP) -check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) -check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) -check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) - -configure_file(config.h.cmake ${PROJECT_BINARY_DIR}/log4tango/include/log4tango/config.h) - add_subdirectory(log4tango) \ No newline at end of file From d5bcd70dfb522fa3c78062b085df3c9d5816c26d Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 15:12:04 +0300 Subject: [PATCH 27/48] TANGO-678 progress: log4tango compiles --- log4tango/config/check_namespace.cpp | 9 +++++++++ log4tango/config/check_snprintf.cpp | 6 ++++++ log4tango/config/check_sstream.cpp | 8 +++----- log4tango/config/config.cmake | 25 ++++++++++++++++++++----- log4tango/config/config.h.in | 2 +- 5 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 log4tango/config/check_namespace.cpp create mode 100644 log4tango/config/check_snprintf.cpp diff --git a/log4tango/config/check_namespace.cpp b/log4tango/config/check_namespace.cpp new file mode 100644 index 000000000..fb399f347 --- /dev/null +++ b/log4tango/config/check_namespace.cpp @@ -0,0 +1,9 @@ +// +// Created by ingvord on 9/14/16. +// +namespace Outer { namespace Inner { int i = 0; }} +int main(int argc, char* argv[]) +{ + using namespace Outer::Inner; return i; +} + diff --git a/log4tango/config/check_snprintf.cpp b/log4tango/config/check_snprintf.cpp new file mode 100644 index 000000000..a278aa177 --- /dev/null +++ b/log4tango/config/check_snprintf.cpp @@ -0,0 +1,6 @@ +// +// Created by ingvord on 9/14/16. +// +#include +int main () { int l = snprintf(NULL,0,"%d",100); return (!((3 <= l) || (-1 == l))); } + diff --git a/log4tango/config/check_sstream.cpp b/log4tango/config/check_sstream.cpp index 984d56ec4..3cf5390c1 100644 --- a/log4tango/config/check_sstream.cpp +++ b/log4tango/config/check_sstream.cpp @@ -1,15 +1,13 @@ // // Created by ingvord on 9/13/16. // -#include +#include int main(int argc,char **arv) { - std::ostringstream oss; + std::stringstream ss; - oss << "Hello"; - - std::cout << oss << std::endl; + ss << "Hello"; return 0; } diff --git a/log4tango/config/config.cmake b/log4tango/config/config.cmake index c1f31865a..6fb74c100 100644 --- a/log4tango/config/config.cmake +++ b/log4tango/config/config.cmake @@ -34,13 +34,28 @@ check_library_exists(pthread pthread_getattr_np "" HAVE_PTHREAD_GETATTR_NP) check_library_exists(pthread pthread_create "" HAVE_PTHREAD_CREATE) check_include_file("pthread.h;pthread_np.h" HAVE_PTHREAD_NP_H) -#check compiler features -file(READ "config/check_sstream.cpp" SSTREAM_CHECK_SOURCE) -check_cxx_source_compiles("${SSTREAM_CHECK_SOURCE}" SSTREAM_CHECK) -if(NOT BIND_COMPILER_CHECK) - set(LOG4TANGO_HAVE_SSTREAM "/**/") +if(CMAKE_THREAD_LIBS_INIT) + set(LOG4TANGO_HAVE_THREADING "/**/") endif() +#check compiler features +macro (LOG4TANGO_CHECK_COMPILER_FEATURE source var) + file(READ "${source}" ${var}_CHECK_SOURCE) + check_cxx_source_compiles("${${var}_CHECK_SOURCE}" ${var}_CHECK) + if(${var}_CHECK) + set(LOG4TANGO_HAVE_${var} "/**/") + endif() +endmacro() + +#sstream +LOG4TANGO_CHECK_COMPILER_FEATURE("config/check_sstream.cpp" SSTREAM) + +#namespace +LOG4TANGO_CHECK_COMPILER_FEATURE("config/check_namespace.cpp" NAMESPACES) + +#snprintf +LOG4TANGO_CHECK_COMPILER_FEATURE("config/check_snprintf.cpp" SNPRINTF) + #check types check_type_size(int64_t INT64_SIZE) if(${INT64_SIZE} EQUAL 8) diff --git a/log4tango/config/config.h.in b/log4tango/config/config.h.in index bac7627a5..05a7f33d1 100644 --- a/log4tango/config/config.h.in +++ b/log4tango/config/config.h.in @@ -85,7 +85,7 @@ #cmakedefine HAVE_PTHREAD_CREATE 1 #cmakedefine HAVE_PTHREAD_NP_H 1 #if defined(HAVE_PTHREAD_ATTR_GET_NP) || defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_CREATE) || defined(HAVE_PTHREAD_NP_H) -#define USE_PTHREADS 1 +#define LOG4TANGO_USE_PTHREADS 1 #endif /* Version number of package */ From 8c6393c420e7579410feb99589fc2d407328ef0c Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 15:23:26 +0300 Subject: [PATCH 28/48] TANGO-678 progress: downgrade cmake minimum version; add c++11 flags --- CMakeLists.txt | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57dc8901b..bedef8423 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 2.8) project(libtango) include(CTest) @@ -14,6 +14,26 @@ set (PACKAGE_URL "https://github.com/tango-controls/cppTango") set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") +# Initialize CXXFLAGS. +set(CMAKE_CXX_FLAGS "-Wall -std=c++11") +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") +set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + +# Compiler-specific C++11 activation. +if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + execute_process( + COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) + if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)) + message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.") + endif () +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +else () + message(FATAL_ERROR "Your C++ compiler does not support C++11.") +endif () + #source code add_subdirectory("log4tango") add_subdirectory("cppapi") From c2256a6f4ff53843235e47bb0f2cd841cd8b4954 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 16:03:04 +0300 Subject: [PATCH 29/48] TANGO-678 progress: libtango compiles --- CMakeLists.txt | 5 ++++- cppapi/server/jpeg_mmx/CMakeLists.txt | 2 ++ log4tango/CMakeLists.txt | 3 --- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bedef8423..2f4eec9d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") # Initialize CXXFLAGS. -set(CMAKE_CXX_FLAGS "-Wall -std=c++11") +set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -fPIC") set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") @@ -34,6 +34,9 @@ else () message(FATAL_ERROR "Your C++ compiler does not support C++11.") endif () + +include_directories("log4tango/include") +include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") #source code add_subdirectory("log4tango") add_subdirectory("cppapi") diff --git a/cppapi/server/jpeg_mmx/CMakeLists.txt b/cppapi/server/jpeg_mmx/CMakeLists.txt index 762b3a151..2f085d761 100644 --- a/cppapi/server/jpeg_mmx/CMakeLists.txt +++ b/cppapi/server/jpeg_mmx/CMakeLists.txt @@ -1,3 +1,5 @@ +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../jpeg) + set(SOURCES jpeg_color_mmx.cpp jpeg_dct_mmx.cpp) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index 86034f7ff..df95988ab 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -9,9 +9,6 @@ set(LT_VERSION "5:1:0") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include") -include_directories("${CMAKE_CURRENT_BINARY_DIR}/include") - add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) \ No newline at end of file From f784d49d3845e7328292452eb5d1e5f07b1f2d09 Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 18:10:06 +0300 Subject: [PATCH 30/48] TANGO-678 progress --- CMakeLists.txt | 29 +++-------- configure/CMakeLists.txt | 89 ++++++++++++++++++++++++++++++++ cpp_test_suite/CMakeLists.txt | 0 cppapi/CMakeLists.txt | 6 +-- cppapi/client/CMakeLists.txt | 3 +- cppapi/server/CMakeLists.txt | 5 +- cppapi/server/idl/CMakeLists.txt | 8 +++ log4tango/CMakeLists.txt | 2 + 8 files changed, 115 insertions(+), 27 deletions(-) create mode 100644 configure/CMakeLists.txt create mode 100644 cpp_test_suite/CMakeLists.txt create mode 100644 cppapi/server/idl/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f4eec9d4..c7e5b468e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,37 +14,24 @@ set (PACKAGE_URL "https://github.com/tango-controls/cppTango") set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") -# Initialize CXXFLAGS. -set(CMAKE_CXX_FLAGS "-Wall -std=c++11 -fPIC") -set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") -set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") - -# Compiler-specific C++11 activation. -if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") - execute_process( - COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) - if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)) - message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.") - endif () -elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -else () - message(FATAL_ERROR "Your C++ compiler does not support C++11.") -endif () - +include(configure/CMakeLists.txt) +include_directories("cppapi/client") +include_directories("cppapi/client/helpers") +include_directories("cppapi/server") +include_directories("cppapi/server/idl") include_directories("log4tango/include") include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") #source code add_subdirectory("log4tango") add_subdirectory("cppapi") -#add_subdirectory("cpp_test_ds") #add_subdirectory("cpp_test_suite") +#add_subdirectory("cpp_test_ds") add_library(libtango SHARED $ $ + $ $ $ $) +target_link_libraries(libtango ) diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt new file mode 100644 index 000000000..c003826c3 --- /dev/null +++ b/configure/CMakeLists.txt @@ -0,0 +1,89 @@ +include(FindPkgConfig) + +#cNp from Make.rules +if(NOT TANGO_HOME) + set(TANGO_HOME /segfs/tango) + message("Using TANGO_HOME=${TANGO_HOME}") +endif() + +if(NOT ubuntu) + execute_process(COMMAND /csadmin/common/scripts/get_os.share + OUTPUT_VARIABLE OS) +endif() + +if(NOT OS) + if(dev) + set(OS ubuntu1404) + else() + set(OS ubuntu1204) + endif() +endif() + +if(NOT OS) + set(BIN_DIR ${OS}) + message("Using BIN_DIR=${BIN_DIR}") +endif() + +if(NOT BIN_DIR) + set(BIN_DIR ${OS}) + message("Using BIN_DIR=${BIN_DIR}") +endif() + +if(NOT OMNI_BASE) + set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/bin) + message("Using OMNI_BASE=${OMNI_BASE}") +endif() + +if(NOT ZMQ_BASE) + set(ZMQ_BASE ${TANGO_HOME}/transport/zmq4.0.5/bin) + message("Using ZMQ_BASE=${ZMQ_BASE}") +endif() + +#setup for GNU CXX compiler +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + message("found GNU compiler ...") + add_definitions(-g -Wall)#-Wextra -pedantic + if(CMAKE_BUILD_TYPE MATCHES RELEASE) + message("setup for release build ...") + add_definitions(-O3) + elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) + message("setup for debug build ...") + add_definitions(-O0) + add_definitions(-DDEBUG) + endif() + + add_definitions(-std=c++11) + add_definitions(-DGNU_CXX) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + message("found clang compiler...") + + add_definitions(-Wextra -pedantic -Wall) + if(CMAKE_BUILD_TYPE MATCHES RELEASE) + message("setup for release build ...") + add_definitions(-O3 -g) + elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) + message("setup for debug build ...") + add_definitions(-O0 -g -fno-inline -DDEBUG) + endif() + + #for this version the compiler has to support c++11 flag + add_definitions(-std=c++11) + add_definitions(-DCLANG_CXX) +endif() + +#find libraries +pkg_search_module(ZMQ_PKG REQUIRED libzmq) +if(NOT ZMQ_PKG_FOUND) + set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include) +endif() + +pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) +if(NOT OMNIORB_PKG_FOUND) + set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) +endif() + + + + diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt new file mode 100644 index 000000000..e69de29bb diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 6b02764d4..6192812a8 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,7 +1,7 @@ -include_directories("client" "client/helpers") -include_directories("server" "server/idl") - +link_directories(${ZMQ_PKG_LIBRARY_DIRS} ${OMNIORB_PKG_LIBRARY_DIRS}) +include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) +add_definitions(-fPIC) add_subdirectory("client") add_subdirectory("server") diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index 0b618afbf..6d852e611 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,4 +57,5 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) -add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file +add_library(client_objects OBJECT ${SOURCES}) +target_compile_options(client_objects PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 154ceea59..1005d827d 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -57,7 +57,8 @@ set(SOURCES attrdesc.cpp w_pipe.cpp zmqeventsupplier.cpp) -add_subdirectory("jpeg") -add_subdirectory("jpeg_mmx") +add_subdirectory(idl) +add_subdirectory(jpeg) +add_subdirectory(jpeg_mmx) add_library(server_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt new file mode 100644 index 000000000..009b8e735 --- /dev/null +++ b/cppapi/server/idl/CMakeLists.txt @@ -0,0 +1,8 @@ +set(SOURCES tangoSK.cpp + tangoDynSK.cpp) + +add_library(idl_objects OBJECT ${SOURCES}) +target_include_directories(idl_objects PUBLIC ${OMNIORB_PKG_INCLUDE_DIRS}) +target_compile_options(idl_objects PUBLIC ${OMNIORB_PKG_CFLAGS_OTHER}) + +#TODO install \ No newline at end of file diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index df95988ab..bf467bd1a 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -9,6 +9,8 @@ set(LT_VERSION "5:1:0") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) +add_definitions(-fPIC) + add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) \ No newline at end of file From bc9b93cd1d95c68d77eb438c80eabb505fab3d2f Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 18:15:05 +0300 Subject: [PATCH 31/48] TANGO-678 progress: minor changes --- CMakeLists.txt | 2 ++ cppapi/CMakeLists.txt | 1 - cppapi/client/CMakeLists.txt | 3 +-- log4tango/CMakeLists.txt | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7e5b468e..b33db5c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") include(configure/CMakeLists.txt) +add_definitions(-fPIC) + include_directories("cppapi/client") include_directories("cppapi/client/helpers") include_directories("cppapi/server") diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 6192812a8..7922dceb0 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,7 +1,6 @@ link_directories(${ZMQ_PKG_LIBRARY_DIRS} ${OMNIORB_PKG_LIBRARY_DIRS}) include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) -add_definitions(-fPIC) add_subdirectory("client") add_subdirectory("server") diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index 6d852e611..0b618afbf 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,5 +57,4 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) -add_library(client_objects OBJECT ${SOURCES}) -target_compile_options(client_objects PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) \ No newline at end of file +add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index bf467bd1a..df95988ab 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -9,8 +9,6 @@ set(LT_VERSION "5:1:0") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) -add_definitions(-fPIC) - add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) \ No newline at end of file From 68047984b19b86fad4fd9842387f4c498ddab77a Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 22:19:08 +0300 Subject: [PATCH 32/48] TANGO-678 progress --- CMakeLists.txt | 13 ++++-- configure/CMakeLists.txt | 4 +- cppapi/CMakeLists.txt | 3 -- cppapi/server/CMakeLists.txt | 76 +++++++++++++++++++++++++++++++- cppapi/server/idl/CMakeLists.txt | 4 +- log4tango/tests/CMakeLists.txt | 4 +- 6 files changed, 90 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b33db5c1c..76c67a716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8) project(libtango) include(CTest) +enable_testing() #need to define the version of the library set(MAJOR_VERSION "9") set(MINOR_VERSION "2") @@ -23,17 +24,23 @@ include_directories("cppapi/client/helpers") include_directories("cppapi/server") include_directories("cppapi/server/idl") include_directories("log4tango/include") +#required for generated config.h include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") +#externals +include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) #source code add_subdirectory("log4tango") add_subdirectory("cppapi") #add_subdirectory("cpp_test_suite") #add_subdirectory("cpp_test_ds") -add_library(libtango SHARED $ +add_library(tango SHARED $ $ - $ + #$ $ $ $) -target_link_libraries(libtango ) +target_link_libraries(tango PUBLIC ${ZMQ_PKG_LIBRARIES} ${OMNIORB_PKG_LIBRARIES}) +target_compile_options(tango PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) + +#install diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index c003826c3..3624c2a79 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -74,16 +74,16 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") endif() #find libraries +#ZMQ pkg_search_module(ZMQ_PKG REQUIRED libzmq) if(NOT ZMQ_PKG_FOUND) set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include) endif() +#CORBA pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) if(NOT OMNIORB_PKG_FOUND) set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) endif() - - diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 7922dceb0..99da93d54 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,6 +1,3 @@ -link_directories(${ZMQ_PKG_LIBRARY_DIRS} ${OMNIORB_PKG_LIBRARY_DIRS}) -include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) - add_subdirectory("client") add_subdirectory("server") diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 1005d827d..524f52995 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -57,7 +57,81 @@ set(SOURCES attrdesc.cpp w_pipe.cpp zmqeventsupplier.cpp) -add_subdirectory(idl) +set(HEADERS attrdesc.h + attribute.h + attribute.tpp + attrsetval.tpp + attribute_spec.tpp + attrmanip.h + attrprop.h + attrprop.tpp + auto_tango_monitor.h + basiccommand.h + blackbox.h + classattribute.h + classpipe.h + command.h + pipe.h + pipe.tpp + coutappender.h + coutbuf.h + device.h + device_2.h + device_3.h + device_3.tpp + device_4.h + device_5.h + deviceclass.h + devintr.h + dintrthread.h + dserver.h + dserverclass.h + dserversignal.h + eventsupplier.h + except.h + fwdattrdesc.h + fwdattribute.h + fwdattribute.tpp + fwdattribute_spec.tpp + log4tango.h + logcmds.h + logging.h + logstream.h + multiattribute.h + ntservice.h + pipedesc.h + pollcmds.h + pollext.h + pollext.tpp + pollobj.h + pollring.h + pollring.tpp + pollthread.h + pollthread.tpp + readers_writers_lock.h + rootattreg.h + seqvec.h + tango.h + tango_config.h + tango_const.h + tango_monitor.h + tangoappender.h + tangorollingfileappender.h + utils.h + utils.tpp + utils_spec.tpp + w32win.h + w_attribute.h + w_attribute.tpp + w_attrsetval.tpp + w_attribute_spec.tpp + w_pipe.h + w_pipe.tpp + subdev_diag.h + encoded_attribute.h + encoded_format.h) + +#add_subdirectory(idl) add_subdirectory(jpeg) add_subdirectory(jpeg_mmx) diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt index 009b8e735..44d13493a 100644 --- a/cppapi/server/idl/CMakeLists.txt +++ b/cppapi/server/idl/CMakeLists.txt @@ -1,8 +1,6 @@ set(SOURCES tangoSK.cpp tangoDynSK.cpp) -add_library(idl_objects OBJECT ${SOURCES}) -target_include_directories(idl_objects PUBLIC ${OMNIORB_PKG_INCLUDE_DIRS}) -target_compile_options(idl_objects PUBLIC ${OMNIORB_PKG_CFLAGS_OTHER}) +add_library(idl_objects OBJECT ${SOURCES} tango.h) #TODO install \ No newline at end of file diff --git a/log4tango/tests/CMakeLists.txt b/log4tango/tests/CMakeLists.txt index f9421fffe..5c476dfec 100644 --- a/log4tango/tests/CMakeLists.txt +++ b/log4tango/tests/CMakeLists.txt @@ -4,5 +4,5 @@ set(BENCH_TEST_SOURCES clock.cpp clock.hh test_bench.cpp) add_executable(test_log4tango ${LOG4TANGO_TEST_SOURCES} $) add_executable(test_bench ${BENCH_TEST_SOURCES} $) -add_test("log4tango test" test_log4tango) -add_test("log4tango benchmark" test_bench) \ No newline at end of file +add_test("log4tango_test" test_log4tango) +add_test("log4tango_benchmark" test_bench) \ No newline at end of file From 185195df357478836ae196cf8d7600729e0579eb Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 23:03:25 +0300 Subject: [PATCH 33/48] TANGO-678 progress --- CMakeLists.txt | 6 ++--- configure/CMakeLists.txt | 49 +++++++++++------------------------- cppapi/server/CMakeLists.txt | 2 +- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76c67a716..742e13caf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,8 +17,6 @@ set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") include(configure/CMakeLists.txt) -add_definitions(-fPIC) - include_directories("cppapi/client") include_directories("cppapi/client/helpers") include_directories("cppapi/server") @@ -26,8 +24,10 @@ include_directories("cppapi/server/idl") include_directories("log4tango/include") #required for generated config.h include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") + #externals include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) + #source code add_subdirectory("log4tango") add_subdirectory("cppapi") @@ -36,7 +36,7 @@ add_subdirectory("cppapi") add_library(tango SHARED $ $ - #$ + $ $ $ $) diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 3624c2a79..c7d2ce318 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -39,40 +39,6 @@ if(NOT ZMQ_BASE) message("Using ZMQ_BASE=${ZMQ_BASE}") endif() -#setup for GNU CXX compiler -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - message("found GNU compiler ...") - add_definitions(-g -Wall)#-Wextra -pedantic - if(CMAKE_BUILD_TYPE MATCHES RELEASE) - message("setup for release build ...") - add_definitions(-O3) - elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) - message("setup for debug build ...") - add_definitions(-O0) - add_definitions(-DDEBUG) - endif() - - add_definitions(-std=c++11) - add_definitions(-DGNU_CXX) -endif() - -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - message("found clang compiler...") - - add_definitions(-Wextra -pedantic -Wall) - if(CMAKE_BUILD_TYPE MATCHES RELEASE) - message("setup for release build ...") - add_definitions(-O3 -g) - elseif(CMAKE_BUILD_TYPE MATCHES DEBUG) - message("setup for debug build ...") - add_definitions(-O0 -g -fno-inline -DDEBUG) - endif() - - #for this version the compiler has to support c++11 flag - add_definitions(-std=c++11) - add_definitions(-DCLANG_CXX) -endif() - #find libraries #ZMQ pkg_search_module(ZMQ_PKG REQUIRED libzmq) @@ -86,4 +52,17 @@ if(NOT OMNIORB_PKG_FOUND) set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) 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) + else() + message("setup for debug build ...") + add_definitions(-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) +endif() \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 524f52995..23fdf374c 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -131,7 +131,7 @@ set(HEADERS attrdesc.h encoded_attribute.h encoded_format.h) -#add_subdirectory(idl) +add_subdirectory(idl) add_subdirectory(jpeg) add_subdirectory(jpeg_mmx) From 208f1ec7f2a28ffedea8014ee0cf29a926c1674e Mon Sep 17 00:00:00 2001 From: ingvord Date: Wed, 14 Sep 2016 23:23:44 +0300 Subject: [PATCH 34/48] TANGO-678 progress: failed compilation temporary fix --- cppapi/server/idl/tangoDynSK.cpp | 2 +- cppapi/server/idl/tangoSK.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cppapi/server/idl/tangoDynSK.cpp b/cppapi/server/idl/tangoDynSK.cpp index d5763133c..677d83aa9 100644 --- a/cppapi/server/idl/tangoDynSK.cpp +++ b/cppapi/server/idl/tangoDynSK.cpp @@ -4,7 +4,7 @@ OMNI_USING_NAMESPACE(omni) -static const char* _0RL_dyn_library_version = omniORB_4_2_dyn; +//static const char* _0RL_dyn_library_version = omniORB_4_2_dyn; static ::CORBA::TypeCode::_Tracker _0RL_tcTrack(__FILE__); diff --git a/cppapi/server/idl/tangoSK.cpp b/cppapi/server/idl/tangoSK.cpp index c47610d94..d2fa6a436 100644 --- a/cppapi/server/idl/tangoSK.cpp +++ b/cppapi/server/idl/tangoSK.cpp @@ -10,7 +10,7 @@ OMNI_USING_NAMESPACE(omni) -static const char* _0RL_library_version = omniORB_4_2; +//static const char* _0RL_library_version = omniORB_4_2; From baa63acd083bdc7e7c40a948d1d86e648e351618 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 14:09:09 +0300 Subject: [PATCH 35/48] TANGO-678 progress: add cpp_test_suite --- CMakeLists.txt | 23 +++++------ configure/CMakeLists.txt | 6 +++ cpp_test_suite/CMakeLists.txt | 13 ++++++ cpp_test_suite/asyn/CMakeLists.txt | 17 ++++++++ cpp_test_suite/event/CMakeLists.txt | 29 +++++++++++++ cpp_test_suite/new_tests/CMakeLists.txt | 6 +++ cpp_test_suite/old_tests/CMakeLists.txt | 55 +++++++++++++++++++++++++ 7 files changed, 137 insertions(+), 12 deletions(-) create mode 100644 cpp_test_suite/asyn/CMakeLists.txt create mode 100644 cpp_test_suite/event/CMakeLists.txt create mode 100644 cpp_test_suite/new_tests/CMakeLists.txt create mode 100644 cpp_test_suite/old_tests/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 742e13caf..1fafb470c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,25 +13,23 @@ set(SO_VERSION "2") set (PACKAGE_URL "https://github.com/tango-controls/cppTango") set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") -set (PACKAGE_STRING "${CMAKE_PROJECT_NAME} ${LIBRARY_VERSION}") +set (PACKAGE_STRING "${CMAKE_PROJECT_NAME}-${LIBRARY_VERSION}") include(configure/CMakeLists.txt) -include_directories("cppapi/client") -include_directories("cppapi/client/helpers") -include_directories("cppapi/server") -include_directories("cppapi/server/idl") -include_directories("log4tango/include") +include_directories(cppapi/client) +include_directories(cppapi/client/helpers) +include_directories(cppapi/server) +include_directories(cppapi/server/idl) +include_directories(log4tango/include) #required for generated config.h -include_directories("${CMAKE_CURRENT_BINARY_DIR}/log4tango/include") +include_directories(${CMAKE_CURRENT_BINARY_DIR}/log4tango/include) -#externals -include_directories(${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_INCLUDE_DIRS}) #source code add_subdirectory("log4tango") add_subdirectory("cppapi") -#add_subdirectory("cpp_test_suite") +add_subdirectory("cpp_test_suite") #add_subdirectory("cpp_test_ds") add_library(tango SHARED $ @@ -40,7 +38,8 @@ add_library(tango SHARED $ $ $ $) -target_link_libraries(tango PUBLIC ${ZMQ_PKG_LIBRARIES} ${OMNIORB_PKG_LIBRARIES}) -target_compile_options(tango PUBLIC ${ZMQ_PKG_CFLAGS_OTHER} ${OMNIORB_PKG_CFLAGS_OTHER}) +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}) #install diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index c7d2ce318..095bb2e43 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -52,6 +52,12 @@ if(NOT OMNIORB_PKG_FOUND) set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) endif() +#COS +pkg_search_module(OMNICOS_PKG REQUIRED omniCOS4) + +#dynamic CORBA +pkg_search_module(OMNIDYN_PKG REQUIRED omniDynamic4) + #setup for GNU CXX compiler if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message("found GNU compiler ...") diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt index e69de29bb..c4d6a231d 100644 --- a/cpp_test_suite/CMakeLists.txt +++ b/cpp_test_suite/CMakeLists.txt @@ -0,0 +1,13 @@ +macro(TEST_SUITE_ADD_TEST test) + message("Add test ${test}") + add_executable(${test} ${test}.cpp) + target_compile_definitions(${test} PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") + target_include_directories(${test} PUBLIC ../cxxtest/include) + target_link_libraries(${test} ${CMAKE_DL_LIBS} tango) + add_test(NAME "${test}" COMMAND $) +endmacro() + +add_subdirectory(asyn) +add_subdirectory(event) +#add_subdirectory(old_tests) +add_subdirectory(new_tests) \ No newline at end of file diff --git a/cpp_test_suite/asyn/CMakeLists.txt b/cpp_test_suite/asyn/CMakeLists.txt new file mode 100644 index 000000000..b2936c69a --- /dev/null +++ b/cpp_test_suite/asyn/CMakeLists.txt @@ -0,0 +1,17 @@ +set(TESTS asyn_attr_cb + asyn_attr + asyn_attr_multi + asyn_cb2 + asyn_cb_cmd + asyn_cb + asyn_cmd + asyn_faf + asyn_thread + asyn_write_attr + asyn_write_attr_multi + asyn_write_cb + auto_asyn_cmd) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file diff --git a/cpp_test_suite/event/CMakeLists.txt b/cpp_test_suite/event/CMakeLists.txt new file mode 100644 index 000000000..8e778954d --- /dev/null +++ b/cpp_test_suite/event/CMakeLists.txt @@ -0,0 +1,29 @@ +set(TESTS archive_event + att_conf_event + back_ch_event + change_event64 + change_event + data_ready_event + event_lock + multi_event + pipe_event + reco_svc + scan + state_event + user_event + att_conf_event_buffer + att_type_event + back_per_event + change_event_buffer + data_ready_event_buffer + dev_intr_event + multi_dev_event + per_event + reco_event + reco_zmq + server_event + stateless_sub) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt new file mode 100644 index 000000000..6e5c180af --- /dev/null +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -0,0 +1,6 @@ +set(TESTS conf_devtest + ) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file diff --git a/cpp_test_suite/old_tests/CMakeLists.txt b/cpp_test_suite/old_tests/CMakeLists.txt new file mode 100644 index 000000000..9133ca7b1 --- /dev/null +++ b/cpp_test_suite/old_tests/CMakeLists.txt @@ -0,0 +1,55 @@ +set(TESTS 64 + acc_right + add_rem_attr + add_rem_dev + allowed_cmd + att_conf + attr_conf_test + attr_manip + attr_misc + attr_proxy + attr_types + cmd_inout + cmd_types + ConfEventBugClient + copy_devproxy + ds_cache + helper + lock + locked_device + mem_att + misc_devattr + misc_devdata + misc_devproxy + multiple_new + new_devproxy + obj_prop + poll_attr + Poll + poll_except + poll_met + poll_pool + print_data + print_data_hist + prop_list + rds + read_attr + read_hist + read_hist_ext + reconnect_attr + reconnect + restart_device + ring_depth + size + state_attr + StopPoll + sub_dev + unlock + wait_mcast_dev + w_r_attr + write_attr_3 + write_attr) + +foreach(TEST ${TESTS}) + TEST_SUITE_ADD_TEST(${TEST}) +endforeach(TEST) \ No newline at end of file From 0107d5e89035a3b1d011044451f947f1a76bb8f8 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 15:40:47 +0300 Subject: [PATCH 36/48] TANGO-678 progress: add cpp_test_suite/cxxtest --- cpp_test_suite/CMakeLists.txt | 5 +- cpp_test_suite/cxxtest/CMakeLists.txt | 72 +++++++++++++++++++++++++ cpp_test_suite/new_tests/CMakeLists.txt | 4 +- 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 cpp_test_suite/cxxtest/CMakeLists.txt diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt index c4d6a231d..a07b15f08 100644 --- a/cpp_test_suite/CMakeLists.txt +++ b/cpp_test_suite/CMakeLists.txt @@ -2,7 +2,7 @@ macro(TEST_SUITE_ADD_TEST test) message("Add test ${test}") add_executable(${test} ${test}.cpp) target_compile_definitions(${test} PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") - target_include_directories(${test} PUBLIC ../cxxtest/include) +# target_include_directories(${test} PUBLIC ../cxxtest/include) target_link_libraries(${test} ${CMAKE_DL_LIBS} tango) add_test(NAME "${test}" COMMAND $) endmacro() @@ -10,4 +10,5 @@ endmacro() add_subdirectory(asyn) add_subdirectory(event) #add_subdirectory(old_tests) -add_subdirectory(new_tests) \ No newline at end of file +add_subdirectory(new_tests) +add_subdirectory(cxxtest) \ No newline at end of file diff --git a/cpp_test_suite/cxxtest/CMakeLists.txt b/cpp_test_suite/cxxtest/CMakeLists.txt new file mode 100644 index 000000000..4260b478d --- /dev/null +++ b/cpp_test_suite/cxxtest/CMakeLists.txt @@ -0,0 +1,72 @@ +message("Generate runner.cpp") +execute_process(COMMAND python cxxtestgen.py --template=${CMAKE_CURRENT_SOURCE_DIR}/template/tango_template.tpl + -o ${CMAKE_CURRENT_SOURCE_DIR}/runner.cpp + ../../new_tests/cxx_syntax.cpp + ../../new_tests/cxx_poll.cpp + ../../new_tests/cxx_poll_admin.cpp + ../../new_tests/cxx_dserver_cmd.cpp + ../../new_tests/cxx_dserver_misc.cpp + ../../new_tests/cxx_always_hook.cpp + ../../new_tests/cxx_blackbox.cpp + ../../new_tests/cxx_attr_misc.cpp + ../../new_tests/cxx_attrprop.cpp + ../../new_tests/cxx_attr_write.cpp + ../../new_tests/cxx_attr_conf.cpp + ../../new_tests/cxx_attr.cpp + ../../new_tests/cxx_misc_util.cpp + ../../new_tests/cxx_templ_cmd.cpp + ../../new_tests/cxx_exception.cpp + ../../new_tests/cxx_cmd_query.cpp + ../../new_tests/cxx_seq_vec.cpp + ../../new_tests/cxx_test_state_on.cpp + ../../new_tests/cxx_misc.cpp + ../../new_tests/cxx_cmd_types.cpp + ../../new_tests/cxx_group.cpp + ../../new_tests/cxx_encoded.cpp + ../../new_tests/cxx_database.cpp + ../../new_tests/cxx_mem_attr.cpp + ../../new_tests/cxx_enum_att.cpp + ../../new_tests/cxx_write_attr_hard.cpp + ../../new_tests/cxx_fwd_att.cpp + ../../new_tests/cxx_pipe_conf.cpp + ../../new_tests/cxx_pipe.cpp + ../../new_tests/cxx_z00_dyn_cmd.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) + +add_executable(runner $ ${CMAKE_CURRENT_SOURCE_DIR}/runner.cpp) +target_include_directories(runner PUBLIC include) +target_link_libraries(runner PUBLIC ${CMAKE_DL_LIBS} tango) + +#TODO different OS +set(DEV1 "test/debian8/10") +set(DEV2 "test/debian8/11") +set(DEV3 "test/debian8/12") +set(FWD_DEV "test/fwd_debian8/10") +set(SERV_NAME "devTest") +set(INST_NAME "debian8") +set(DEV1_ALIAS "debian8_alias") +set(ATTR_ALIAS "debian8_attr_alias") +cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME) +set(FULL_HOSTNAME "${HOST_NAME}:10000") + +add_test("CXX::runner" runner + --device1=${DEV1} + --device2=${DEV2} + --device3=${DEV3} + --fwd_device=${FWD_DEV} + --loop=1 + --fulldsname=${SERV_NAME}/${INST_NAME} + --serverhost=${FULL_HOSTNAME} + --clienthost=${FULL_HOSTNAME} + --serverversion=5 + --docurl=http://www.tango-controls.org + --devtype=TestDevice + --dbserver=sys/database/2 + --outpath=/tmp/ + --refpath=${CMAKE_CURRENT_SOURCE_DIR}/../new_tests/out/ + --loglevel=0 + --dsloglevel=3 + --suiteloop=1 + --devicealias=${DEV1_ALIAS} + --attributealias=${ATTR_ALIAS} +) \ No newline at end of file diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt index 6e5c180af..59b14bf22 100644 --- a/cpp_test_suite/new_tests/CMakeLists.txt +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -3,4 +3,6 @@ set(TESTS conf_devtest foreach(TEST ${TESTS}) TEST_SUITE_ADD_TEST(${TEST}) -endforeach(TEST) \ No newline at end of file +endforeach(TEST) + +add_library(compare_test_object OBJECT compare_test.cpp compare_test.h) \ No newline at end of file From 58e8f4768fa6127323c83cb6e4723cb5fc96a961 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 16:10:55 +0300 Subject: [PATCH 37/48] TANGO-678 progress: add cpp_test_ds; devTest does not compile - missing IOLong.h --- CMakeLists.txt | 2 +- cpp_test_ds/CMakeLists.txt | 25 +++++++++++++++++++++++++ cpp_test_ds/fwd_ds/CMakeLists.txt | 9 +++++++++ cpp_test_suite/CMakeLists.txt | 14 +++++++++++++- cpp_test_suite/cxxtest/CMakeLists.txt | 13 +------------ 5 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 cpp_test_ds/CMakeLists.txt create mode 100644 cpp_test_ds/fwd_ds/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fafb470c..e877ba66a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/log4tango/include) add_subdirectory("log4tango") add_subdirectory("cppapi") add_subdirectory("cpp_test_suite") -#add_subdirectory("cpp_test_ds") +add_subdirectory("cpp_test_ds") add_library(tango SHARED $ $ diff --git a/cpp_test_ds/CMakeLists.txt b/cpp_test_ds/CMakeLists.txt new file mode 100644 index 000000000..49d5b7296 --- /dev/null +++ b/cpp_test_ds/CMakeLists.txt @@ -0,0 +1,25 @@ +set(SOURCES classfactory.cpp + DevTest.cpp + IOAddAttribute.cpp + IOArray2.cpp + IOMisc.cpp + IOSetAttr.cpp + IOStr2.cpp + IOStruct.cpp +# main_win.cpp + TypeCmds.cpp + DevTestClass.cpp + FileDb.cpp + IOArray1.cpp + IOLongVar.cpp + IOSeqVec.cpp + IOStr1.cpp + IOStrArray.cpp + main.cpp + SigThrow.cpp) + +add_subdirectory(fwd_ds) + +add_executable(devTest ${SOURCES}) +target_include_directories(devTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(devTest PUBLIC ${CMAKE_DL_LIBS} tango) diff --git a/cpp_test_ds/fwd_ds/CMakeLists.txt b/cpp_test_ds/fwd_ds/CMakeLists.txt new file mode 100644 index 000000000..e589c4386 --- /dev/null +++ b/cpp_test_ds/fwd_ds/CMakeLists.txt @@ -0,0 +1,9 @@ +set(SOURCES ClassFactory.cpp + FwdTestClass.cpp + FwdTest.cpp + FwdTestStateMachine.cpp + main.cpp) + +add_executable(FwdTest ${SOURCES}) +target_include_directories(FwdTest PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(FwdTest PUBLIC ${CMAKE_DL_LIBS} tango) diff --git a/cpp_test_suite/CMakeLists.txt b/cpp_test_suite/CMakeLists.txt index a07b15f08..1cd9cb3f5 100644 --- a/cpp_test_suite/CMakeLists.txt +++ b/cpp_test_suite/CMakeLists.txt @@ -1,10 +1,22 @@ +#TODO different OS +set(DEV1 "test/debian8/10") +set(DEV2 "test/debian8/11") +set(DEV3 "test/debian8/12") +set(FWD_DEV "test/fwd_debian8/10") +set(SERV_NAME "devTest") +set(INST_NAME "debian8") +set(DEV1_ALIAS "debian8_alias") +set(ATTR_ALIAS "debian8_attr_alias") +cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME) +set(FULL_HOSTNAME "${HOST_NAME}:10000") + macro(TEST_SUITE_ADD_TEST test) message("Add test ${test}") add_executable(${test} ${test}.cpp) target_compile_definitions(${test} PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") # target_include_directories(${test} PUBLIC ../cxxtest/include) target_link_libraries(${test} ${CMAKE_DL_LIBS} tango) - add_test(NAME "${test}" COMMAND $) + add_test(NAME "CPP::${test}" COMMAND $ ${DEV1}) endmacro() add_subdirectory(asyn) diff --git a/cpp_test_suite/cxxtest/CMakeLists.txt b/cpp_test_suite/cxxtest/CMakeLists.txt index 4260b478d..16fb2bd31 100644 --- a/cpp_test_suite/cxxtest/CMakeLists.txt +++ b/cpp_test_suite/cxxtest/CMakeLists.txt @@ -36,18 +36,7 @@ execute_process(COMMAND python cxxtestgen.py --template=${CMAKE_CURRENT_SOURCE_D add_executable(runner $ ${CMAKE_CURRENT_SOURCE_DIR}/runner.cpp) target_include_directories(runner PUBLIC include) target_link_libraries(runner PUBLIC ${CMAKE_DL_LIBS} tango) - -#TODO different OS -set(DEV1 "test/debian8/10") -set(DEV2 "test/debian8/11") -set(DEV3 "test/debian8/12") -set(FWD_DEV "test/fwd_debian8/10") -set(SERV_NAME "devTest") -set(INST_NAME "debian8") -set(DEV1_ALIAS "debian8_alias") -set(ATTR_ALIAS "debian8_attr_alias") -cmake_host_system_information(RESULT HOST_NAME QUERY HOSTNAME) -set(FULL_HOSTNAME "${HOST_NAME}:10000") +target_compile_definitions(runner PUBLIC "-DVALGRIND -D_PTHREADS -D_REENTRANT") add_test("CXX::runner" runner --device1=${DEV1} From 85ad943573f280fb0007ea9408a1d40e24e46d6e Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 17:29:39 +0300 Subject: [PATCH 38/48] TANGO-678 progress: install --- CMakeLists.txt | 17 +++++++++++++++-- configure/CMakeLists.txt | 4 +++- cppapi/client/CMakeLists.txt | 4 +++- cppapi/server/CMakeLists.txt | 4 +++- cppapi/server/idl/CMakeLists.txt | 2 +- log4tango/include/log4tango/CMakeLists.txt | 12 ++++++------ .../include/log4tango/threading/CMakeLists.txt | 2 +- tango.pc.cmake | 11 +++++++++++ 8 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 tango.pc.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e877ba66a..a1fe16d57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,10 @@ enable_testing() set(MAJOR_VERSION "9") set(MINOR_VERSION "2") set(PATCH_VERSION "5") + +#convenient versions set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") -set(SO_VERSION "2") +set(SO_VERSION "${MAJOR_VERSION}") set (PACKAGE_URL "https://github.com/tango-controls/cppTango") @@ -42,4 +44,15 @@ target_include_directories(tango PUBLIC ${ZMQ_PKG_INCLUDE_DIRS} ${OMNIORB_PKG_IN 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}) -#install +set_target_properties(tango PROPERTIES + VERSION ${LIBRARY_VERSION} + SOVERSION ${SO_VERSION}) + +#install code +install(TARGETS tango LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") + +#TODO +#configure_file(tango.pc.cmake tango.pc @ONLY) + +#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" +# DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 095bb2e43..327b9992e 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -71,4 +71,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_definitions(-std=c++11) add_definitions(-DGNU_CXX -DOMNI_UNLOADABLE_STUBS -D_FORTIFY_SOURCE=2) add_definitions(-fPIC) -endif() \ No newline at end of file +endif() + +include(GNUInstallDirs) \ No newline at end of file diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index 0b618afbf..be2d1a3fb 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,4 +57,6 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) -add_library(client_objects OBJECT ${SOURCES}) \ No newline at end of file +add_library(client_objects OBJECT ${SOURCES}) + +install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file diff --git a/cppapi/server/CMakeLists.txt b/cppapi/server/CMakeLists.txt index 23fdf374c..794e15c03 100644 --- a/cppapi/server/CMakeLists.txt +++ b/cppapi/server/CMakeLists.txt @@ -135,4 +135,6 @@ add_subdirectory(idl) add_subdirectory(jpeg) add_subdirectory(jpeg_mmx) -add_library(server_objects OBJECT ${SOURCES}) \ No newline at end of file +add_library(server_objects OBJECT ${SOURCES}) + +install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt index 44d13493a..5f8aa1a8f 100644 --- a/cppapi/server/idl/CMakeLists.txt +++ b/cppapi/server/idl/CMakeLists.txt @@ -3,4 +3,4 @@ set(SOURCES tangoSK.cpp add_library(idl_objects OBJECT ${SOURCES} tango.h) -#TODO install \ No newline at end of file +#TODO generate source code from idl \ No newline at end of file diff --git a/log4tango/include/log4tango/CMakeLists.txt b/log4tango/include/log4tango/CMakeLists.txt index 538b6c1b3..3b32cf48e 100644 --- a/log4tango/include/log4tango/CMakeLists.txt +++ b/log4tango/include/log4tango/CMakeLists.txt @@ -19,11 +19,11 @@ set(HEADER_FILES TimeStamp.hh Filter.hh Export.hh - Portability.hh - config.h - config-win32.h) + Portability.hh) -install(FILES ${HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango) +add_subdirectory(threading) -add_subdirectory(threading) \ No newline at end of file +install(FILES ${HEADER_FILES} + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/log4tango) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/log4tango) +#TODO if windows 32 install config-win32.h \ No newline at end of file diff --git a/log4tango/include/log4tango/threading/CMakeLists.txt b/log4tango/include/log4tango/threading/CMakeLists.txt index 8f1fe8272..71f3669f2 100644 --- a/log4tango/include/log4tango/threading/CMakeLists.txt +++ b/log4tango/include/log4tango/threading/CMakeLists.txt @@ -5,4 +5,4 @@ set(HEADER_FILES Threading.hh) install(FILES ${HEADER_FILES} - DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/tango/log4tango/threading) \ No newline at end of file + DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/log4tango/threading) \ No newline at end of file diff --git a/tango.pc.cmake b/tango.pc.cmake new file mode 100644 index 000000000..d9aff0550 --- /dev/null +++ b/tango.pc.cmake @@ -0,0 +1,11 @@ +prefix = @CMAKE_INSTALL_PREFIX@ +exec_prefix = ${prefix} +includedir = ${prefix}/include +libdir = ${prefix}/@CMAKE_INSTALL_LIBDIR@ + +Name: @CMAKE_PROJECT_NAME@ +Description: Tango client/server API library +Version: @LIBRARY_VERSION@ +Cflags: -I${includedir} +Requires: libzmq omniORB4 omniCOS4 omniDynamic4 +Libs: -L${libdir} -ltango \ No newline at end of file From 05a14552a80122d6594d4d039041975bd4485446 Mon Sep 17 00:00:00 2001 From: ingvord Date: Thu, 15 Sep 2016 17:33:10 +0300 Subject: [PATCH 39/48] TANGO-678 progress: install idl header --- cppapi/server/idl/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cppapi/server/idl/CMakeLists.txt b/cppapi/server/idl/CMakeLists.txt index 5f8aa1a8f..7683100e1 100644 --- a/cppapi/server/idl/CMakeLists.txt +++ b/cppapi/server/idl/CMakeLists.txt @@ -3,4 +3,6 @@ set(SOURCES tangoSK.cpp add_library(idl_objects OBJECT ${SOURCES} tango.h) -#TODO generate source code from idl \ No newline at end of file +#TODO generate source code from idl + +install(FILES tango.h DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/idl") \ No newline at end of file From 9dfa19ba2661dd8c5e6c34a67b9fcbef3197e39c Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 10:24:30 +0300 Subject: [PATCH 40/48] TANGO-678 progress: fix devTest compilation failure --- cpp_test_ds/CMakeLists.txt | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/cpp_test_ds/CMakeLists.txt b/cpp_test_ds/CMakeLists.txt index 49d5b7296..d09944dde 100644 --- a/cpp_test_ds/CMakeLists.txt +++ b/cpp_test_ds/CMakeLists.txt @@ -1,22 +1,20 @@ -set(SOURCES classfactory.cpp - DevTest.cpp - IOAddAttribute.cpp - IOArray2.cpp +set(SOURCES main.cpp + TypeCmds.cpp + SigThrow.cpp IOMisc.cpp - IOSetAttr.cpp + IOStr1.cpp IOStr2.cpp - IOStruct.cpp -# main_win.cpp - TypeCmds.cpp - DevTestClass.cpp - FileDb.cpp IOArray1.cpp - IOLongVar.cpp - IOSeqVec.cpp - IOStr1.cpp + IOArray2.cpp IOStrArray.cpp - main.cpp - SigThrow.cpp) + IOStruct.cpp + IOSetAttr.cpp + IOAddAttribute.cpp + IOSeqVec.cpp + FileDb.cpp + classfactory.cpp + DevTestClass.cpp + DevTest.cpp) add_subdirectory(fwd_ds) From 0608a0e882889684c925bcabc8fa2ffeb49acfbb Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 10:35:45 +0300 Subject: [PATCH 41/48] TANGO-678 progress: minor changes --- CMakeLists.txt | 7 +- cpp_test_ds/IOLongVar.cpp | 85 ------------------------- cpp_test_suite/new_tests/CMakeLists.txt | 8 +-- tango.pc.cmake | 2 +- 4 files changed, 5 insertions(+), 97 deletions(-) delete mode 100644 cpp_test_ds/IOLongVar.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index a1fe16d57..e02cce67b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,8 +51,7 @@ set_target_properties(tango PROPERTIES #install code install(TARGETS tango LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}") -#TODO -#configure_file(tango.pc.cmake tango.pc @ONLY) +configure_file(tango.pc.cmake tango.pc @ONLY) -#install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" -# DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tango.pc" + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig") diff --git a/cpp_test_ds/IOLongVar.cpp b/cpp_test_ds/IOLongVar.cpp deleted file mode 100644 index 13cd0c845..000000000 --- a/cpp_test_ds/IOLongVar.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "IOLong.h" - -//+---------------------------------------------------------------------------- -// -// method : IOLong::IOLong() -// -// description : constructor for the IOLong command of the -// DevTest. -// -// In : - name : The command name -// - in : The input parameter type -// - out : The output parameter type -// - in_desc : The input parameter description -// - out_desc : The output parameter description -// -//----------------------------------------------------------------------------- - -IOLong::IOLong(const char *name,Tango_CmdArgType in, - Tango_CmdArgType out,const char *in_desc, - const char *out_desc) -:Command(name,in,out,in_desc,out_desc) -{ -} - -//+---------------------------------------------------------------------------- -// -// method : IOLong::is_allowed() -// -// description : method to test whether command is allowed or not in this -// state. In this case, the command is allowed only if -// the device is in ON state -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : boolean - true == is allowed , false == not allowed -// -//----------------------------------------------------------------------------- - -bool IOLong::is_allowed(DeviceImpl *device, const CORBA_Any &in_any) -{ - -// -// command allowed only if the device is on -// - - if (device->get_state() == Tango_ON) - return(true); - else - return(false); -} - -//+---------------------------------------------------------------------------- -// -// method : IOLong::execute() -// -// description : method to trigger the execution of the IOLong -// command -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- - - -CORBA_Any *IOLong::execute(DeviceImpl *device,const CORBA_Any &in_any) -{ - try { - Tango_DevLong theNumber; - extract(in_any,theNumber); - cout << "[IOLong::execute] received number " << theNumber << endl; - theNumber = theNumber * 2; - cout << "[IOLong::execute] return number " << theNumber << endl; - return insert(theNumber); - } - catch (CORBA_Exception &e) - { - Tango::Except::print_exception(e); - throw ; - } -} - - diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt index 59b14bf22..d4eda463c 100644 --- a/cpp_test_suite/new_tests/CMakeLists.txt +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -1,8 +1,2 @@ -set(TESTS conf_devtest - ) - -foreach(TEST ${TESTS}) - TEST_SUITE_ADD_TEST(${TEST}) -endforeach(TEST) - +add_executable(conf_devtest conf_devtest.cpp) add_library(compare_test_object OBJECT compare_test.cpp compare_test.h) \ No newline at end of file diff --git a/tango.pc.cmake b/tango.pc.cmake index d9aff0550..1260febd4 100644 --- a/tango.pc.cmake +++ b/tango.pc.cmake @@ -8,4 +8,4 @@ Description: Tango client/server API library Version: @LIBRARY_VERSION@ Cflags: -I${includedir} Requires: libzmq omniORB4 omniCOS4 omniDynamic4 -Libs: -L${libdir} -ltango \ No newline at end of file +Libs: -L${libdir} -ltango -lzmq -lomniORB4 -lomnithread -lCOS4 -lomniDynamic4 \ No newline at end of file From 6c197a9decf51fdf73921777e8cf7d9426532ffc Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 11:06:32 +0300 Subject: [PATCH 42/48] TANGO-678 progress: add doc target --- cppapi/CMakeLists.txt | 5 +++-- cppapi/doxygen/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 cppapi/doxygen/CMakeLists.txt diff --git a/cppapi/CMakeLists.txt b/cppapi/CMakeLists.txt index 99da93d54..aaaea6e97 100644 --- a/cppapi/CMakeLists.txt +++ b/cppapi/CMakeLists.txt @@ -1,5 +1,6 @@ -add_subdirectory("client") -add_subdirectory("server") +add_subdirectory(doxygen) +add_subdirectory(client) +add_subdirectory(server) #link_libraries() diff --git a/cppapi/doxygen/CMakeLists.txt b/cppapi/doxygen/CMakeLists.txt new file mode 100644 index 000000000..89b1b8e2c --- /dev/null +++ b/cppapi/doxygen/CMakeLists.txt @@ -0,0 +1,3 @@ +add_custom_target(doc doxygen ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../server + SOURCES Doxyfile) \ No newline at end of file From a7971267d4fab8668f00525569f9d90d079b24e2 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 11:07:08 +0300 Subject: [PATCH 43/48] TANGO-678 progress: fix missing headers in installation --- cppapi/client/CMakeLists.txt | 2 ++ cppapi/client/helpers/CMakeLists.txt | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 cppapi/client/helpers/CMakeLists.txt diff --git a/cppapi/client/CMakeLists.txt b/cppapi/client/CMakeLists.txt index be2d1a3fb..e7d4ab161 100644 --- a/cppapi/client/CMakeLists.txt +++ b/cppapi/client/CMakeLists.txt @@ -57,6 +57,8 @@ set(HEADERS accessproxy.h devapi_pipe.tpp zmq.hpp) +add_subdirectory(helpers) + add_library(client_objects OBJECT ${SOURCES}) install(FILES ${HEADERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file diff --git a/cppapi/client/helpers/CMakeLists.txt b/cppapi/client/helpers/CMakeLists.txt new file mode 100644 index 000000000..e54af39b7 --- /dev/null +++ b/cppapi/client/helpers/CMakeLists.txt @@ -0,0 +1,6 @@ +set(HELPERS DeviceProxyHelper.h + PogoHelper.h + TangoExceptionsHelper.h + Xstring.h) + +install(FILES ${HELPERS} DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}") \ No newline at end of file From 6c4d8bbbb0c2657f56e82537678119423a4b78ed Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 11:39:01 +0300 Subject: [PATCH 44/48] TANGO-678 progress: add readme; use XXX_BASE over pkg-config if present --- CMakeLists.txt | 2 +- README.md | 6 ++- configure/CMakeLists.txt | 54 ++++++++++++++----------- cpp_test_suite/new_tests/CMakeLists.txt | 1 + 4 files changed, 38 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e02cce67b..5c3303919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ add_subdirectory("cppapi") add_subdirectory("cpp_test_suite") add_subdirectory("cpp_test_ds") -add_library(tango SHARED $ +add_library(tango SHARED $ $ $ $ diff --git a/README.md b/README.md index 303b7cb1a..ba31b2023 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,11 @@ This repository is the result of svn2git migration of tango source code. It is c 7. Public automatic testing/continuous integration (e.g., via Travis) is recommended 8. The main development should be done on the tango-controls hosted project (as opposed to using a private organization project and just pushing to the tango-controls repo from time to time). This allows for public visibility of the latest development and issues and encourages sharing and reuse. If a given organization needs special tweaks or has particular release/testing cycles, the recommendation is that the organization forks from the "canonical" repo +# How to build and install using cmake + +`mkdir build; cd build; cmake .. [-DCMAKE_INSTALL_PREFIX=] [-DOMNI_BASE=] [-DZMQ_BASE=] [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG]; make; make install` + # Links -[Tango Controls web page](http://tango-controls.org) +[Tango Controls web page](http://tango-controls.org) \ No newline at end of file diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 327b9992e..5cc3e5761 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -1,5 +1,10 @@ include(FindPkgConfig) +if(NOT CMAKE_BUILD_TYPE) + message("No build type specified - default is DEBUG") + set(CMAKE_BUILD_TYPE DEBUG) +endif() + #cNp from Make.rules if(NOT TANGO_HOME) set(TANGO_HOME /segfs/tango) @@ -21,7 +26,7 @@ endif() if(NOT OS) set(BIN_DIR ${OS}) - message("Using BIN_DIR=${BIN_DIR}") + message("Using OS=${OS}") endif() if(NOT BIN_DIR) @@ -29,35 +34,38 @@ if(NOT BIN_DIR) message("Using BIN_DIR=${BIN_DIR}") endif() -if(NOT OMNI_BASE) - set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/bin) +if(OMNI_BASE) + set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/${BIN_DIR}) + set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) + set(OMNICOS_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) + set(OMNIDYN_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) + set(OMNIORB_PKG_LIBRARIES "-lomniORB4 -lomnithread -lCOS4 -lomniDynamic4") + link_directories(${OMNI_BASE}/lib) message("Using OMNI_BASE=${OMNI_BASE}") +else() + #CORBA + pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) + #COS + pkg_search_module(OMNICOS_PKG REQUIRED omniCOS4) + #dynamic CORBA + pkg_search_module(OMNIDYN_PKG REQUIRED omniDynamic4) + if(NOT OMNIORB_PKG_FOUND) + message(FATAL "omniORB4 library is required for Tango") + endif() endif() -if(NOT ZMQ_BASE) - set(ZMQ_BASE ${TANGO_HOME}/transport/zmq4.0.5/bin) +if(ZMQ_BASE) message("Using ZMQ_BASE=${ZMQ_BASE}") -endif() - -#find libraries -#ZMQ -pkg_search_module(ZMQ_PKG REQUIRED libzmq) -if(NOT ZMQ_PKG_FOUND) set(ZMQ_PKG_INCLUDE_DIRS ${ZMQ_BASE}/include) + set(ZMQ_PKG_LIBRARIES "-lzmq") + link_directories(${ZMQ_BASE}/lib) +else() + pkg_search_module(ZMQ_PKG REQUIRED libzmq) + if(NOT ZMQ_PKG_FOUND) + message(FATAL "ZMQ library is required for Tango") + endif() endif() -#CORBA -pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) -if(NOT OMNIORB_PKG_FOUND) - set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) -endif() - -#COS -pkg_search_module(OMNICOS_PKG REQUIRED omniCOS4) - -#dynamic CORBA -pkg_search_module(OMNIDYN_PKG REQUIRED omniDynamic4) - #setup for GNU CXX compiler if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") message("found GNU compiler ...") diff --git a/cpp_test_suite/new_tests/CMakeLists.txt b/cpp_test_suite/new_tests/CMakeLists.txt index d4eda463c..65a26a8b4 100644 --- a/cpp_test_suite/new_tests/CMakeLists.txt +++ b/cpp_test_suite/new_tests/CMakeLists.txt @@ -1,2 +1,3 @@ add_executable(conf_devtest conf_devtest.cpp) +target_link_libraries(conf_devtest PUBLIC ${CMAKE_DL_LIBS} tango) add_library(compare_test_object OBJECT compare_test.cpp compare_test.h) \ No newline at end of file From 2afc9584fb941b61016a24460fee4790abf9394a Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 12:04:11 +0300 Subject: [PATCH 45/48] TANGO-678 progress: fix cmake configuration for ESRF --- configure/CMakeLists.txt | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/configure/CMakeLists.txt b/configure/CMakeLists.txt index 5cc3e5761..b21ee8879 100644 --- a/configure/CMakeLists.txt +++ b/configure/CMakeLists.txt @@ -5,43 +5,12 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE DEBUG) endif() -#cNp from Make.rules -if(NOT TANGO_HOME) - set(TANGO_HOME /segfs/tango) - message("Using TANGO_HOME=${TANGO_HOME}") -endif() - -if(NOT ubuntu) - execute_process(COMMAND /csadmin/common/scripts/get_os.share - OUTPUT_VARIABLE OS) -endif() - -if(NOT OS) - if(dev) - set(OS ubuntu1404) - else() - set(OS ubuntu1204) - endif() -endif() - -if(NOT OS) - set(BIN_DIR ${OS}) - message("Using OS=${OS}") -endif() - -if(NOT BIN_DIR) - set(BIN_DIR ${OS}) - message("Using BIN_DIR=${BIN_DIR}") -endif() - if(OMNI_BASE) - set(OMNI_BASE ${TANGO_HOME}/ORB/omniORB4.2.1/${BIN_DIR}) + message("Using OMNI_BASE=${OMNI_BASE}") set(OMNIORB_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) - set(OMNICOS_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) - set(OMNIDYN_PKG_INCLUDE_DIRS ${OMNI_BASE}/include) set(OMNIORB_PKG_LIBRARIES "-lomniORB4 -lomnithread -lCOS4 -lomniDynamic4") + include_directories(${OMNI_BASE}/include) link_directories(${OMNI_BASE}/lib) - message("Using OMNI_BASE=${OMNI_BASE}") else() #CORBA pkg_search_module(OMNIORB_PKG REQUIRED omniORB4) From f26f1af35246985dbf15788e2c68777401378613 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 12:05:39 +0300 Subject: [PATCH 46/48] TANGO-678 progress: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba31b2023..9916aba1d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This repository is the result of svn2git migration of tango source code. It is c # How to build and install using cmake -`mkdir build; cd build; cmake .. [-DCMAKE_INSTALL_PREFIX=] [-DOMNI_BASE=] [-DZMQ_BASE=] [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG]; make; make install` +`mkdir build; cd build; cmake .. [-DCMAKE_INSTALL_PREFIX=] [-DOMNI_BASE=] [-DZMQ_BASE=] [-DCMAKE_BUILD_TYPE=RELEASE|DEBUG] [-DCMAKE_VERBOSE_MAKEFILE=true]; make; make install` # Links From 49d7d59096301dc4c1f7767c16f889bed3af2287 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 12:56:17 +0300 Subject: [PATCH 47/48] TANGO-678 progress: fix compilation warning related to PACKAGE_URL being overridden --- CMakeLists.txt | 5 ----- log4tango/CMakeLists.txt | 3 ++- log4tango/src/CMakeLists.txt | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c3303919..2eb779d1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,11 +12,6 @@ set(PATCH_VERSION "5") set(LIBRARY_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") set(SO_VERSION "${MAJOR_VERSION}") - -set (PACKAGE_URL "https://github.com/tango-controls/cppTango") -set (PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") -set (PACKAGE_STRING "${CMAKE_PROJECT_NAME}-${LIBRARY_VERSION}") - include(configure/CMakeLists.txt) include_directories(cppapi/client) diff --git a/log4tango/CMakeLists.txt b/log4tango/CMakeLists.txt index df95988ab..d5e9fc42e 100644 --- a/log4tango/CMakeLists.txt +++ b/log4tango/CMakeLists.txt @@ -5,7 +5,8 @@ # ? :+1 : ? == just some internal changes, nothing breaks but might work # better # CURRENT : REVISION : AGE -set(LT_VERSION "5:1:0") +set (LOG4TANGO_PACKAGE_URL "https://github.com/tango-controls/cppTango/log4tango") +set (LOG4TANGO_PACKAGE_BUGREPORT "https://github.com/tango-controls/cppTango/issues") include(${CMAKE_CURRENT_SOURCE_DIR}/config/config.cmake) diff --git a/log4tango/src/CMakeLists.txt b/log4tango/src/CMakeLists.txt index e10ce35c0..091813f12 100644 --- a/log4tango/src/CMakeLists.txt +++ b/log4tango/src/CMakeLists.txt @@ -25,6 +25,4 @@ set(SOURCES PortabilityImpl.hh PortabilityImpl.cpp) -add_library(log4tango_objects OBJECT ${SOURCES}) - -#target_link_libraries(log4tango_objects -version-info ${LT_VERSION}) \ No newline at end of file +add_library(log4tango_objects OBJECT ${SOURCES}) \ No newline at end of file From fcfe0cf3de9b3e749b674baf450a08618d5027f0 Mon Sep 17 00:00:00 2001 From: ingvord Date: Fri, 16 Sep 2016 13:58:46 +0300 Subject: [PATCH 48/48] TANGO-678 progress: fix compilation warning related to PACKAGE_URL being overridden --- log4tango/config/config.h.in | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/log4tango/config/config.h.in b/log4tango/config/config.h.in index 05a7f33d1..db1d25b0b 100644 --- a/log4tango/config/config.h.in +++ b/log4tango/config/config.h.in @@ -52,32 +52,14 @@ /* Define to 1 if you have the header file. */ #cmakedefine LOG4TANGO_HAVE_UNISTD_H -/* Define to the sub-directory in which libtool stores uninstalled libraries. */ -#cmakedefine LT_OBJDIR - -/* Name of package */ -#cmakedefine PACKAGE "${CMAKE_PROJECT_NAME}" - /* Define to the address where bug reports for this package should be sent. */ -#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" - -/* Define to the full name of this package. */ -#cmakedefine PACKAGE_NAME "${CMAKE_PROJECT_NAME}" - -/* Define to the full name and version of this package. */ -#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" - -/* Define to the one symbol short name of this package. */ -#cmakedefine PACKAGE_TARNAME +#cmakedefine LOG4TANGO_PACKAGE_BUGREPORT "@LOG4TANGO_PACKAGE_BUGREPORT@" /* Define to the home page for this package. */ -#cmakedefine PACKAGE_URL "@PACKAGE_URL@" +#cmakedefine LOG4TANGO_PACKAGE_URL "@LOG4TANGO_PACKAGE_URL@" /* Define to the version of this package. */ -#cmakedefine PACKAGE_VERSION "${LIBRARY_VERSION}" - -/* Define to 1 if you have the ANSI C header files. */ -#cmakedefine STDC_HEADERS +#cmakedefine LOG4TANGO_PACKAGE_VERSION "${LIBRARY_VERSION}" /* define if pthread library is available */ #cmakedefine HAVE_PTHREAD_ATTR_GET_NP 1 @@ -89,7 +71,7 @@ #endif /* Version number of package */ -#cmakedefine VERSION "@LIBRARY_VERSION@" +#cmakedefine LOG4TANGO_VERSION "@LIBRARY_VERSION@" /* If we're running on darwin/MacOsX */ #cmakedefine __darwin__