diff --git a/.travis.yml b/.travis.yml index f0af13a..4d8d28c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -165,7 +165,7 @@ script: -DUSE_SANITIZER=${ASAN} -DBUILD_TESTING=on -DWERROR=on - -G "${GENERATOR}" ../src + -G "${GENERATOR}" .. - ${SCAN_BUILD} cmake --build . --config ${BUILD_TYPE} --target install - CYCLONEDDS_URI='all' ctest -T test -C ${BUILD_TYPE} - if [ "${ASAN}" != "none" ]; then diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2b14033 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,214 @@ +# +# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License +# v. 1.0 which is available at +# http://www.eclipse.org/org/documents/edl-v10.php. +# +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause +# +cmake_minimum_required(VERSION 3.7) + +# Set a default build type if none was specified +set(default_build_type "RelWithDebInfo") +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to '${default_build_type}' as none was specified.") + set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE + STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +# By default the Java-based components get built, but make it possible to disable that: if only the +# core library is required, there's no need to build them, and that in turn eliminates the Maven and +# JDK dependency. +option(BUILD_IDLC "Build IDL preprocessor" ON) +option(BUILD_CONFTOOL "Build configuration file edit tool" ON) + +# By default don't treat warnings as errors, else anyone building it with a different compiler that +# just happens to generate a warning, as well as anyone adding or modifying something and making a +# small mistake would run into errors. CI builds can be configured differently. +option(WERROR "Treat compiler warnings as errors" OFF) + +FUNCTION(PREPEND var prefix) + SET(listVar "") + FOREACH(f ${ARGN}) + LIST(APPEND listVar "${prefix}/${f}") + ENDFOREACH(f) + SET(${var} "${listVar}" PARENT_SCOPE) +ENDFUNCTION(PREPEND) + +# Update the git submodules +execute_process(COMMAND git submodule init + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +execute_process(COMMAND git submodule update + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + +# Set module path before defining project so platform files will work. +set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules") +set(CMAKE_PROJECT_NAME_FULL "Eclipse Cyclone DDS") +set(PROJECT_NAME "CycloneDDS") +project(${PROJECT_NAME} VERSION 0.1.0) + +# Set some convenience variants of the project-name +string(REPLACE " " "-" CMAKE_PROJECT_NAME_DASHED "${CMAKE_PROJECT_NAME_FULL}") +string(TOUPPER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_CAPS) +string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_SMALL) + +set(CMAKE_C_STANDARD 99) +if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks") + add_definitions(-std=c99) +endif() + +if(${CMAKE_C_COMPILER_ID} STREQUAL "SunPro") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -xc99 -D__restrict=restrict -D__deprecated__=") + set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m64") +elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") + set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m64") +endif() + +# Conan +if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + if(APPLE) + # By default Conan strips all RPATHs (see conanbuildinfo.cmake), which + # causes tests to fail as the executables cannot find the library target. + # By setting KEEP_RPATHS, Conan does not set CMAKE_SKIP_RPATH and the + # resulting binaries still have the RPATH information. This is fine because + # CMake will strip the build RPATH information in the install step. + # + # NOTE: + # Conan's default approach is to use the "imports" feature, which copies + # all the dependencies into the bin directory. Of course, this doesn't work + # quite that well for libraries generated in this Project (see Conan + # documentation). + # + # See the links below for more information. + # https://github.com/conan-io/conan/issues/337 + # https://docs.conan.io/en/latest/howtos/manage_shared_libraries/rpaths.html + # https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling + conan_basic_setup(KEEP_RPATHS) + else() + conan_basic_setup() + endif() + conan_define_targets() +endif() + +# Set reasonably strict warning options for clang, gcc, msvc +# Enable coloured ouput if Ninja is used for building +if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") + #message(STATUS clang) + add_compile_options(-Wall -Wextra -Wconversion -Wunused -Wmissing-prototypes) + if(${WERROR}) + add_compile_options(-Werror) + endif() + if("${CMAKE_GENERATOR}" STREQUAL "Ninja") + add_compile_options(-Xclang -fcolor-diagnostics) + endif() +elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + #message(STATUS gcc) + add_compile_options(-Wall -Wextra -Wconversion -Wmissing-prototypes) + if(${WERROR}) + add_compile_options(-Werror) + endif() + if("${CMAKE_GENERATOR}" STREQUAL "Ninja") + add_compile_options(-fdiagnostics-color=always) + endif() +elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") + #message(STATUS msvc) + add_compile_options(/W3) + if(${WERROR}) + add_compile_options(/WX) + endif() +endif() + +# I don't know how to enable warnings properly so that they are enabled in Xcode projects as well +if(${CMAKE_GENERATOR} STREQUAL "Xcode") + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SHADOW YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_FLOAT_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_NON_LITERAL_NULL_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_IMPLICIT_SIGN_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INFINITE_RECURSION YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_MISSING_PARENTHESES YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ASSIGN_ENUM YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_STRICT_PROTOTYPES YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_COMMA YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS YES_AGGRESSIVE) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_LABEL YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_PARAMETER YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE YES) + set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_DOCUMENTATION_COMMENTS YES) + set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_MISSING_PROTOTYPES YES) +endif() + +# Make it easy to enable one of Clang's/gcc's analyzers, and default to using +# the address sanitizer for ordinary debug builds; gcc is giving some grief on +# Travis, so don't enable it for gcc by default +if(NOT USE_SANITIZER) + if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND + NOT (${CMAKE_GENERATOR} STREQUAL "Xcode") AND + (${CMAKE_C_COMPILER_ID} STREQUAL "Clang" + OR ${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang")) + message(STATUS "Enabling address sanitizer; set USE_SANITIZER=none to prevent this") + set(USE_SANITIZER address) + else() + set(USE_SANITIZER none) + endif() +endif() +if(NOT (${USE_SANITIZER} STREQUAL "none")) + message(STATUS "Sanitizer set to ${USE_SANITIZER}") + add_compile_options(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER}) + link_libraries(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER}) +endif() + +include(GNUInstallDirs) +include(AnalyzeBuild) +if(APPLE) + set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}") +else() + set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") +endif() +set(MEMORYCHECK_COMMAND_OPTIONS "--track-origins=yes --leak-check=full --trace-children=yes --child-silent-after-fork=yes --xml=yes --xml-file=TestResultValgrind_%p.xml --tool=memcheck --show-reachable=yes --leak-resolution=high") + +# By default building the testing tree is enabled by including CTest, but +# since not everybody has CUnit, and because it is not strictly required to +# build the product itself, switch to off by default. +option(BUILD_TESTING "Build the testing tree." OFF) +include(CTest) + +# Build all executables and libraries into the top-level /bin and /lib folders. +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + +add_subdirectory(src) +if(BUILD_IDLC) + add_subdirectory(examples) +endif() + +option(BUILD_DOCS "Build documentation." OFF) +if(BUILD_DOCS) + add_subdirectory(docs) +endif() + +# Pull-in CPack and support for generating Config.cmake and packages. +include(Packaging) diff --git a/README.md b/README.md index 3817027..d8ac3e3 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,28 @@ market. Moreover, Cyclone DDS is developed completely in the open as an Eclipse ## Building Eclipse Cyclone DDS -In order to build Cyclone DDS you need a Linux, Mac or Windows 10 machine with the following -installed on your host: +In order to build Cyclone DDS you need a Linux, Mac or Windows 10 machine (or, with some caveats, an +OpenIndiana one or a Solaris 2.6 one) with the following installed on your host: - * [CMake](https://cmake.org/download/), version 3.7 or later. (Version 3.6 should work but you - will have to edit the ``cmake_minimum_required`` version and may have to disable building the - tests.) - * [OpenSSL](https://www.openssl.org/), preferably version 1.1 or later. If you wish, you can - build without support for OpenSSL by setting DDSC\_ENABLE\_OPENSSL to FALSE on the ``cmake `` - command line (i.e., ``cmake -DDDSC_ENABLE_OPENSSL=FALSE`` ../src). In that, there is no need to - have openssl available. - * Java JDK, version 8 or later, e.g., [OpenJDK 11](http://jdk.java.net/11/). - * [Apache Maven](http://maven.apache.org/download.cgi), version 3.5 or later. + * C compiler (most commonly GCC on Linux, Visual Studio on Windows, Xcode on macOS); + * GIT version control system; + * [CMake](https://cmake.org/download/), version 3.7 or later; + * [OpenSSL](https://www.openssl.org/), preferably version 1.1 or later if you want to use TLS over + TCP. You can explicitly disable it by setting ``ENABLE_SSL=NO``, which is very useful for + reducing the footprint or when the FindOpenSSL CMake script gives you trouble; + * Java JDK, version 8 or later, e.g., [OpenJDK](https://jdk.java.net/); + * [Apache Maven](https://maven.apache.org/download.cgi), version 3.5 or later. + +On Ubuntu ``apt install maven default-jdk`` should do the trick for getting Java and Maven +installed, and the rest should already be there. On Windows, installing chocolatey and ``choco +install git cmake openjdk maven`` should get you a long way. On macOS, ``brew install maven cmake`` +and downloading and installing the JDK is easiest. The Java-based components are the preprocessor and a configurator tool. The run-time libraries are -pure C code, so there is no need to have Java available on "target" machines. +pure C code, so there is no need to have Java available on "target" machines. If desired, it is +possible to do a build without Java or Maven installed by defining ``BUILD_IDLC=NO`` and +``BUILD_CONFTOOL=NO``, but that effectively only gets you the core library. For the +current [ROS2 RMW layer](https://github.com/atolab/rmw_cyclonedds), that is sufficient. To obtain Eclipse Cyclone DDS, do @@ -40,13 +47,13 @@ DDS requires a few simple steps. There are some small differences between Linux hand, and Windows on the other. For Linux or macOS: $ cd build - $ cmake -DCMAKE_INSTALL_PREFIX= ../src + $ cmake -DCMAKE_INSTALL_PREFIX= .. $ cmake --build . and for Windows: $ cd build - $ cmake -G "" -DCMAKE_INSTALL_PREFIX= ../src + $ cmake -G "" -DCMAKE_INSTALL_PREFIX= .. $ cmake --build . where you should replace ```` by the directory under which you would like to @@ -65,7 +72,6 @@ which will copy everything to: * ``/bin`` * ``/include/ddsc`` * ``/share/CycloneDDS`` - * ``/etc/CycloneDDS`` Depending on the installation location you may need administrator privileges. @@ -85,7 +91,7 @@ present in the repository and that there is a test suite using CTest and CUnit t locally if desired. To build it, set the cmake variable ``BUILD_TESTING`` to on when configuring, e.g.: $ cd build - $ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ../src + $ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON .. $ cmake --build . $ ctest @@ -100,10 +106,65 @@ also need to add switches to select the architecture and build type, e.g., ``con arch=x86_64 -s build_type=Debug ..`` This will automatically download and/or build CUnit (and, at the moment, OpenSSL). +## Configuration + +The out-of-the-box configuration should usually be fine, but there are a great many options that can +be tweaked by creating an XML file with the desired settings and defining the ``CYCLONEDDS_URI`` to +point to it. E.g. (on Linux): + + $ cat cyclonedds.xml + + + auto + auto + 65500B + 65000B + + + + 500kB + + + + config + stdout + + + $ export CYCLONEDDS_URI=file://$PWD/cyclonedds.xml + +(on Windows, one would have to use ``set CYCLONEDDS_URI=file://...`` instead.) + +This example shows a few things: + +* ``NetworkInterfaceAddress`` can be used to override the interface selected by default (you can use + the address or the interface name). Proper use of multiple network interfaces simultaneously will + come, but is not there yet. +* ``AllowMulticast`` configures the circumstances under which multicast will be used. If the + selected interface doesn't support it, it obviously wonn't be used (``false``); but if it does + support it, the type of the network adapter determines the default value. For a wired network, it + will use multicast for initial discovery as well as for data when there are multiple peers that + the data needs to go to (``true``); but on a WiFi network it will use it only for initial + discovery (``spdp``), because multicast on WiFi is very unreliable. +* ``Verbosity`` allows control over the tracing, "config" dumps the configuration to the trace + output (which defaults to "cyclonedds.log"). Which interface is used, what multicast settings are + used, etc., is all in the trace. Setting the verbosity to "finest" gives way more output on the + inner workings, and there are various other levels as well. +* ``MaxMessageSize`` and ``FragmentSize`` control the maximum size of the RTPS messages (basically + the size of the UDP payload), and the size of the fragments into which very large samples get + split (which needs to be "a bit" less). Large values such as these typically improve performance + over the (current) default values. +* ``WhcHigh`` determines when the sender will wait for acknolwedgements from the readers because it + has buffered too much unacknowledged data. There is some auto-tuning, the (current) default value + is a bit small to get really high throughput. + +The configurator tool ``cycloneddsconf`` can help in discovering the settings, as can the config +dump. Background information on configuring Cyclone DDS can be +found [here](https://docs/manual/config.rst). + ## Documentation The documentation is still rather limited, and at the moment only available in the sources (in the -form of restructured text files in ``src/docs`` and Doxygen comments in the header files), or as +form of restructured text files in ``docs`` and Doxygen comments in the header files), or as a [PDF](https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/assets/pdf/CycloneDDS-0.1.0.pdf). The intent is to automate the process of building the documentation and have them available in more @@ -133,7 +194,7 @@ We will show you how to build and run an example program that measures latency. built automatically when you build Cyclone DDS, so you don't need to follow these steps to be able to run the program, it is merely to illustrate the process. - $ cd cyclonedds/src/examples/roundtrip + $ cd cyclonedds/examples/roundtrip $ mkdir build $ cd build $ cmake .. diff --git a/appveyor.yml b/appveyor.yml index 363272b..9e07208 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,7 +36,7 @@ build_script: - mkdir build - cd build - conan install -s arch=%ARCH% -s build_type=%CONFIGURATION% .. - - cmake -DBUILD_TESTING=on -DWERROR=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=%CD%/install -G "%GENERATOR%" ../src + - cmake -DBUILD_TESTING=on -DWERROR=ON -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=%CD%/install -G "%GENERATOR%" .. - cmake --build . --config %CONFIGURATION% --target install -- /maxcpucount - cd install/share/CycloneDDS/examples/helloworld - mkdir build diff --git a/src/cmake/modules/AnalyzeBuild.cmake b/cmake/Modules/AnalyzeBuild.cmake similarity index 100% rename from src/cmake/modules/AnalyzeBuild.cmake rename to cmake/Modules/AnalyzeBuild.cmake diff --git a/src/cmake/modules/CUnit.cmake b/cmake/Modules/CUnit.cmake similarity index 100% rename from src/cmake/modules/CUnit.cmake rename to cmake/Modules/CUnit.cmake diff --git a/src/cmake/modules/CUnit/include/CUnit/Test.h b/cmake/Modules/CUnit/include/CUnit/Test.h similarity index 100% rename from src/cmake/modules/CUnit/include/CUnit/Test.h rename to cmake/Modules/CUnit/include/CUnit/Test.h diff --git a/src/cmake/modules/CUnit/include/CUnit/Theory.h b/cmake/Modules/CUnit/include/CUnit/Theory.h similarity index 100% rename from src/cmake/modules/CUnit/include/CUnit/Theory.h rename to cmake/Modules/CUnit/include/CUnit/Theory.h diff --git a/src/cmake/modules/CUnit/src/main.c.in b/cmake/Modules/CUnit/src/main.c.in similarity index 100% rename from src/cmake/modules/CUnit/src/main.c.in rename to cmake/Modules/CUnit/src/main.c.in diff --git a/src/cmake/modules/FindCUnit.cmake b/cmake/Modules/FindCUnit.cmake similarity index 100% rename from src/cmake/modules/FindCUnit.cmake rename to cmake/Modules/FindCUnit.cmake diff --git a/src/cmake/modules/FindMaven.cmake b/cmake/Modules/FindMaven.cmake similarity index 100% rename from src/cmake/modules/FindMaven.cmake rename to cmake/Modules/FindMaven.cmake diff --git a/src/cmake/modules/FindOpenSSL.cmake b/cmake/Modules/FindOpenSSL.cmake similarity index 100% rename from src/cmake/modules/FindOpenSSL.cmake rename to cmake/Modules/FindOpenSSL.cmake diff --git a/src/cmake/modules/FindSphinx.cmake b/cmake/Modules/FindSphinx.cmake similarity index 100% rename from src/cmake/modules/FindSphinx.cmake rename to cmake/Modules/FindSphinx.cmake diff --git a/src/cmake/modules/GenerateDummyExportHeader.cmake b/cmake/Modules/GenerateDummyExportHeader.cmake similarity index 100% rename from src/cmake/modules/GenerateDummyExportHeader.cmake rename to cmake/Modules/GenerateDummyExportHeader.cmake diff --git a/src/cmake/modules/Glob.cmake b/cmake/Modules/Glob.cmake similarity index 100% rename from src/cmake/modules/Glob.cmake rename to cmake/Modules/Glob.cmake diff --git a/src/cmake/modules/Packaging.cmake b/cmake/Modules/Packaging.cmake similarity index 77% rename from src/cmake/modules/Packaging.cmake rename to cmake/Modules/Packaging.cmake index 9b76487..4d06fd2 100644 --- a/src/cmake/modules/Packaging.cmake +++ b/cmake/Modules/Packaging.cmake @@ -17,7 +17,7 @@ set(PACKAGING_INCLUDED true) include(CMakePackageConfigHelpers) include(GNUInstallDirs) -set(PACKAGING_MODULE_DIR "${PROJECT_SOURCE_DIR}/cmake/modules/Packaging") +set(PACKAGING_MODULE_DIR "${PROJECT_SOURCE_DIR}/cmake/Modules/Packaging") set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}") # Generates Config.cmake. @@ -54,15 +54,13 @@ set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_VERSION_TWEAK ${PROJECT_VERSION_TWEAK}) set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) -set(VENDOR_INSTALL_ROOT "ADLINK") set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) -set(CPACK_PACKAGE_VENDOR "ADLINK Technology Inc.") -set(CPACK_PACKAGE_CONTACT "${CMAKE_PROJECT_NAME} core developers ") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Leading OMG DDS implementation from ADLINK Technology") -set(CPACK_PACKAGE_ICON "${PACKAGING_MODULE_DIR}/vortex.ico") +set(CPACK_PACKAGE_VENDOR "Eclipse Cyclone DDS project") +set(CPACK_PACKAGE_CONTACT "https://github.com/eclipse-cyclonedds/cyclonedds") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Implementation of the OMG DDS standard") # WiX requires a .txt file extension for CPACK_RESOURCE_FILE_LICENSE -file(COPY "${PROJECT_SOURCE_DIR}/../LICENSE" DESTINATION "${CMAKE_BINARY_DIR}") +file(COPY "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION "${CMAKE_BINARY_DIR}") file(RENAME "${CMAKE_BINARY_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/license.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/license.txt") @@ -95,24 +93,7 @@ if(WIN32 AND NOT UNIX) set(CPACK_GENERATOR "WIX;ZIP;${CPACK_GENERATOR}" CACHE STRING "List of package generators") set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${__arch}") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "${VENDOR_INSTALL_ROOT}/${CMAKE_PROJECT_NAME_FULL}") - - set(CPACK_WIX_LIGHT_EXTENSIONS "WixUtilExtension") - set(CPACK_WIX_COMPONENT_INSTALL ON) - set(CPACK_WIX_ROOT_FEATURE_TITLE "${CMAKE_PROJECT_NAME_FULL}") - set(CPACK_WIX_PRODUCT_ICON "${PACKAGING_MODULE_DIR}/vortex.ico") - # Bitmap (.bmp) of size 493x58px - set(CPACK_WIX_UI_BANNER "${PACKAGING_MODULE_DIR}/banner.bmp") - # Bitmap (.bmp) of size 493x312px - set(CPACK_WIX_UI_DIALOG "${PACKAGING_MODULE_DIR}/dialog.png") - set(CPACK_WIX_PROGRAM_MENU_FOLDER "${CPACK_PACKAGE_NAME_FULL}") - set(CPACK_WIX_PATCH_FILE "${PACKAGING_MODULE_DIR}/examples.xml") - set(CPACK_WIX_PROPERTY_ARPHELPLINK "http://www.adlinktech.com/support") - set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.adlinktech.com/") - set(CPACK_WIX_PROPERTY_ARPURLUPDATEINFO "http://www.adlinktech.com/") - - # A constant GUID allows installers to replace existing installations that use the same GUID. - set(CPACK_WIX_UPGRADE_GUID "1351F59A-972B-4624-A7F1-439381BFA41D") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME_FULL}") include(InstallRequiredSystemLibraries) elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -159,10 +140,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") # Generic tgz package set(CPACK_GENERATOR "TGZ;${CPACK_GENERATOR}" CACHE STRING "List of package generators") endif() -elseif(CMAKE_SYSTEM_NAME MATCHES "VxWorks") - # FIXME: Support for VxWorks packages must still be implemented (probably - # just a compressed tarball) - message(STATUS "Packaging for VxWorks is unsupported") endif() # This must always be last! diff --git a/src/cmake/modules/Packaging/PackageConfig.cmake.in b/cmake/Modules/Packaging/PackageConfig.cmake.in similarity index 100% rename from src/cmake/modules/Packaging/PackageConfig.cmake.in rename to cmake/Modules/Packaging/PackageConfig.cmake.in diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt new file mode 100644 index 0000000..891bc0d --- /dev/null +++ b/docs/CMakeLists.txt @@ -0,0 +1,49 @@ +# +# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License +# v. 1.0 which is available at +# http://www.eclipse.org/org/documents/edl-v10.php. +# +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + +# TODO depending on requirements we can add/remove options as needed, +# these are examples of generators we'll need as a minimum. +# Perhaps we should also consider options for building subset of all docs. +# When a certain doc is related to a target, no option is needed; you can simply check if the target exists +# (i.e. if a target 'ddsc' exists, build ddsc api docs). And possibly make the target definition dependent on an option. + +find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx documentation builder") +if (NOT SPHINX_EXECUTABLE) + message(FATAL_ERROR "${CMAKE_PROJECT_NAME} documentation: unable to find sphinx-build executable") +endif() + +find_package(Doxygen) +if (NOT Doxygen_FOUND) + message(FATAL_ERROR "${CMAKE_PROJECT_NAME} documentation: unable to find Doxygen") +endif() + +# Creating pdf from latex requires latexmk (which depends on perl, latexpdf et. al) +find_program(LATEXMK_EXECUTABLE NAMES latexmk DOC "LateX PDF Generator") +if (NOT LATEXMK_EXECUTABLE) + message(FATAL_ERROR "${CMAKE_PROJECT_NAME} documentation: unable to find latexmk") +endif() + +if (SPHINX_EXECUTABLE AND Doxygen_FOUND AND LATEXMK_EXECUTABLE) + set(BUILD_DOCS ON PARENT_SCOPE) # for examples' docs + set(BUILD_DOCS ON) + message(STATUS "${CMAKE_PROJECT_NAME} documentation: Success (build)") +endif() + +if(BUILD_DOCS) + add_subdirectory(manual) +endif() + +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + DESTINATION ${CMAKE_INSTALL_DOCDIR} + COMPONENT dev) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pdf + DESTINATION ${CMAKE_INSTALL_DOCDIR} + COMPONENT dev) diff --git a/notes/data path - rbuf.svg b/docs/dev/data path - rbuf.svg similarity index 100% rename from notes/data path - rbuf.svg rename to docs/dev/data path - rbuf.svg diff --git a/notes/data path - receive.svg b/docs/dev/data path - receive.svg similarity index 100% rename from notes/data path - receive.svg rename to docs/dev/data path - receive.svg diff --git a/notes/data path - transmit.svg b/docs/dev/data path - transmit.svg similarity index 100% rename from notes/data path - transmit.svg rename to docs/dev/data path - transmit.svg diff --git a/notes/data path.graffle b/docs/dev/data path.graffle similarity index 100% rename from notes/data path.graffle rename to docs/dev/data path.graffle diff --git a/docs/manual/CMakeLists.txt b/docs/manual/CMakeLists.txt new file mode 100644 index 0000000..c49b5cf --- /dev/null +++ b/docs/manual/CMakeLists.txt @@ -0,0 +1,122 @@ +# +# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License +# v. 1.0 which is available at +# http://www.eclipse.org/org/documents/edl-v10.php. +# +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause + +# TODO depending on requirements we can add/remove options as needed, +# these are examples of generators we'll need as a minimum. +# Perhaps we should also consider options for building subset of all docs. +# When a certain doc is related to a target, no option is needed; you can simply check if the target exists +# (i.e. if a target 'ddsc' exists, build ddsc api docs). And possibly make the target definition dependent on an option. + +# Generate ddsc API docs in XML format using Doxygen, if the ddsc target is defined. +# The XML will serve as input for sphinx' breathe plugin +if (TARGET ${CMAKE_PROJECT_NAME}::ddsc) + # Process doxygen configuration file, for ddsc + set(doxy_conf_project "${CMAKE_PROJECT_NAME_FULL} C API Documentation") + set(doxy_conf_outputdir "ddsc_api") + set(doxy_conf_input "${PROJECT_SOURCE_DIR}/src/core/ddsc/include/dds/dds.h ${PROJECT_SOURCE_DIR}/src/core/ddsc/include/dds") + configure_file(Doxyfile.in Doxyfile @ONLY) + + add_custom_target(ddsc_docs + ${DOXYGEN_EXECUTABLE} Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Running Doxygen for API docs generation" + VERBATIM) + + # Remove generated files when cleaning the build tree + set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${doxy_conf_outputdir}) + + # Add ddsc api docs to sphinx' breathe projects + set(sph_conf_breathe_projs "\"ddsc_api\": \"${doxy_conf_outputdir}/xml\"") + + add_custom_command(TARGET ddsc_docs + POST_BUILD + WORKING_DIRECTORY "${doxy_conf_outputdir}" + COMMAND ${CMAKE_COMMAND} -E tar "zcf" "${CMAKE_PROJECT_NAME}_C_HTML.tar.gz" "ddsc") +endif() + +# Process sphinx configuration file +set(sph_conf_author "Eclipse Cyclone DDS project") +set(sph_conf_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") +set(sph_conf_release "${PROJECT_VERSION}") +configure_file(conf.py.in conf.py @ONLY) + +# Define a list of output formats (-b option for sphinx-build) +set(docs_builders "") +list(APPEND docs_builders html) +list(APPEND docs_builders latex) + +# Define custom commands for running sphinx-build for different docs builders +set(docs_outputs "") +foreach(builder ${docs_builders}) + set(docs_builder_output "docs_${builder}_output") + # Log stdout (not stderr) to a file instead of messing up build output + set(docs_builder_log "sphinx-build-${builder}.log") + + add_custom_command(OUTPUT ${docs_builder_output} + COMMAND ${SPHINX_EXECUTABLE} + -b ${builder} + -d ${CMAKE_CURRENT_BINARY_DIR}/cache + -c ${CMAKE_CURRENT_BINARY_DIR} + ${PROJECT_SOURCE_DIR}/docs/manual + ${CMAKE_CURRENT_BINARY_DIR}/${builder} > ${docs_builder_log} + COMMENT "Running Sphinx for ${builder} output" + VERBATIM) + + # FIXME: This is definitely in the wrong location + if(builder STREQUAL html) + add_custom_command(OUTPUT ${docs_builder_output} + COMMAND ${CMAKE_COMMAND} + -E tar "zcf" + "${CMAKE_PROJECT_NAME}HTML.tar.gz" + "html" + APPEND + VERBATIM) + endif() + + # Create a pdf from the latex builder output, by appending a latexmk command + # TODO look into rinohtype as an alternative (don't bother with rst2pdf, it's no good) + if(builder STREQUAL latex) + add_custom_command(OUTPUT ${docs_builder_output} + COMMAND ${LATEXMK_EXECUTABLE} + -interaction=nonstopmode + -silent + -output-directory=${builder} + -pdf -dvi- -ps- -cd- ${builder}/${CMAKE_PROJECT_NAME}.tex + APPEND + VERBATIM) + + # Move the pdf, so that install rules don't need to differentiate between built and downloaded docs + add_custom_command(OUTPUT ${docs_builder_output} + COMMAND ${CMAKE_COMMAND} + -E rename + "latex/${CMAKE_PROJECT_NAME}.pdf" + "${CMAKE_PROJECT_NAME}.pdf" + APPEND + VERBATIM) + endif() + + # OUTPUT is a fake target / symbolic name, not an actual file + set_property(SOURCE ${docs_builder_output} PROPERTY SYMBOLIC 1) + # Remove generated files when cleaning the build tree + set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES + ${builder} + ${docs_builder_log}) + + # Include this builder as a dependency of the general 'docs' target + list(APPEND docs_outputs ${docs_builder_output}) +endforeach() + +# Remove generated files when cleaning the build tree +set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES + ${CMAKE_PROJECT_NAME}HTML.tar.gz + ${CMAKE_PROJECT_NAME}.pdf) + +add_custom_target(docs ALL DEPENDS ddsc_docs ${docs_outputs}) diff --git a/src/docs/Doxyfile.in b/docs/manual/Doxyfile.in similarity index 99% rename from src/docs/Doxyfile.in rename to docs/manual/Doxyfile.in index 32aebfe..3d139a2 100644 --- a/src/docs/Doxyfile.in +++ b/docs/manual/Doxyfile.in @@ -2019,7 +2019,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = @PROJECT_SOURCE_DIR@/core/ddsc/include +INCLUDE_PATH = @PROJECT_SOURCE_DIR@/src/core/ddsc/include # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2037,7 +2037,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = __restrict= __attribute__(x)= __declspec(x)= +PREDEFINED = __restrict= __attribute__(x)= __declspec(x)= DDS_EXPORT= DDS_DEPRECATED_EXPORT= # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/src/docs/GettingStartedGuide/helloworld.rst b/docs/manual/GettingStartedGuide/helloworld.rst similarity index 99% rename from src/docs/GettingStartedGuide/helloworld.rst rename to docs/manual/GettingStartedGuide/helloworld.rst index 3b0169f..c2c7862 100644 --- a/src/docs/GettingStartedGuide/helloworld.rst +++ b/docs/manual/GettingStartedGuide/helloworld.rst @@ -195,7 +195,7 @@ example. Apart from the native build files, CMake build files are provided as well. See :code:`examples/helloworld/CMakeLists.txt` -.. literalinclude:: ../../examples/helloworld/CMakeLists.export +.. literalinclude:: ../../../examples/helloworld/CMakeLists.export :linenos: :language: cmake diff --git a/src/docs/GettingStartedGuide/helloworld_indepth.rst b/docs/manual/GettingStartedGuide/helloworld_indepth.rst similarity index 98% rename from src/docs/GettingStartedGuide/helloworld_indepth.rst rename to docs/manual/GettingStartedGuide/helloworld_indepth.rst index 94a4575..8313290 100644 --- a/src/docs/GettingStartedGuide/helloworld_indepth.rst +++ b/docs/manual/GettingStartedGuide/helloworld_indepth.rst @@ -77,7 +77,7 @@ There are a few ways to describe the structures that make up the data layer. The HelloWorld uses the IDL language to describe the data type in HelloWorldData.idl: -.. literalinclude:: ../../examples/helloworld/HelloWorldData.idl +.. literalinclude:: ../../../examples/helloworld/HelloWorldData.idl :linenos: :language: idl @@ -202,7 +202,7 @@ business logic. Subscriber.c contains the source that will wait for a *Hello World!* message and reads it when it receives one. -.. literalinclude:: ../../examples/helloworld/subscriber.c +.. literalinclude:: ../../../examples/helloworld/subscriber.c :linenos: :language: c @@ -331,7 +331,7 @@ automatically delete the topic and reader as well. Publisher.c contains the source that will write an *Hello World!* message on which the subscriber is waiting. -.. literalinclude:: ../../examples/helloworld/publisher.c +.. literalinclude:: ../../../examples/helloworld/publisher.c :linenos: :language: c diff --git a/src/docs/GettingStartedGuide/index.rst b/docs/manual/GettingStartedGuide/index.rst similarity index 100% rename from src/docs/GettingStartedGuide/index.rst rename to docs/manual/GettingStartedGuide/index.rst diff --git a/src/docs/GettingStartedGuide/installation.rst b/docs/manual/GettingStartedGuide/installation.rst similarity index 100% rename from src/docs/GettingStartedGuide/installation.rst rename to docs/manual/GettingStartedGuide/installation.rst diff --git a/src/docs/GettingStartedGuide/next_steps.rst b/docs/manual/GettingStartedGuide/next_steps.rst similarity index 100% rename from src/docs/GettingStartedGuide/next_steps.rst rename to docs/manual/GettingStartedGuide/next_steps.rst diff --git a/src/docs/GettingStartedGuide/uninstall.rst b/docs/manual/GettingStartedGuide/uninstall.rst similarity index 100% rename from src/docs/GettingStartedGuide/uninstall.rst rename to docs/manual/GettingStartedGuide/uninstall.rst diff --git a/src/docs/_static/BuildSchema.odg b/docs/manual/_static/BuildSchema.odg similarity index 100% rename from src/docs/_static/BuildSchema.odg rename to docs/manual/_static/BuildSchema.odg diff --git a/src/docs/_static/pictures/BuildSchema.png b/docs/manual/_static/pictures/BuildSchema.png similarity index 100% rename from src/docs/_static/pictures/BuildSchema.png rename to docs/manual/_static/pictures/BuildSchema.png diff --git a/src/docs/_static/pictures/HelloworldPublisherWindows.png b/docs/manual/_static/pictures/HelloworldPublisherWindows.png similarity index 100% rename from src/docs/_static/pictures/HelloworldPublisherWindows.png rename to docs/manual/_static/pictures/HelloworldPublisherWindows.png diff --git a/src/docs/_static/pictures/HelloworldSubscriberWindows.png b/docs/manual/_static/pictures/HelloworldSubscriberWindows.png similarity index 100% rename from src/docs/_static/pictures/HelloworldSubscriberWindows.png rename to docs/manual/_static/pictures/HelloworldSubscriberWindows.png diff --git a/src/docs/_static/pictures/VORTEX_LOGO.png b/docs/manual/_static/pictures/VORTEX_LOGO.png similarity index 100% rename from src/docs/_static/pictures/VORTEX_LOGO.png rename to docs/manual/_static/pictures/VORTEX_LOGO.png diff --git a/src/docs/_static/pictures/settings-icon.png b/docs/manual/_static/pictures/settings-icon.png similarity index 100% rename from src/docs/_static/pictures/settings-icon.png rename to docs/manual/_static/pictures/settings-icon.png diff --git a/src/docs/conf.py.in b/docs/manual/conf.py.in similarity index 100% rename from src/docs/conf.py.in rename to docs/manual/conf.py.in diff --git a/src/docs/config.rst b/docs/manual/config.rst similarity index 100% rename from src/docs/config.rst rename to docs/manual/config.rst diff --git a/src/docs/ddsc.rst b/docs/manual/ddsc.rst similarity index 100% rename from src/docs/ddsc.rst rename to docs/manual/ddsc.rst diff --git a/src/docs/index.rst b/docs/manual/index.rst similarity index 100% rename from src/docs/index.rst rename to docs/manual/index.rst diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..28e9944 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,105 @@ +# +# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License v. 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License +# v. 1.0 which is available at +# http://www.eclipse.org/org/documents/edl-v10.php. +# +# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause +# +set(CMAKE_INSTALL_EXAMPLESDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/examples") + +add_subdirectory(helloworld) +add_subdirectory(roundtrip) +add_subdirectory(throughput) + +if (BUILD_DOCS) + message(STATUS "${CMAKE_PROJECT_NAME} Examples documentation: Success (build)") + set(EXAMPLES_HTML_ARCHIVE "${CMAKE_PROJECT_NAME}ExamplesHTML.tar.gz") + # Process sphinx configuration file + set(sph_conf_author "Eclipse Cyclone DDS project") + string(TIMESTAMP sph_conf_copyright "%Y") + set(sph_conf_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") + set(sph_conf_release "${PROJECT_VERSION}") + configure_file(sphinx-conf.py.in conf.py @ONLY) + + set(builder_output "examples_html_output") + set(builder_log "sphinx-examples-html.log") + add_custom_command(OUTPUT ${builder_output} + COMMAND ${SPHINX_EXECUTABLE} + -b html + -d ${CMAKE_CURRENT_BINARY_DIR}/cache + -c ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} > ${builder_log} + COMMENT "Running Sphinx for examples html output" + VERBATIM) + + # OUTPUT is a fake target / symbolic name, not an actual file + set_property(SOURCE ${builder_output} PROPERTY SYMBOLIC 1) + add_custom_target(examples_docs ALL DEPENDS ${builder_output}) + + # Archive the output html files, will become a jenkins artifact for use in other jobs + # TODO this hardcoded list and archiving should be replaced by ExternalData refs + set(html_outputs + "_static" + "search.html" + "searchindex.js" + "genindex.html" + "examples.html" + "helloworld/readme.html" + "roundtrip/readme.html" + "throughput/readme.html") + + add_custom_command(OUTPUT ${builder_output} + COMMAND ${CMAKE_COMMAND} + -E tar "zcf" + "${EXAMPLES_HTML_ARCHIVE}" + ${html_outputs} + APPEND + VERBATIM) + + # Remove generated files when cleaning the build tree + set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES + "cache" + "${builder_log}" + "objects.inv" + ${html_outputs} + "_sources" + "${EXAMPLES_HTML_ARCHIVE}") +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "Windows") + set(platform_exclude "examples/helloworld/Makefile") +elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(platform_exclude "examples/helloworld/vs|examples/helloworld/HelloWorld\.sln") +else() + set(platform_exclude "this_is_a_placeholder") +endif() + +# Install example source-files +install( + DIRECTORY "${PROJECT_SOURCE_DIR}/examples/" + DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}" + COMPONENT dev + PATTERN "CMakeLists.export" EXCLUDE + PATTERN "examples/CMakeLists.txt" EXCLUDE + REGEX ${platform_exclude} EXCLUDE + REGEX "\.rst|\.py" EXCLUDE) + +# Install example html docs files +# TODO this should be replaced by install commands that use ExternalData refs (preferably in examples' CMakeLists.txt) +install( + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}" + COMPONENT dev + FILES_MATCHING + PATTERN "CMakeFiles" EXCLUDE + PATTERN "cache" EXCLUDE + PATTERN "_sources" EXCLUDE + PATTERN "*.html" + PATTERN "*.js" + PATTERN "_static/*") + diff --git a/src/examples/examples.rst b/examples/examples.rst similarity index 100% rename from src/examples/examples.rst rename to examples/examples.rst diff --git a/src/examples/helloworld/CMakeLists.export b/examples/helloworld/CMakeLists.export similarity index 100% rename from src/examples/helloworld/CMakeLists.export rename to examples/helloworld/CMakeLists.export diff --git a/src/examples/helloworld/CMakeLists.txt b/examples/helloworld/CMakeLists.txt similarity index 100% rename from src/examples/helloworld/CMakeLists.txt rename to examples/helloworld/CMakeLists.txt diff --git a/src/examples/helloworld/HelloWorld.sln b/examples/helloworld/HelloWorld.sln similarity index 100% rename from src/examples/helloworld/HelloWorld.sln rename to examples/helloworld/HelloWorld.sln diff --git a/src/examples/helloworld/HelloWorldData.idl b/examples/helloworld/HelloWorldData.idl similarity index 100% rename from src/examples/helloworld/HelloWorldData.idl rename to examples/helloworld/HelloWorldData.idl diff --git a/src/examples/helloworld/Makefile b/examples/helloworld/Makefile similarity index 100% rename from src/examples/helloworld/Makefile rename to examples/helloworld/Makefile diff --git a/src/examples/helloworld/publisher.c b/examples/helloworld/publisher.c similarity index 100% rename from src/examples/helloworld/publisher.c rename to examples/helloworld/publisher.c diff --git a/src/examples/helloworld/readme.rst b/examples/helloworld/readme.rst similarity index 100% rename from src/examples/helloworld/readme.rst rename to examples/helloworld/readme.rst diff --git a/src/examples/helloworld/subscriber.c b/examples/helloworld/subscriber.c similarity index 100% rename from src/examples/helloworld/subscriber.c rename to examples/helloworld/subscriber.c diff --git a/src/examples/helloworld/vs/HelloWorldPublisher.vcxproj b/examples/helloworld/vs/HelloWorldPublisher.vcxproj similarity index 100% rename from src/examples/helloworld/vs/HelloWorldPublisher.vcxproj rename to examples/helloworld/vs/HelloWorldPublisher.vcxproj diff --git a/src/examples/helloworld/vs/HelloWorldSubscriber.vcxproj b/examples/helloworld/vs/HelloWorldSubscriber.vcxproj similarity index 100% rename from src/examples/helloworld/vs/HelloWorldSubscriber.vcxproj rename to examples/helloworld/vs/HelloWorldSubscriber.vcxproj diff --git a/src/examples/helloworld/vs/HelloWorldType.vcxproj b/examples/helloworld/vs/HelloWorldType.vcxproj similarity index 100% rename from src/examples/helloworld/vs/HelloWorldType.vcxproj rename to examples/helloworld/vs/HelloWorldType.vcxproj diff --git a/src/examples/helloworld/vs/directories.props b/examples/helloworld/vs/directories.props similarity index 100% rename from src/examples/helloworld/vs/directories.props rename to examples/helloworld/vs/directories.props diff --git a/performance/ethload b/examples/perfscript/ethload similarity index 100% rename from performance/ethload rename to examples/perfscript/ethload diff --git a/performance/quick-microbenchmark b/examples/perfscript/quick-microbenchmark similarity index 100% rename from performance/quick-microbenchmark rename to examples/perfscript/quick-microbenchmark diff --git a/performance/throughput-fanout-test b/examples/perfscript/throughput-fanout-test similarity index 100% rename from performance/throughput-fanout-test rename to examples/perfscript/throughput-fanout-test diff --git a/performance/throughput-test b/examples/perfscript/throughput-test similarity index 100% rename from performance/throughput-test rename to examples/perfscript/throughput-test diff --git a/performance/throughput-test-extract b/examples/perfscript/throughput-test-extract similarity index 100% rename from performance/throughput-test-extract rename to examples/perfscript/throughput-test-extract diff --git a/performance/throughput-test-plot b/examples/perfscript/throughput-test-plot similarity index 100% rename from performance/throughput-test-plot rename to examples/perfscript/throughput-test-plot diff --git a/src/examples/roundtrip/CMakeLists.txt b/examples/roundtrip/CMakeLists.txt similarity index 100% rename from src/examples/roundtrip/CMakeLists.txt rename to examples/roundtrip/CMakeLists.txt diff --git a/src/examples/roundtrip/RoundTrip.idl b/examples/roundtrip/RoundTrip.idl similarity index 100% rename from src/examples/roundtrip/RoundTrip.idl rename to examples/roundtrip/RoundTrip.idl diff --git a/src/examples/roundtrip/ping.c b/examples/roundtrip/ping.c similarity index 100% rename from src/examples/roundtrip/ping.c rename to examples/roundtrip/ping.c diff --git a/src/examples/roundtrip/pong.c b/examples/roundtrip/pong.c similarity index 100% rename from src/examples/roundtrip/pong.c rename to examples/roundtrip/pong.c diff --git a/src/examples/roundtrip/readme.rst b/examples/roundtrip/readme.rst similarity index 100% rename from src/examples/roundtrip/readme.rst rename to examples/roundtrip/readme.rst diff --git a/src/examples/sphinx-conf.py.in b/examples/sphinx-conf.py.in similarity index 97% rename from src/examples/sphinx-conf.py.in rename to examples/sphinx-conf.py.in index a364e80..acd4026 100644 --- a/src/examples/sphinx-conf.py.in +++ b/examples/sphinx-conf.py.in @@ -68,7 +68,7 @@ html_theme_options = { 'show_powered_by': False } # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['@PROJECT_SOURCE_DIR@/docs/_static'] +html_static_path = ['@PROJECT_SOURCE_DIR@/docs/manual/_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. diff --git a/src/examples/throughput/CMakeLists.txt b/examples/throughput/CMakeLists.txt similarity index 100% rename from src/examples/throughput/CMakeLists.txt rename to examples/throughput/CMakeLists.txt diff --git a/src/examples/throughput/Throughput.idl b/examples/throughput/Throughput.idl similarity index 100% rename from src/examples/throughput/Throughput.idl rename to examples/throughput/Throughput.idl diff --git a/src/examples/throughput/publisher.c b/examples/throughput/publisher.c similarity index 100% rename from src/examples/throughput/publisher.c rename to examples/throughput/publisher.c diff --git a/src/examples/throughput/readme.rst b/examples/throughput/readme.rst similarity index 100% rename from src/examples/throughput/readme.rst rename to examples/throughput/readme.rst diff --git a/src/examples/throughput/subscriber.c b/examples/throughput/subscriber.c similarity index 100% rename from src/examples/throughput/subscriber.c rename to examples/throughput/subscriber.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e5beb7a..ca59544 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others +# Copyright(c) 2019 ADLINK Technology Limited and others # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0 which is available at @@ -11,208 +11,20 @@ # cmake_minimum_required(VERSION 3.7) -# Set a default build type if none was specified -set(default_build_type "RelWithDebInfo") -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to '${default_build_type}' as none was specified.") - set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE - STRING "Choose the type of build." FORCE) - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +if(NOT ${PROJECT_NAME} STREQUAL "CycloneDDS") + get_filename_component(dir ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) + message(FATAL_ERROR "Top-level CMakeLists.txt was moved to the top-level directory. Please run cmake on ${dir} instead of ${CMAKE_CURRENT_LIST_DIR}") endif() -# By default don't treat warnings as errors, else anyone building it with a different compiler that -# just happens to generate a warning, as well as anyone adding or modifying something and making a -# small mistake would run into errors. CI builds can be configured differently. -option(WERROR "Treat compiler warnings as errors" OFF) - -FUNCTION(PREPEND var prefix) - SET(listVar "") - FOREACH(f ${ARGN}) - LIST(APPEND listVar "${prefix}/${f}") - ENDFOREACH(f) - SET(${var} "${listVar}" PARENT_SCOPE) -ENDFUNCTION(PREPEND) - -# Update the git submodules -execute_process(COMMAND git submodule init - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) -execute_process(COMMAND git submodule update - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - -# Set module path before defining project so platform files will work. -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") -set(CMAKE_PROJECT_NAME_FULL "Eclipse Cyclone DDS") -set(PROJECT_NAME "CycloneDDS") -project(${PROJECT_NAME} VERSION 0.1.0) - -# Set some convenience variants of the project-name -string(REPLACE " " "-" CMAKE_PROJECT_NAME_DASHED "${CMAKE_PROJECT_NAME_FULL}") -string(TOUPPER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_CAPS) -string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_SMALL) - -set(CMAKE_C_STANDARD 99) -if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks") - add_definitions(-std=c99) -endif() - -if(${CMAKE_C_COMPILER_ID} STREQUAL "SunPro") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -xc99 -D__restrict=restrict -D__deprecated__=") - set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -m64") -endif() - -# Conan -if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake") - include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) - if(APPLE) - # By default Conan strips all RPATHs (see conanbuildinfo.cmake), which - # causes tests to fail as the executables cannot find the library target. - # By setting KEEP_RPATHS, Conan does not set CMAKE_SKIP_RPATH and the - # resulting binaries still have the RPATH information. This is fine because - # CMake will strip the build RPATH information in the install step. - # - # NOTE: - # Conan's default approach is to use the "imports" feature, which copies - # all the dependencies into the bin directory. Of course, this doesn't work - # quite that well for libraries generated in this Project (see Conan - # documentation). - # - # See the links below for more information. - # https://github.com/conan-io/conan/issues/337 - # https://docs.conan.io/en/latest/howtos/manage_shared_libraries/rpaths.html - # https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling - conan_basic_setup(KEEP_RPATHS) - else() - conan_basic_setup() - endif() - conan_define_targets() -endif() - -# Set reasonably strict warning options for clang, gcc, msvc -# Enable coloured ouput if Ninja is used for building -if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") - #message(STATUS clang) - add_compile_options(-Wall -Wextra -Wconversion -Wunused -Wmissing-prototypes) - if(${WERROR}) - add_compile_options(-Werror) - endif() - if("${CMAKE_GENERATOR}" STREQUAL "Ninja") - add_compile_options(-Xclang -fcolor-diagnostics) - endif() -elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - #message(STATUS gcc) - add_compile_options(-Wall -Wextra -Wconversion -Wmissing-prototypes) - if(${WERROR}) - add_compile_options(-Werror) - endif() - if("${CMAKE_GENERATOR}" STREQUAL "Ninja") - add_compile_options(-fdiagnostics-color=always) - endif() -elseif("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") - #message(STATUS msvc) - add_compile_options(/W3) - if(${WERROR}) - add_compile_options(/WX) - endif() -endif() - -# I don't know how to enable warnings properly so that it ends up in Xcode projects as well -if(${CMAKE_GENERATOR} STREQUAL "Xcode") - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SHADOW YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_FLOAT_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_NON_LITERAL_NULL_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_IMPLICIT_SIGN_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INFINITE_RECURSION YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_MISSING_PARENTHESES YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ASSIGN_ENUM YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SEMICOLON_BEFORE_METHOD_BODY YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_STRICT_PROTOTYPES YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_COMMA YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS YES_AGGRESSIVE) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_LABEL YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_PARAMETER YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE YES) - set (CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_DOCUMENTATION_COMMENTS YES) - set (CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_MISSING_PROTOTYPES YES) -endif() - -# Make it easy to enable one of Clang's/gcc's analyzers, and default to using -# the address sanitizer for ordinary debug builds; gcc is giving some grief on -# Travis, so don't enable it for gcc by default -if(NOT USE_SANITIZER) - if(${CMAKE_BUILD_TYPE} STREQUAL "Debug" AND - NOT (${CMAKE_GENERATOR} STREQUAL "Xcode") AND - (${CMAKE_C_COMPILER_ID} STREQUAL "Clang" - OR ${CMAKE_C_COMPILER_ID} STREQUAL "AppleClang")) - message(STATUS "Enabling address sanitizer; set USE_SANITIZER=none to prevent this") - set(USE_SANITIZER address) - else() - set(USE_SANITIZER none) - endif() -endif() -if(NOT (${USE_SANITIZER} STREQUAL "none")) - message(STATUS "Sanitizer set to ${USE_SANITIZER}") - add_compile_options(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER}) - link_libraries(-fno-omit-frame-pointer -fsanitize=${USE_SANITIZER}) -endif() - -include(GNUInstallDirs) -include(AnalyzeBuild) -if(APPLE) - set(CMAKE_INSTALL_RPATH "@loader_path/../${CMAKE_INSTALL_LIBDIR}") -else() - set(CMAKE_INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") -endif() -# Include Coverage before CTest so that COVERAGE_COMMAND can be modified -# in the Coverage module should that ever be necessary. -include(Coverage) -set(MEMORYCHECK_COMMAND_OPTIONS "--track-origins=yes --leak-check=full --trace-children=yes --child-silent-after-fork=yes --xml=yes --xml-file=TestResultValgrind_%p.xml --tool=memcheck --show-reachable=yes --leak-resolution=high") - -# By default building the testing tree is enabled by including CTest, but -# since not everybody has CUnit, and because it is not strictly required to -# build the product itself, switch to off by default. -option(BUILD_TESTING "Build the testing tree." OFF) -include(CTest) - -# Build all executables and libraries into the top-level /bin and /lib folders. -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") - -add_subdirectory(idlc) add_subdirectory(ddsrt) -add_subdirectory(etc) + +# some of the tests in the core rely on preprocessing IDL, so idlc has to +# come first +if(BUILD_IDLC) + add_subdirectory(idlc) +endif() add_subdirectory(core) add_subdirectory(tools) -add_subdirectory(scripts) - -option(USE_DOCS "Enable documentation." OFF) -if(USE_DOCS) - add_subdirectory(docs) -else() - message(STATUS "${CMAKE_PROJECT_NAME} documentation: disabled (-DUSE_DOCS=1 to enable)") -endif() - -add_subdirectory(examples) - -if(BUILD_TESTING AND HAVE_MULTI_PROCESS) +if(BUILD_TESTING AND HAVE_MULTI_PROCESS AND BUILD_IDLC) add_subdirectory(mpt) endif() - -# Pull-in CPack and support for generating Config.cmake and packages. -include(Packaging) diff --git a/src/cmake/CoverageSettings.cmake.in b/src/cmake/CoverageSettings.cmake.in deleted file mode 100644 index 818584e..0000000 --- a/src/cmake/CoverageSettings.cmake.in +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# -cmake_minimum_required(VERSION 3.5) - -set(COVERAGE_SOURCE_DIR "@PROJECT_SOURCE_DIR@") -set(COVERAGE_RUN_DIR "@CMAKE_BINARY_DIR@") -set(COVERAGE_OUTPUT_DIR "@CMAKE_BINARY_DIR@/coverage") - -# TODO: Make this a list instead of separate variables when more directories -# need to be excluded. Currently there's actually only one directory to -# be excluded, but when the test(s) are moved, more directories will be -# added. I just added two directories to indicate how the coverage -# generators handle multiple exclusion directories. -# -# Do not include the various test directories. -set(COVERAGE_EXCLUDE_TESTS "tests") -set(COVERAGE_EXCLUDE_EXAMPLES "examples") -set(COVERAGE_EXCLUDE_BUILD_SUPPORT "cmake") - -# Add this flag when you want to suppress LCOV and ctest outputs during coverage collecting. -#set(COVERAGE_QUIET_FLAG "--quiet") - diff --git a/src/cmake/launch-c.bat.in b/src/cmake/launch-c.bat.in deleted file mode 100644 index 8f771d9..0000000 --- a/src/cmake/launch-c.bat.in +++ /dev/null @@ -1,26 +0,0 @@ -@echo off -REM Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -REM -REM This program and the accompanying materials are made available under the -REM terms of the Eclipse Public License v. 2.0 which is available at -REM http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -REM v. 1.0 which is available at -REM http://www.eclipse.org/org/documents/edl-v10.php. -REM -REM SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause - -REM VxWorks toolchain requires WIND_BASE to be exported, should the user be -REM compiling for VxWorks and not have WIND_BASE exported, do that here before -REM invoking the compiler. -if "%WIND_BASE%" == "" ( - set WIND_BASE="@WIND_BASE@" -) - -REM Strip C compiler from command line arguments for compatibility because -REM this launcher may also be used from an integrated development environment -REM at some point. -if "%1" == "@CMAKE_C_COMPILER@" ( - shift -) - -"@CMAKE_C_COMPILER@" %* diff --git a/src/cmake/launch-c.in b/src/cmake/launch-c.in deleted file mode 100644 index 27a64da..0000000 --- a/src/cmake/launch-c.in +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# VxWorks toolchain requires WIND_BASE to be exported, should the user be -# compiling for VxWorks and not have WIND_BASE exported, to that here before -# invoking the compiler. -if [ -z "${WIND_BASE}" ] && [ -n "@WIND_BASE@" ]; then - WIND_BASE="@WIND_BASE@" - export WIND_BASE -fi - -if [ -n "@WIND_LMAPI@" ]; then - if [ -z "${LD_LIBRARY_PATH}" ]; then - LD_LIBRARY_PATH="@WIND_LMAPI@" - export LD_LIBRARY_PATH - elif [[ "${LD_LIBRARY_PATH}" == ?(*:)"@WIND_LMAPI@"?(:*) ]]; then - LD_LIBRARY_PATH="@WIND_LMAPI@:${LD_LIBRARY_PATH}" - export LD_LIBRARY_PATH - fi -fi - -# Strip C compiler from command line arguments for compatibility because this -# launcher may also be used from an integrated development environment at some -# point. -if [ "$1" = "@CMAKE_C_COMPILER@" ]; then - shift -fi - -exec "@CMAKE_C_COMPILER@" "$@" - diff --git a/src/cmake/launch-cxx.bat.in b/src/cmake/launch-cxx.bat.in deleted file mode 100644 index 5d38b3d..0000000 --- a/src/cmake/launch-cxx.bat.in +++ /dev/null @@ -1,26 +0,0 @@ -@echo off -REM Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -REM -REM This program and the accompanying materials are made available under the -REM terms of the Eclipse Public License v. 2.0 which is available at -REM http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -REM v. 1.0 which is available at -REM http://www.eclipse.org/org/documents/edl-v10.php. -REM -REM SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause - -REM VxWorks toolchain requires WIND_BASE to be exported, should the user be -REM compiling for VxWorks and not have WIND_BASE exported, do that here before -REM invoking the compiler. -if "%WIND_BASE%" == "" ( - set WIND_BASE="@WIND_BASE@" -) - -REM Strip C compiler from command line arguments for compatibility because -REM this launcher may also be used from an integrated development environment -REM at some point. -if "%1" == "@CMAKE_CXX_COMPILER@" ( - shift -) - -"@CMAKE_CXX_COMPILER@" %* diff --git a/src/cmake/launch-cxx.in b/src/cmake/launch-cxx.in deleted file mode 100644 index 0d3bd19..0000000 --- a/src/cmake/launch-cxx.in +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# VxWorks toolchain requires WIND_BASE to be exported, should the user be -# compiling for VxWorks and not have WIND_BASE exported, to that here before -# invoking the compiler. -if [ -z "${WIND_BASE}" ] && [ -n "@WIND_BASE@" ]; then - WIND_BASE="@WIND_BASE@" - export WIND_BASE -fi - -if [ -n "@WIND_LMAPI@" ]; then - if [ -z "${LD_LIBRARY_PATH}" ]; then - LD_LIBRARY_PATH="@WIND_LMAPI@" - export LD_LIBRARY_PATH - elif [[ "${LD_LIBRARY_PATH}" == ?(*:)"@WIND_LMAPI@"?(:*) ]]; then - LD_LIBRARY_PATH="@WIND_LMAPI@:${LD_LIBRARY_PATH}" - export LD_LIBRARY_PATH - fi -fi - -# Strip C compiler from command line arguments for compatibility because this -# launcher may also be used from an integrated development environment at some -# point. -if [ "$1" = "@CMAKE_CXX_COMPILER@" ]; then - shift -fi - -exec "@CMAKE_CXX_COMPILER@" "$@" - diff --git a/src/cmake/modules/Coverage.cmake b/src/cmake/modules/Coverage.cmake deleted file mode 100644 index 5e6fc6d..0000000 --- a/src/cmake/modules/Coverage.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# -if("${CMAKE_BUILD_TYPE}" STREQUAL "Coverage") - set(BUILD_TYPE_SUPPORTED False) - mark_as_advanced(BUILD_TYPE_SUPPORTED) - if(CMAKE_COMPILER_IS_GNUCXX) - set(BUILD_TYPE_SUPPORTED True) - elseif(("${CMAKE_C_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") AND - ("${CMAKE_C_COMPILER_VERSION}" VERSION_GREATER "3.0.0")) - set(BUILD_TYPE_SUPPORTED True) - endif() - - if(NOT BUILD_TYPE_SUPPORTED) - message(FATAL_ERROR "Coverage build type not supported. (GCC or Clang " - ">3.0.0 required)") - endif() - - # NOTE: Since either GCC or Clang is required for now, and the coverage - # flags are the same for both, there is no need for seperate branches - # to set compiler flags. That might change in the future. - - # CMake has per build type compiler and linker flags. If 'Coverage' is - # chosen, the flags below are automatically inserted into CMAKE_C_FLAGS. - # - # Any optimizations are disabled to ensure coverage results are correct. - # See https://gcc.gnu.org/onlinedocs/gcc/Gcov-and-Optimization.html. - set(CMAKE_C_FLAGS_COVERAGE - "-DNDEBUG -g -O0 --coverage -fprofile-arcs -ftest-coverage") - set(CMAKE_CXX_FLAGS_COVERAGE - "-DNDEBUG -g -O0 --coverage -fprofile-arcs -ftest-coverage") - mark_as_advanced( - CMAKE_C_FLAGS_COVERAGE - CMAKE_CXX_FLAGS_COVERAGE - CMAKE_EXE_LINKER_FLAGS_COVERAGE - CMAKE_SHARED_LINKER_FLAGS_COVERAGE) - - configure_file(${CMAKE_MODULE_PATH}/../CoverageSettings.cmake.in CoverageSettings.cmake @ONLY) - - message(STATUS "Coverage build type available") -endif() - diff --git a/src/cmake/modules/Packaging/banner.bmp b/src/cmake/modules/Packaging/banner.bmp deleted file mode 100644 index e795038..0000000 Binary files a/src/cmake/modules/Packaging/banner.bmp and /dev/null differ diff --git a/src/cmake/modules/Packaging/dialog.png b/src/cmake/modules/Packaging/dialog.png deleted file mode 100644 index fd8e3ae..0000000 Binary files a/src/cmake/modules/Packaging/dialog.png and /dev/null differ diff --git a/src/cmake/modules/Packaging/examples.xml b/src/cmake/modules/Packaging/examples.xml deleted file mode 100644 index 4ca2dc8..0000000 --- a/src/cmake/modules/Packaging/examples.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed - - - - - - - - - - - - - - - - - - - diff --git a/src/cmake/modules/Packaging/vortex.ico b/src/cmake/modules/Packaging/vortex.ico deleted file mode 100644 index 65d2a45..0000000 Binary files a/src/cmake/modules/Packaging/vortex.ico and /dev/null differ diff --git a/src/cmake/modules/Platform/VxWorks6.cmake b/src/cmake/modules/Platform/VxWorks6.cmake deleted file mode 100644 index 85de58c..0000000 --- a/src/cmake/modules/Platform/VxWorks6.cmake +++ /dev/null @@ -1,213 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# -# CMake Platform file for VxWorks -# -# This file will be used as platform file if CMAKE_SYSTEM_NAME is defined -# as VxWorks in the toolchain file. -# -# Most information is resolved by analyzing the absolute location of the -# compiler on the file system, but can be overridden if required. -# -# Setting CMAKE_SYSTEM_PROCESSOR is mandatory. The variable should be set to -# e.g. ARMARCH* if the target architecture is arm. -# -# NOTES: -# * For now support for VxWorks Diab compiler will NOT be implemented. -# * If certain settings are not explicitly defined, this platform file will -# try to deduce it from the installation path. It will, however, not go out -# of it's way to validate and cross-reference settings. -# -# https://cmake.org/Wiki/CMake_Cross_Compiling -# - -if((NOT "${CMAKE_GENERATOR}" MATCHES "Makefiles") AND - (NOT "${CMAKE_GENERATOR}" MATCHES "Ninja")) - message(FATAL_ERROR "Cross compilation for VxWorks is not supported for " - "${CMAKE_GENERATOR}") -endif() - -set(WIND_PROCESSOR_TYPE_PATTERN ".*(cc|c\\+\\+)(arm|mips|pentium|ppc).*") -set(WIND_HOST_TYPE_PATTERN "^x86-(linux2|win32)$") -set(WIND_PLATFORM_PATTERN "^[0-9\.]+-vxworks-([0-9\.]+)$") - -# Try to deduce the system architecture from either CMAKE_C_COMPILER or -# CMAKE_CXX_COMPILER (one of which must be specified). -# -# Path examples: -# /gnu/4.3.3-vxworks-6.9/x86-linux2/bin -# /gnu/4.1.2-vxworks-6.8/x86-win32/bin -foreach(COMPILER CMAKE_C_COMPILER CMAKE_CXX_COMPILER) - if("${${COMPILER}}" MATCHES "${WIND_PROCESSOR_TYPE_PATTERN}") - string( - REGEX REPLACE - "${WIND_PROCESSOR_TYPE_PATTERN}" "\\2" - PROCESSOR_TYPE - ${${COMPILER}}) - if(NOT WIND_PROCESSOR_TYPE) - set(WIND_PROCESSOR_TYPE ${PROCESSOR_TYPE}) - endif() - - get_filename_component(COMPILER_NAME "${${COMPILER}}" NAME) - if((NOT "${COMPILER_NAME}" STREQUAL "${${COMPILER}}") AND - (NOT "${COMPILER_DIRECTORY}")) - get_filename_component( - COMPILER_PATH "${${COMPILER}}" REALPATH) - get_filename_component( - COMPILER_DIRECTORY "${COMPILER_PATH}" DIRECTORY) - endif() - else() - message(FATAL_ERROR "${COMPILER} did not conform to the expected " - "executable format. i.e. it did not end with " - "arm, mips, pentium, or ppc.") - endif() -endforeach() - - -get_filename_component(C_COMPILER_NAME "${CMAKE_C_COMPILER}" NAME) -get_filename_component(CXX_COMPILER_NAME "${CMAKE_CXX_COMPILER}" NAME) - -# Ideally the location of the compiler should be resolved at this, but invoke -# find_program as a last resort. -if(NOT COMPILER_DIRECTORY) - find_program( - COMPILER_PATH NAMES "${C_COMPILER_NAME}" "${CXX_COMPILER_NAME}") - if(COMPILER_PATH) - get_filename_component( - COMPILER_DIRECTORY "${COMPILER_PATH}" COMPILER_PATH) - else() - # The compiler must be successfully be detected by now. - message(FATAL_ERROR "Could not determine location of compiler path.") - endif() -endif() - - -get_filename_component(basename "${COMPILER_DIRECTORY}" NAME) -get_filename_component(basedir "${COMPILER_DIRECTORY}" DIRECTORY) -while(basename) - if("${basename}" MATCHES "${WIND_PLATFORM_PATTERN}") - string( - REGEX REPLACE "${WIND_PLATFORM_PATTERN}" "\\1" version ${basename}) - if(NOT CMAKE_SYSTEM_VERSION) - set(CMAKE_SYSTEM_VERSION ${version}) - endif() - - # The current base directory may be the WindRiver directory depending - # on wether a "gnu" directory exists or not, but that is evaluated in - # the next iteration. - set(WIND_HOME "${basedir}") - set(WIND_PLATFORM "${basename}") - elseif(CMAKE_SYSTEM_VERSION AND WIND_HOME AND WIND_HOST_TYPE) - # The "gnu" directory may not be part of the path. If it is, strip it. - if("${basename}" STREQUAL "gnu") - set(WIND_HOME "${basedir}") - endif() - break() - elseif("${basename}" MATCHES "${WIND_HOST_TYPE_PATTERN}") - set(WIND_HOST_TYPE "${basename}") - endif() - - get_filename_component(basename ${basedir} NAME) - get_filename_component(basedir ${basedir} DIRECTORY) -endwhile() - - -# VxWorks commands require the WIND_BASE environment variable, so this script -# will support it too. If the environment variable is not set, the necessary -# path information is deduced from the compiler path. -if(NOT WIND_BASE) - set(WIND_BASE $ENV{WIND_BASE}) -endif() - -if(NOT WIND_BASE) - set(WIND_BASE "${WIND_HOME}/vxworks-${CMAKE_SYSTEM_VERSION}") -endif() - -# Verify the location WIND_BASE references actually exists. -if(NOT EXISTS ${WIND_BASE}) - message(FATAL_ERROR "VxWorks base directory ${WIND_BASE} does not exist, " - "please ensure the toolchain information is correct.") -elseif(NOT ENV{WIND_BASE}) - # WIND_BASE environment variable must be exported during generation - # otherwise compiler tests will fail. - set(ENV{WIND_BASE} "${WIND_BASE}") -endif() - - -if(NOT CMAKE_C_COMPILER_VERSION) - execute_process( - COMMAND "${CMAKE_C_COMPILER}" -dumpversion - OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION) - string(STRIP "${CMAKE_C_COMPILER_VERSION}" CMAKE_C_COMPILER_VERSION) - message(STATUS "VxWorks C compiler version ${CMAKE_C_COMPILER_VERSION}") -endif() - -if(NOT CMAKE_CXX_COMPILER_VERSION) - execute_process( - COMMAND "${CMAKE_CXX_COMPILER}" -dumpversion - OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION) - string(STRIP "${CMAKE_CXX_COMPILER_VERSION}" CMAKE_CXX_COMPILER_VERSION) - message(STATUS "VxWorks CXX compiler version ${CMAKE_C_COMPILER_VERSION}") -endif() - -set(CMAKE_C_COMPILER_ID GNU) -set(CMAKE_CXX_COMPILER_ID GNU) - - -# CMAKE_SOURCE_DIR does not resolve to the actual source directory because -# platform files are processed to early on in the process. -set(ROOT "${CMAKE_MODULE_PATH}/../") - -if(WIN32) - set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-c.bat") - set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-cxx.bat") - configure_file( - "${ROOT}/launch-c.bat.in" "${CMAKE_C_COMPILER_LAUNCHER}" @ONLY) - configure_file( - "${ROOT}/launch-cxx.bat.in" "${CMAKE_CXX_COMPILER_LAUNCHER}" @ONLY) -else() - # Check if a directory like lmapi-* exists (VxWorks 6.9) and append it to - # LD_LIBRARY_PATH. - file(GLOB WIND_LMAPI LIST_DIRECTORIES true "${WIND_HOME}/lmapi-*") - if(WIND_LMAPI) - set(WIND_LMAPI "${WIND_LMAPI}/${WIND_HOST_TYPE}/lib") - endif() - - set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-c") - set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_BINARY_DIR}/launch-cxx") - configure_file( - "${ROOT}/launch-c.in" "${CMAKE_C_COMPILER_LAUNCHER}" @ONLY) - configure_file( - "${ROOT}/launch-cxx.in" "${CMAKE_CXX_COMPILER_LAUNCHER}" @ONLY) - execute_process(COMMAND chmod a+rx "${CMAKE_C_COMPILER_LAUNCHER}") - execute_process(COMMAND chmod a+rx "${CMAKE_CXX_COMPILER_LAUNCHER}") -endif() - - -set(WIND_INCLUDE_DIRECTORY "${WIND_BASE}/target/h") - -# Versions before 6.8 have a different path for common libs. -if("${CMAKE_SYSTEM_VERSION}" VERSION_GREATER "6.8") - set(WIND_LIBRARY_DIRECTORY "${WIND_BASE}/target/lib/usr/lib/${WIND_PROCESSOR_TYPE}/${CMAKE_SYSTEM_PROCESSOR}/common") -else() - set(WIND_LIBRARY_DIRECTORY "${WIND_BASE}/target/usr/lib/${WIND_PROCESSOR_TYPE}/${CMAKE_SYSTEM_PROCESSOR}/common") -endif() - -if(NOT EXISTS "${WIND_LIBRARY_DIRECTORY}") - message(FATAL_ERROR "${CMAKE_SYSTEM_PROCESSOR} is not part of the " - "${WIND_PROCESSOR_TYPE} processor family.") -endif() - -include_directories(BEFORE SYSTEM "${WIND_INCLUDE_DIRECTORY}") -link_directories("${WIND_LIBRARY_DIRECTORY}") - diff --git a/src/cmake/scripts/CoverageConvenience.cmake b/src/cmake/scripts/CoverageConvenience.cmake deleted file mode 100644 index 6a952b8..0000000 --- a/src/cmake/scripts/CoverageConvenience.cmake +++ /dev/null @@ -1,134 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# -# This script will run all tests and generates various coverage reports. -# -# Example usage: -# $ cmake -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoverageConvenience.cmake -# If you start the scripts while in then you don't have to provide the COVERAGE_SETTINGS file. -# -cmake_minimum_required(VERSION 3.5) - -# Get Coverage configuration file -if(NOT COVERAGE_SETTINGS) - set(COVERAGE_SETTINGS ${CMAKE_CURRENT_BINARY_DIR}/CoverageSettings.cmake) -endif() -include(${COVERAGE_SETTINGS}) - -message(STATUS "Config file: ${COVERAGE_SETTINGS}") -message(STATUS "Source directory: ${COVERAGE_SOURCE_DIR}") -message(STATUS "Test directory: ${COVERAGE_RUN_DIR}") -message(STATUS "Output directory: ${COVERAGE_OUTPUT_DIR}") - -set(COVERAGE_SCRIPTS_DIR "${COVERAGE_SOURCE_DIR}/cmake/scripts") - -############################################################################### -# -# Detect generators -# -############################################################################### -set(GENERATE_COVERAGE TRUE) -if(GENERATE_COVERAGE) - find_program(GCOV_PATH gcov PARENT_SCOPE) - if(NOT GCOV_PATH) - set(GENERATE_COVERAGE FALSE) - message(STATUS "[SKIP] Coverage generators - gcov (could not find gcov)") - endif() -endif() -if(GENERATE_COVERAGE) - message(STATUS "[ OK ] Coverage generators - gcov") -endif() - -set(GENERATE_COVERAGE_HTML TRUE) -if(GENERATE_COVERAGE_HTML) - find_program(LCOV_PATH lcov PARENT_SCOPE) - if(NOT LCOV_PATH) - set(GENERATE_COVERAGE_HTML FALSE) - message(STATUS "[SKIP] Coverage generators - HTML (could not find lcov)") - endif() -endif() -if(GENERATE_COVERAGE_HTML) - find_program(GENHTML_PATH genhtml PARENT_SCOPE) - if(NOT GENHTML_PATH) - set(GENERATE_COVERAGE_HTML FALSE) - message(STATUS "[SKIP] Coverage generators - HTML (could not find genhtml)") - endif() -endif() -if(GENERATE_COVERAGE_HTML) - message(STATUS "[ OK ] Coverage generators - HTML (lcov and genhtml)") -endif() - -set(GENERATE_COVERAGE_COBERTURA TRUE) -if(GENERATE_COVERAGE_COBERTURA) - find_program(GCOVR_PATH gcovr PARENT_SCOPE) - if(NOT GCOVR_PATH) - set(GENERATE_COVERAGE_COBERTURA FALSE) - message(STATUS "[SKIP] Coverage generators - Cobertura (could not find gcovr)") - endif() -endif() -if(GENERATE_COVERAGE_COBERTURA) - message(STATUS "[ OK ] Coverage generators - Cobertura (gcovr)") -endif() - -if(NOT GENERATE_COVERAGE) - message(FATAL_ERROR "Could not find the main coverage generator 'gcov'") -elseif(NOT GENERATE_COVERAGE_HTML AND NOT GENERATE_COVERAGE_COBERTURA) - message(FATAL_ERROR "Could not find either of the two coverage report generators") -endif() - - - -############################################################################### -# -# Setup environment -# -############################################################################### -message(STATUS "Setup environment") -if(GENERATE_COVERAGE_HTML) - execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePreHtml.cmake - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -endif() -if(GENERATE_COVERAGE_COBERTURA) - execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePreCobertura.cmake - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -endif() - - - -############################################################################### -# -# Generate coverage results by running all the tests -# -############################################################################### -message(STATUS "Run all test to get coverage") -execute_process(COMMAND ctest ${COVERAGE_QUIET_FLAG} -T test - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -execute_process(COMMAND ctest ${COVERAGE_QUIET_FLAG} -T coverage - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) - - - -############################################################################### -# -# Generate coverage reports -# -############################################################################### -if(GENERATE_COVERAGE_HTML) - execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePostHtml.cmake - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -endif() -if(GENERATE_COVERAGE_COBERTURA) - execute_process(COMMAND ${CMAKE_COMMAND} -DCOVERAGE_SETTINGS=${COVERAGE_SETTINGS} -P ${COVERAGE_SCRIPTS_DIR}/CoveragePostCobertura.cmake - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -endif() - diff --git a/src/cmake/scripts/CoveragePostCobertura.cmake b/src/cmake/scripts/CoveragePostCobertura.cmake deleted file mode 100644 index c28a1c8..0000000 --- a/src/cmake/scripts/CoveragePostCobertura.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# -# This script assumes that all test have been run and gcov results are available. -# It will generate the Cobertura output from the gcov results. -# -# Example usage: -# $ cmake -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePreCobertura.cmake -# $ ctest -T test -# $ ctest -T coverage -# $ ctest -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePostCobertura.cmake -# If you start the scripts while in then you don't have to provide the COVERAGE_SETTINGS file. -# -cmake_minimum_required(VERSION 3.5) - -# Get Coverage configuration file -if(NOT COVERAGE_SETTINGS) - set(COVERAGE_SETTINGS ${CMAKE_CURRENT_BINARY_DIR}/CoverageSettings.cmake) -endif() -include(${COVERAGE_SETTINGS}) - -# Some debug -#message(STATUS "Config file: ${COVERAGE_SETTINGS}") -#message(STATUS "Source directory: ${COVERAGE_SOURCE_DIR}") -#message(STATUS "Test directory: ${COVERAGE_RUN_DIR}") -#message(STATUS "Output directory: ${COVERAGE_OUTPUT_DIR}") - -# Find gcovr to generate Cobertura results -find_program(GCOVR_PATH gcovr PARENT_SCOPE) -if(NOT GCOVR_PATH) - message(FATAL_ERROR "Could not find gcovr to generate Cobertura coverage.") -endif() - -# Create location to put the result file. -file(MAKE_DIRECTORY ${COVERAGE_OUTPUT_DIR}) - -execute_process(COMMAND ${GCOVR_PATH} -x -r ${COVERAGE_SOURCE_DIR} -e ".*/${COVERAGE_EXCLUDE_TESTS}/.*" -e ".*/${COVERAGE_EXCLUDE_EXAMPLES}/.*" -e ".*/${COVERAGE_EXCLUDE_BUILD_SUPPORT}/.*" -o ${COVERAGE_OUTPUT_DIR}/cobertura.xml - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) - - -message(STATUS "The Cobertura report can be found here: ${COVERAGE_OUTPUT_DIR}/cobertura.xml") - diff --git a/src/cmake/scripts/CoveragePostHtml.cmake b/src/cmake/scripts/CoveragePostHtml.cmake deleted file mode 100644 index f8a5739..0000000 --- a/src/cmake/scripts/CoveragePostHtml.cmake +++ /dev/null @@ -1,71 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# -# This script assumes that all test have been run and gcov results are available. -# It will generate the HTML output from the gcov results. -# -# Example usage: -# $ cmake -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePreHtml.cmake -# $ ctest -T test -# $ ctest -T coverage -# $ ctest -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePostHtml.cmake -# If you start the scripts while in then you don't have to provide the COVERAGE_SETTINGS file. -# -cmake_minimum_required(VERSION 3.5) - -# Get Coverage configuration file -if(NOT COVERAGE_SETTINGS) - set(COVERAGE_SETTINGS ${CMAKE_CURRENT_BINARY_DIR}/CoverageSettings.cmake) -endif() -include(${COVERAGE_SETTINGS}) - -# Some debug -#message(STATUS "Config file: ${COVERAGE_SETTINGS}") -#message(STATUS "Source directory: ${COVERAGE_SOURCE_DIR}") -#message(STATUS "Test directory: ${COVERAGE_RUN_DIR}") -#message(STATUS "Output directory: ${COVERAGE_OUTPUT_DIR}") - -# Find tools to generate HTML coverage results -find_program(LCOV_PATH lcov PARENT_SCOPE) -if(NOT LCOV_PATH) - message(FATAL_ERROR "Could not find lcov to generate HTML coverage.") -endif() -find_program(GENHTML_PATH genhtml PARENT_SCOPE) -if(NOT GENHTML_PATH) - message(FATAL_ERROR "Could not find genhtml to generate HTML coverage.") -endif() - -# Create location to put the result file. -file(MAKE_DIRECTORY ${COVERAGE_OUTPUT_DIR}) -set(COVERAGE_HTML_OUTPUT "${COVERAGE_OUTPUT_DIR}/html") -file(MAKE_DIRECTORY ${COVERAGE_HTML_OUTPUT}) - -# Setup tmp analysis files -set(COVERAGE_INFO "${COVERAGE_HTML_OUTPUT}/coverage_html.info") -set(COVERAGE_CLEANED "${COVERAGE_INFO}.cleaned") - -# Execute lcov and genhtml commands to get HTML results -execute_process(COMMAND ${LCOV_PATH} ${COVERAGE_QUIET_FLAG} --directory . --capture --output-file ${COVERAGE_INFO} - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -execute_process(COMMAND ${LCOV_PATH} ${COVERAGE_QUIET_FLAG} --remove ${COVERAGE_INFO} "${COVERAGE_EXCLUDE_TESTS}/*" "${COVERAGE_EXCLUDE_EXAMPLES}/*" "${COVERAGE_EXCLUDE_BUILD_SUPPORT}/*" "/usr/*" --output-file ${COVERAGE_CLEANED} - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) -execute_process(COMMAND ${GENHTML_PATH} ${COVERAGE_QUIET_FLAG} -o ${COVERAGE_HTML_OUTPUT} ${COVERAGE_CLEANED} - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) - -# Remove tmp analysis files -execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${COVERAGE_INFO} ${COVERAGE_CLEANED} - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) - - -message(STATUS "The HTML coverage report can be found here: ${COVERAGE_HTML_OUTPUT}/index.html") - diff --git a/src/cmake/scripts/CoveragePreCobertura.cmake b/src/cmake/scripts/CoveragePreCobertura.cmake deleted file mode 100644 index f774d3d..0000000 --- a/src/cmake/scripts/CoveragePreCobertura.cmake +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# -# This script assumes that it is called before all tests are run and gcov results are available. -# It can be used to setup the environment needed to get proper Cobertura coverage results. -# -# Example usage: -# $ cmake -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePreCobertura.cmake -# $ ctest -T test -# $ ctest -T coverage -# $ ctest -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePostCobertura.cmake -# If you start the scripts while in then you don't have to provide the COVERAGE_SETTINGS file. -# -cmake_minimum_required(VERSION 3.5) - -# -# Nothing to do really. -# This is just added to provide consistency between Coverage scripts. -# - diff --git a/src/cmake/scripts/CoveragePreHtml.cmake b/src/cmake/scripts/CoveragePreHtml.cmake deleted file mode 100644 index a6deaa7..0000000 --- a/src/cmake/scripts/CoveragePreHtml.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -# -# This script assumes that it is called before all tests are run and gcov results are available. -# It can be used to setup the environment needed to get proper HTML coverage results. -# -# Example usage: -# $ cmake -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePreHtml.cmake -# $ ctest -T test -# $ ctest -T coverage -# $ ctest -DCOVERAGE_SETTINGS=/CoverageSettings.cmake -P /cmake/scripts/CoveragePostHtml.cmake -# If you start the scripts while in then you don't have to provide the COVERAGE_SETTINGS file. -# -cmake_minimum_required(VERSION 3.5) - -# Get Coverage configuration file -if(NOT COVERAGE_SETTINGS) - set(COVERAGE_SETTINGS ${CMAKE_CURRENT_BINARY_DIR}/CoverageSettings.cmake) -endif() -include(${COVERAGE_SETTINGS}) - -# Some debug -#message(STATUS "Config file: ${COVERAGE_SETTINGS}") -#message(STATUS "Source directory: ${COVERAGE_SOURCE_DIR}") -#message(STATUS "Test directory: ${COVERAGE_RUN_DIR}") -#message(STATUS "Output directory: ${COVERAGE_OUTPUT_DIR}") - -# Find tools to generate HTML coverage results -find_program(LCOV_PATH lcov PARENT_SCOPE) -if(NOT LCOV_PATH) - message(FATAL_ERROR "Could not find lcov to generate HTML coverage.") -endif() -find_program(GENHTML_PATH genhtml PARENT_SCOPE) -if(NOT GENHTML_PATH) - message(FATAL_ERROR "Could not find genhtml to generate HTML coverage.") -endif() - -# Reset LCOV environment -execute_process(COMMAND ${LCOV_PATH} ${COVERAGE_QUIET_FLAG} --directory . --zerocounters - WORKING_DIRECTORY ${COVERAGE_RUN_DIR}) - - diff --git a/src/cmake/vxworks.example.cmake b/src/cmake/vxworks.example.cmake deleted file mode 100644 index 9af56e8..0000000 --- a/src/cmake/vxworks.example.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# -set(CMAKE_SYSTEM_NAME VxWorks) -set(CMAKE_SYSTEM_PROCESSOR PENTIUM4) - -set(WIND_HOME "/path/to/WindRiver") -set(WIND_PROCESSOR_TYPE "pentium") - -# Binaries are named e.g. ccpentium or ccarm -set(CMAKE_C_COMPILER ${WIND_HOME}/gnu/4.3.3-vxworks-6.9/x86-linux2/bin/cc${WIND_PROCESSOR_TYPE}) -set(CMAKE_CXX_COMPILER ${WIND_HOME}/gnu/4.3.3-vxworks-6.9/x86-linux2/bin/c++${WIND_PROCESSOR_TYPE}) -set(CMAKE_AR ${WIND_HOME}/gnu/4.3.3-vxworks-6.9/x86-linux2/bin/ar${WIND_PROCESSOR_TYPE}) - -set(WIND_PROGRAM_PATH ${WIND_HOME}/vxworks-6.9/host/x86-linux2/bin;${WIND_BASE}/gnu/4.3.3-vxworks-6.9/x86-linux2/bin) -set(WIND_LIBRARY_PATH ${WIND_HOME}/target/lib/${WIND_PROCESSOR_TYPE}/${CMAKE_SYSTEM_PROCESSOR}/common) -set(WIND_INCLUDE_PATH ${WIND_HOME}/vxworks-6.9/target/h) - -set(CMAKE_FIND_ROOT_PATH ${WIND_PROGRAM_PATH};${WIND_LIBRARY_PATH};${WIND_INCLUDE_PATH}) - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) - diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f08808e..507aa9c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -27,8 +27,19 @@ endif() add_definitions(-DDDSI_INCLUDE_NETWORK_PARTITIONS -DDDSI_INCLUDE_SSM) -option(DDSC_ENABLE_OPENSSL "Enable openssl support" ON) -if(DDSC_ENABLE_OPENSSL) +# OpenSSL is huge, raising the RSS by 1MB or so, and moreover find_package(OpenSSL) causes +# trouble on some older CMake versions that otherwise work fine, so provide an option to avoid +# all OpenSSL related things. +# +# Historically the option was DDSC_ENABLE_OPENSSL so make some allowance for those who are +# currently relying on it. +option(ENABLE_SSL "Enable openssl support" ON) +option(DDSC_ENABLE_OPENSSL "Deprecated: please use ENABLE_SSL instead" ON) +if(NOT DDSC_ENABLE_OPENSSL) + message(ERROR "DDSC_ENABLE_OPENSSL is deprecated, please use ENABLE_SSL instead") + set(ENABLE_SSL OFF) +endif() +if(ENABLE_SSL) find_package(OpenSSL) if(OPENSSL_FOUND) add_definitions(-DDDSI_INCLUDE_SSL) @@ -36,8 +47,9 @@ if(DDSC_ENABLE_OPENSSL) if(CMAKE_GENERATOR MATCHES "Visual Studio") set_target_properties(ddsc PROPERTIES LINK_FLAGS "/ignore:4099") endif() + message(STATUS "Building with OpenSSL support") else() - message(FATAL_ERROR "To build without openssl support, set DDSC_ENABLE_OPENSSL to OFF") + message(STATUS "Building without OpenSSL support") endif() endif() @@ -68,4 +80,6 @@ install( ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib ) -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/xtests") +if(BUILD_IDLC) + add_subdirectory(xtests) +endif() diff --git a/src/core/xtests/cdrtest/CMakeLists.txt b/src/core/xtests/cdrtest/CMakeLists.txt index 9566927..1535a9c 100644 --- a/src/core/xtests/cdrtest/CMakeLists.txt +++ b/src/core/xtests/cdrtest/CMakeLists.txt @@ -11,16 +11,10 @@ # cmake_minimum_required(VERSION 3.5) -if (NOT TARGET CycloneDDS::ddsc) - # Find the CycloneDDS package. If it is not in a default location, try - # finding it relative to the example where it most likely resides. - find_package(CycloneDDS REQUIRED PATHS ../../) -endif() - -add_compile_options("-I${PROJECT_SOURCE_DIR}/ddsrt/include") -add_compile_options("-I${PROJECT_SOURCE_DIR}/core/ddsc/include") -add_compile_options("-I${PROJECT_SOURCE_DIR}/core/ddsc/src") -add_compile_options("-I${PROJECT_SOURCE_DIR}/core/ddsi/include") +add_compile_options("-I${PROJECT_SOURCE_DIR}/src/ddsrt/include") +add_compile_options("-I${PROJECT_SOURCE_DIR}/src/core/ddsc/include") +add_compile_options("-I${PROJECT_SOURCE_DIR}/src/core/ddsc/src") +add_compile_options("-I${PROJECT_SOURCE_DIR}/src/core/ddsi/include") add_compile_options("-I$ENV{OSPL_HOME}/src/abstraction/os/include") add_compile_options("-I$ENV{OSPL_HOME}/src/database/database/include") diff --git a/src/docs/CMakeLists.txt b/src/docs/CMakeLists.txt deleted file mode 100644 index 6b95a4d..0000000 --- a/src/docs/CMakeLists.txt +++ /dev/null @@ -1,218 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause - -# TODO depending on requirements we can add/remove options as needed, -# these are examples of generators we'll need as a minimum. -# Perhaps we should also consider options for building subset of all docs. -# When a certain doc is related to a target, no option is needed; you can simply check if the target exists -# (i.e. if a target 'ddsc' exists, build ddsc api docs). And possibly make the target definition dependent on an option. - -option(BUILD_DOCS "Build documentation." OFF) -option(DOWNLOAD_DOCS "Download documentation." OFF) - -# When BUILD_DOCS is set, missing deps are treated as fatal errors -if (BUILD_DOCS) - set(mode FATAL_ERROR) -else() - set(mode STATUS) -endif() - -find_program(SPHINX_EXECUTABLE NAMES sphinx-build DOC "Sphinx documentation builder") -if (NOT SPHINX_EXECUTABLE) - message(${mode} "${CMAKE_PROJECT_NAME} documentation: unable to find sphinx-build executable") -endif() - -find_package(Doxygen) -if (NOT Doxygen_FOUND) - message(${mode} "${CMAKE_PROJECT_NAME} documentation: unable to find Doxygen") -endif() - -# Creating pdf from latex requires latexmk (which depends on perl, latexpdf et. al) -find_program(LATEXMK_EXECUTABLE NAMES latexmk DOC "LateX PDF Generator") -if (NOT LATEXMK_EXECUTABLE) - message(${mode} "${CMAKE_PROJECT_NAME} documentation: unable to find latexmk") -endif() - -if ((NOT DOWNLOAD_DOCS) AND SPHINX_EXECUTABLE AND Doxygen_FOUND AND LATEXMK_EXECUTABLE) - # User requested docs (USE_DOCS=1) and did not explicitely request to download docs (DOWNLOAD_DOCS=0) - # All prerequisites are available to build docs, so force BUILD_DOCS even when the user did not enable it explicitely - set(BUILD_DOCS ON PARENT_SCOPE) # for examples' docs - set(BUILD_DOCS ON) - message(STATUS "${CMAKE_PROJECT_NAME} documentation: Success (build)") -else() - # User requested docs (USE_DOCS=1) and prefers to download instead of build (or prerequisites are not available). - # So force DOWNLOAD_DOCS even when user did not enable it explicitely - set(DOWNLOAD_DOCS ON PARENT_SCOPE) # for examples' docs - set(DOWNLOAD_DOCS ON) - message(STATUS "${CMAKE_PROJECT_NAME} documentation: Success (download)") -endif() - -#set(DOCS_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") - -if (DOWNLOAD_DOCS) - set(JENKINS_BASE_URI "http://jenkins.prismtech.com:8080/") - set(JENKINS_DOCS_JOB_NAME "BuildChameleonLinux64bit") - set(PROJECT_PDF_URI "${JENKINS_BASE_URI}/job/${JENKINS_DOCS_JOB_NAME}/lastSuccessfulBuild/artifact/cham/builds/docs/${CMAKE_PROJECT_NAME}.pdf") - set(PROJECT_HTML_URI "${JENKINS_BASE_URI}/job/${JENKINS_DOCS_JOB_NAME}/lastSuccessfulBuild/artifact/cham/builds/docs/${CMAKE_PROJECT_NAME}HTML.tar.gz") - - add_custom_target(docs ALL) - find_program(WGET_EXECUTABLE NAMES wget DOC "wget") - if (WGET_EXECUTABLE) - # prevent wget to create numbered downloads. - add_custom_command(TARGET docs - COMMAND ${CMAKE_COMMAND} - -E remove -f "${CMAKE_PROJECT_NAME}HTML.tar.gz" - VERBATIM) - - add_custom_command(TARGET docs - COMMAND ${WGET_EXECUTABLE} - -q ${PROJECT_HTML_URI} ${PROJECT_PDF_URI} - COMMENT "Downloading documentation from target." - VERBATIM) - - # To make downloading and packaging easier. -# add_custom_command(TARGET docs -# COMMAND ${CMAKE_COMMAND} -# -E rename ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pdf ${DOCS_OUTPUT_DIR}/${CMAKE_PROJECT_NAME}.pdf -# VERBATIM) - else() - message(STATUS "Unable to find wget. Download docs now.") - # Just try to download the docs straight away. - file(DOWNLOAD ${PROJECT_HTML_URI} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}HTML.tar.gz) - file(DOWNLOAD ${PROJECT_PDF_URI} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pdf) - endif() - - add_custom_command(TARGET docs - COMMAND ${CMAKE_COMMAND} - -E tar "zxf" "${CMAKE_PROJECT_NAME}HTML.tar.gz" . - VERBATIM) - - # Remove downloaded files when cleaning the build tree - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES - html - ${CMAKE_PROJECT_NAME}HTML.tar.gz - ${CMAKE_PROJECT_NAME}.pdf) - -elseif(BUILD_DOCS) - # Generate ddsc API docs in XML format using Doxygen, if the ddsc target is defined. - # The XML will serve as input for sphinx' breathe plugin - if (TARGET ${CMAKE_PROJECT_NAME}::ddsc) - # Process doxygen configuration file, for ddsc - set(doxy_conf_project "${CMAKE_PROJECT_NAME_FULL} C API Documentation") - set(doxy_conf_outputdir "ddsc_api") - set(doxy_conf_input "${PROJECT_SOURCE_DIR}/core/ddsc/include/dds/dds.h ${PROJECT_SOURCE_DIR}/core/ddsc/include/dds") - configure_file(Doxyfile.in Doxyfile @ONLY) - - add_custom_target(ddsc_docs - ${DOXYGEN_EXECUTABLE} Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Running Doxygen for API docs generation" - VERBATIM - ) - - # Remove generated files when cleaning the build tree - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${doxy_conf_outputdir}) - - # Add ddsc api docs to sphinx' breathe projects - set(sph_conf_breathe_projs "\"ddsc_api\": \"${doxy_conf_outputdir}/xml\"") - - add_custom_command(TARGET ddsc_docs - POST_BUILD - WORKING_DIRECTORY "${doxy_conf_outputdir}" - COMMAND ${CMAKE_COMMAND} -E tar "zcf" "${CMAKE_PROJECT_NAME}_C_HTML.tar.gz" "ddsc") - endif() - - # Process sphinx configuration file - set(sph_conf_author "Eclipse Cyclone DDS project") - set(sph_conf_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") - set(sph_conf_release "${PROJECT_VERSION}") - configure_file(conf.py.in conf.py @ONLY) - - # Define a list of output formats (-b option for sphinx-build) - set(docs_builders "") - list(APPEND docs_builders html) - list(APPEND docs_builders latex) - - # Define custom commands for running sphinx-build for different docs builders - set(docs_outputs "") - foreach(builder ${docs_builders}) - set(docs_builder_output "docs_${builder}_output") - # Log stdout (not stderr) to a file instead of messing up build output - set(docs_builder_log "sphinx-build-${builder}.log") - - add_custom_command(OUTPUT ${docs_builder_output} - COMMAND ${SPHINX_EXECUTABLE} - -b ${builder} - -d ${CMAKE_CURRENT_BINARY_DIR}/cache - -c ${CMAKE_CURRENT_BINARY_DIR} - ${PROJECT_SOURCE_DIR}/docs - ${CMAKE_CURRENT_BINARY_DIR}/${builder} > ${docs_builder_log} - COMMENT "Running Sphinx for ${builder} output" - VERBATIM) - - # FIXME: This is definitely in the wrong location - if(builder STREQUAL html) - add_custom_command(OUTPUT ${docs_builder_output} - COMMAND ${CMAKE_COMMAND} - -E tar "zcf" - "${CMAKE_PROJECT_NAME}HTML.tar.gz" - "html" - APPEND - VERBATIM) - endif() - - # Create a pdf from the latex builder output, by appending a latexmk command - # TODO look into rinohtype as an alternative (don't bother with rst2pdf, it's no good) - if(builder STREQUAL latex) - add_custom_command(OUTPUT ${docs_builder_output} - COMMAND ${LATEXMK_EXECUTABLE} - -interaction=nonstopmode - -silent - -output-directory=${builder} - -pdf -dvi- -ps- -cd- ${builder}/${CMAKE_PROJECT_NAME}.tex - APPEND - VERBATIM) - - # Move the pdf, so that install rules don't need to differentiate between built and downloaded docs - add_custom_command(OUTPUT ${docs_builder_output} - COMMAND ${CMAKE_COMMAND} - -E rename - "latex/${CMAKE_PROJECT_NAME}.pdf" - "${CMAKE_PROJECT_NAME}.pdf" - APPEND - VERBATIM) - endif() - - # OUTPUT is a fake target / symbolic name, not an actual file - set_property(SOURCE ${docs_builder_output} PROPERTY SYMBOLIC 1) - # Remove generated files when cleaning the build tree - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES - ${builder} - ${docs_builder_log}) - - # Include this builder as a dependency of the general 'docs' target - list(APPEND docs_outputs ${docs_builder_output}) - endforeach() - - # Remove generated files when cleaning the build tree - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES - ${CMAKE_PROJECT_NAME}HTML.tar.gz - ${CMAKE_PROJECT_NAME}.pdf) - - add_custom_target(docs ALL DEPENDS ddsc_docs ${docs_outputs}) -endif() - -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html - DESTINATION ${CMAKE_INSTALL_DOCDIR} - COMPONENT dev) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.pdf - DESTINATION ${CMAKE_INSTALL_DOCDIR} - COMPONENT dev) diff --git a/src/etc/CMakeLists.txt b/src/etc/CMakeLists.txt deleted file mode 100644 index 8bba5af..0000000 --- a/src/etc/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# -configure_file("cmake/default.xml.in" "${CMAKE_PROJECT_NAME_SMALL}.xml" @ONLY) - -set(CONFIG_FILES "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME_SMALL}.xml") - -install( - FILES ${CONFIG_FILES} - DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}/${CMAKE_PROJECT_NAME}" - COMPONENT lib -) diff --git a/src/etc/cmake/default.xml.in b/src/etc/cmake/default.xml.in deleted file mode 100644 index 2a4853e..0000000 --- a/src/etc/cmake/default.xml.in +++ /dev/null @@ -1,29 +0,0 @@ - -<@CMAKE_PROJECT_NAME@> - - any - - - - auto - true - true - - - lax - - - warning - - - diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt deleted file mode 100644 index cdefbcc..0000000 --- a/src/examples/CMakeLists.txt +++ /dev/null @@ -1,128 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# -set(CMAKE_INSTALL_EXAMPLESDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/examples") - -add_subdirectory(helloworld) -add_subdirectory(roundtrip) -add_subdirectory(throughput) - -if (USE_DOCS) - # TODO Move to docs CMakeLists - set(EXAMPLES_HTML_ARCHIVE "${CMAKE_PROJECT_NAME}ExamplesHTML.tar.gz") - if (DOWNLOAD_DOCS) - message(STATUS "${CMAKE_PROJECT_NAME} Examples documentation: Success (download)") - set(EXAMPLES_HTML_URI "http://jenkins.prismtech.com:8080/job/BuildChameleonLinux64bit/lastSuccessfulBuild/artifact/cham/builds/examples/${EXAMPLES_HTML_ARCHIVE}") - file(DOWNLOAD "${EXAMPLES_HTML_URI}" "${CMAKE_CURRENT_BINARY_DIR}/Downloaded${EXAMPLES_HTML_ARCHIVE}" - TIMEOUT 10 - STATUS status) - list(GET status 0 status_code) - list(GET status 1 status_string) - if (NOT status_code EQUAL 0) - message(FATAL_ERROR - "Failed to download ${EXAMPLES_HTML_URI} (Code: ${status_code}, ${status_string})") - endif() - - add_custom_target(examples_docs ALL) - add_custom_command(TARGET examples_docs - COMMAND ${CMAKE_COMMAND} -E tar "zxf" "Downloaded${EXAMPLES_HTML_ARCHIVE}" - VERBATIM) - - elseif (BUILD_DOCS) - message(STATUS "${CMAKE_PROJECT_NAME} Examples documentation: Success (build)") - # Process sphinx configuration file - set(sph_conf_author "ADLINK") - string(TIMESTAMP sph_conf_copyright "%Y, ADLINK") - set(sph_conf_version "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}") - set(sph_conf_release "${PROJECT_VERSION}") - configure_file(sphinx-conf.py.in conf.py @ONLY) - - set(builder_output "examples_html_output") - set(builder_log "sphinx-examples-html.log") - add_custom_command(OUTPUT ${builder_output} - COMMAND ${SPHINX_EXECUTABLE} - -b html - -d ${CMAKE_CURRENT_BINARY_DIR}/cache - -c ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} > ${builder_log} - COMMENT "Running Sphinx for examples html output" - VERBATIM) - - # OUTPUT is a fake target / symbolic name, not an actual file - set_property(SOURCE ${builder_output} PROPERTY SYMBOLIC 1) - add_custom_target(examples_docs ALL DEPENDS ${builder_output}) - - # Archive the output html files, will become a jenkins artifact for use in other jobs - # TODO this hardcoded list and archiving should be replaced by ExternalData refs - set(html_outputs - "_static" - "search.html" - "searchindex.js" - "genindex.html" - "examples.html" - "helloworld/readme.html" - "roundtrip/readme.html" - "throughput/readme.html") - - add_custom_command(OUTPUT ${builder_output} - COMMAND ${CMAKE_COMMAND} - -E tar "zcf" - "${EXAMPLES_HTML_ARCHIVE}" - ${html_outputs} - APPEND - VERBATIM) - - # Remove generated files when cleaning the build tree - set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES - "cache" - "${builder_log}" - "objects.inv" - ${html_outputs} - "_sources" - "${EXAMPLES_HTML_ARCHIVE}") - endif() -endif() - -if(CMAKE_SYSTEM_NAME MATCHES "Windows") - set(platform_exclude "examples/helloworld/Makefile") -elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") - set(platform_exclude "examples/helloworld/vs|examples/helloworld/HelloWorld\.sln") -else() - set(platform_exclude "this_is_a_placeholder") -endif() - -# Install example source-files -install( - DIRECTORY "${PROJECT_SOURCE_DIR}/examples/" - DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}" - COMPONENT dev - PATTERN "CMakeLists.export" EXCLUDE - PATTERN "examples/CMakeLists.txt" EXCLUDE - REGEX ${platform_exclude} EXCLUDE - REGEX "\.rst|\.py" EXCLUDE -) - -# Install example html docs files -# TODO this should be replaced by install commands that use ExternalData refs (preferably in examples' CMakeLists.txt) -install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" - DESTINATION "${CMAKE_INSTALL_EXAMPLESDIR}" - COMPONENT dev - FILES_MATCHING - PATTERN "CMakeFiles" EXCLUDE - PATTERN "cache" EXCLUDE - PATTERN "_sources" EXCLUDE - PATTERN "*.html" - PATTERN "*.js" - PATTERN "_static/*" -) - diff --git a/src/idlc/src/org/eclipse/cyclonedds/templates/c/banner.st b/src/idlc/src/org/eclipse/cyclonedds/templates/c/banner.st index d27deb4..44334ae 100644 --- a/src/idlc/src/org/eclipse/cyclonedds/templates/c/banner.st +++ b/src/idlc/src/org/eclipse/cyclonedds/templates/c/banner.st @@ -14,7 +14,6 @@ banner (file, date, version) ::= << Generated by Eclipse Cyclone DDS IDL to C Translator File name: .c Source: .idl - Generated: Cyclone DDS: V *****************************************************************/ diff --git a/src/idlc/src/org/eclipse/cyclonedds/templates/h/banner.st b/src/idlc/src/org/eclipse/cyclonedds/templates/h/banner.st index 84c3044..17c56c7 100644 --- a/src/idlc/src/org/eclipse/cyclonedds/templates/h/banner.st +++ b/src/idlc/src/org/eclipse/cyclonedds/templates/h/banner.st @@ -14,7 +14,6 @@ banner (file, date, version) ::= << Generated by Eclipse Cyclone DDS IDL to C Translator File name: .h Source: .idl - Generated: Cyclone DDS: V *****************************************************************/ diff --git a/src/mpt/tests/qos/CMakeLists.txt b/src/mpt/tests/qos/CMakeLists.txt index e2f8109..0632570 100644 --- a/src/mpt/tests/qos/CMakeLists.txt +++ b/src/mpt/tests/qos/CMakeLists.txt @@ -11,7 +11,7 @@ # include(${MPT_CMAKE}) -add_compile_options("-I${PROJECT_SOURCE_DIR}/core/ddsi/include") +add_compile_options("-I${PROJECT_SOURCE_DIR}/src/core/ddsi/include") idlc_generate(mpt_rwdata_lib "procs/rwdata.idl") diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt deleted file mode 100644 index 6c82db7..0000000 --- a/src/scripts/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -if(CMAKE_SYSTEM_NAME MATCHES "Linux") - configure_file( - "cmake/vdds_install_examples.in" "vdds_install_examples" @ONLY) - - install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/vdds_install_examples - DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT dev) -endif() - diff --git a/src/scripts/cmake/vdds_install_examples.in b/src/scripts/cmake/vdds_install_examples.in deleted file mode 100755 index 88d3210..0000000 --- a/src/scripts/cmake/vdds_install_examples.in +++ /dev/null @@ -1,199 +0,0 @@ -#!/bin/sh -# -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others -# -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v. 2.0 which is available at -# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License -# v. 1.0 which is available at -# http://www.eclipse.org/org/documents/edl-v10.php. -# -# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause -# - -OUTPUT_DIR= -SCRIPT_DIR= -EXAMPLES_DIR= -EXPLICIT_YES=false -HELP_SHOWN=false - - -show_help() { -# Show help only once. -if [ $HELP_SHOWN = false ]; then -cat << EOF -Usage: ${0##*/} [-h] [-y] [-d OUTDIR] - -The @CMAKE_PROJECT_NAME@ examples are probably installed in a read-only location. -By executing this script, the examples can be (re)installed to a writable -location. That could be helpful when trying to experiment with the examples. - - -d|--dir OUTDIR Install the examples in OUTDIR. - This directory should not be a sub-directory of the - examples location. - If not set, an output dir will be asked for. When asking - for an output dir, the current directory is used as - suggestion. - -h|--help This text. - -y|--yes Use 'yes' for every question. -EOF -HELP_SHOWN=true -fi -} - - -# -# Parse command line arguments. -# -if [ -z "$1" ]; then - show_help - printf '\n' -else - while :; do - case $1 in - -h|-\?|--help) - show_help - exit - ;; - -d|--dir) - if [ "$2" ]; then - OUTPUT_DIR=$2 - shift - else - show_help - printf '\nERROR: "-d|--dir" requires a non-empty option argument.\n' "$1" >&2 - exit 1 - fi - ;; - -y|--yes) - EXPLICIT_YES=true - ;; - -?*) - printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2 - ;; - *) - break - esac - shift - done -fi - - -# -# Get the location of the script. -# -SCRIPT=`readlink -f "$0"` -SCRIPT_DIR=`dirname "$SCRIPT"` - - -# -# Try a few locations where the examples probably are. -# -EXAMPLES_DIR_DEFAULT="/usr/share/@CMAKE_PROJECT_NAME@/examples" -EXAMPLES_DIR_RELATIVE="$SCRIPT_DIR/../share/@CMAKE_PROJECT_NAME@/examples" -EXAMPLES_DIR_CURRENT=`pwd` - -if [ -d "$EXAMPLES_DIR_DEFAULT" ]; then - EXAMPLES_DIR="$EXAMPLES_DIR_DEFAULT" -elif [ -d "$EXAMPLES_DIR_RELATIVE" ]; then - EXAMPLES_DIR="$EXAMPLES_DIR_RELATIVE" -elif [ -d "$EXAMPLES_DIR_CURRENT" ]; then - case "$EXAMPLES_DIR_CURRENT" in - *@CMAKE_PROJECT_NAME@/examples) EXAMPLES_DIR="$EXAMPLES_DIR_CURRENT" - esac -fi - -if [ -z "$EXAMPLES_DIR" ]; then - show_help - printf '\nERROR: Could not find the @CMAKE_PROJECT_NAME@ examples at any of these locations:\n' >&2 - printf ' - [Default ] - %s\n' "$EXAMPLES_DIR_DEFAULT" >&2 - printf ' - [Relative] - %s\n' "$EXAMPLES_DIR_RELATIVE" >&2 - printf ' - [Current ] - %s\n' "$EXAMPLES_DIR_CURRENT" >&2 - exit 1 -fi - - -# -# Only get the output dir ourselves when it wasn't already set by the -# command line arguments. -# -if [ -z "$OUTPUT_DIR" ]; then - # Assume the examples should be installed in the current directory. - OUTPUT_DIR=`pwd` - - # When explicit 'yes' is provided as a command line argument, then - # don't ask if the assumption is correct. - if [ $EXPLICIT_YES = false ]; then - - # Keep pestering the user until we have a proper answer. - while true; do - YNC= - if [ "$OUTPUT_DIR" = "$EXAMPLES_DIR" ]; then - YNC="N" - elif [ ! -w "$OUTPUT_DIR" ]; then - YNC="N" - else - read -p "Do you wish to install the @CMAKE_PROJECT_NAME@ examples in \"$OUTPUT_DIR\"? [Yes|No|Cancel] " YNC - fi - case $YNC in - [Yy]* ) break;; - [Nn]* ) read -p "New examples install directory> " OUTPUT_DIR; break;; - [Cc]* ) exit;; - * ) echo "Please answer yes, no or cancel.";; - esac - done - elif [ "$OUTPUT_DIR" = "$EXAMPLES_DIR" ]; then - show_help - printf '\nERROR: Destination is same as source.\n' - exit 1 - fi -fi - - -# -# Check if the output dir is valid. -# -if [ ! -d "$OUTPUT_DIR" ]; then - # Only ask for permission if an explicit yes wasn't part of - # the command line arguments. - if [ $EXPLICIT_YES = false ]; then - while true; do - read -p "Do you wish to create directory \"$OUTPUT_DIR\"? [Yes|No] " YN - case $YN in - [Yy]* ) break;; - [Nn]* ) exit;; - * ) echo "Please answer yes or no.";; - esac - done - fi - mkdir -p "$OUTPUT_DIR" - if [ $? -ne 0 ]; then - printf 'ERROR: Could not create directory "%s"\n' "$OUTPUT_DIR" - exit 1 - fi -fi -# If the directory still doesn't exist, exit. -if [ ! -d "$OUTPUT_DIR" ]; then - show_help - printf '\nERROR: Directory "%s" does not exist.\n' "$OUTPUT_DIR" >&2 - exit 1 -fi -# If the directory isn't writable, exit. -if [ ! -w "$OUTPUT_DIR" ]; then - show_help - printf '\nERROR: Directory "%s" does not have write permission.\n' "$OUTPUT_DIR" >&2 - exit 1 -fi - - -# -# Copy the examples. -# -cp -Rf "$EXAMPLES_DIR" "$OUTPUT_DIR" -if [ $? -ne 0 ]; then - printf 'ERROR: Could not install examples\n' - exit 1 -else - printf 'Installed @CMAKE_PROJECT_NAME@ examples into "%s"\n' "$OUTPUT_DIR" -fi - diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 9c2d51c..27801bf 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright(c) 2006 to 2018 ADLINK Technology Limited and others +# Copyright(c) 2006 to 2019 ADLINK Technology Limited and others # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v. 2.0 which is available at @@ -11,15 +11,10 @@ # set(CMAKE_INSTALL_TOOLSDIR "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}/tools") add_subdirectory(pubsub) -add_subdirectory(config) +if(BUILD_CONFTOOL) + add_subdirectory(config) +endif() add_subdirectory(ddsls) -add_subdirectory(ddsperf) - -# VxWorks build machines use OpenJDK 8, which lack jfxrt.jar. Do not build launcher on that platform. -# -# TODO Instead of making inclusion dependent on platform name, the condition should instead be on the -# jdk vendor (Oracle JDK, not OpenJDK). Find a way to make CMake aware of jdk vendor. -#option(BUILD_LAUNCHER "Enable building of launcher." ON) -#if(NOT CMAKE_SYSTEM_NAME STREQUAL "VxWorks" AND BUILD_LAUNCHER) -# add_subdirectory(launcher) -#endif() +if(BUILD_IDLC) + add_subdirectory(ddsperf) +endif() diff --git a/src/tools/ddsperf/CMakeLists.txt b/src/tools/ddsperf/CMakeLists.txt index c1c12e0..c09c8e9 100644 --- a/src/tools/ddsperf/CMakeLists.txt +++ b/src/tools/ddsperf/CMakeLists.txt @@ -9,9 +9,11 @@ # # SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause # + idlc_generate(ddsperf_types ddsperf_types.idl) add_executable(ddsperf ddsperf.c) target_link_libraries(ddsperf ddsperf_types ddsc) + if(WIN32) target_compile_definitions(ddsperf PRIVATE _CRT_SECURE_NO_WARNINGS) endif()