Reorganize repository

* Move the project top-level CMakeLists.txt to the root of the project;
  this allows building Cyclone as part of ROS2 without any special
  tricks;

* Clean up the build options:

  ENABLE_SSL:    whether to check for and include OpenSSL support if a
                 library can be found (default = ON); this used to be
                 called DDSC_ENABLE_OPENSSL, the old name is deprecated
                 but still works
  BUILD_DOCS:    whether to build docs (default = OFF)
  BUILD_TESTING: whether to build test (default = OFF)

* Collect all documentation into top-level "docs" directory;

* Move the examples to the top-level directory;

* Remove the unused and somewhat misleading pseudo-default
  cyclonedds.xml;

* Remove unused cmake files

Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
Erik Boasson 2019-07-26 09:43:53 +02:00 committed by eboasson
parent 4e80559763
commit 9cf4b97f1a
102 changed files with 627 additions and 1925 deletions

View file

@ -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='<CycloneDDS><DDSI2E><Internal><EnableExpensiveChecks>all</EnableExpensiveChecks></Internal></DDSI2E></CycloneDDS>' ctest -T test -C ${BUILD_TYPE}
- if [ "${ASAN}" != "none" ]; then

214
CMakeLists.txt Normal file
View file

@ -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 <Package>Config.cmake and packages.
include(Packaging)

View file

@ -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=<install-location> ../src
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build .
and for Windows:
$ cd build
$ cmake -G "<generator-name>" -DCMAKE_INSTALL_PREFIX=<install-location> ../src
$ cmake -G "<generator-name>" -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build .
where you should replace ``<install-location>`` by the directory under which you would like to
@ -65,7 +72,6 @@ which will copy everything to:
* ``<install-location>/bin``
* ``<install-location>/include/ddsc``
* ``<install-location>/share/CycloneDDS``
* ``<install-location>/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
<CycloneDDS>
<General>
<NetworkInterfaceAddress>auto</NetworkInterfaceAddress>
<AllowMulticast>auto</AllowMulticast>
<MaxMessageSize>65500B</MaxMessageSize>
<FragmentSize>65000B</FragmentSize>
</General>
<Internal>
<Watermarks>
<WhcHigh>500kB</WhcHigh>
</Watermarks>
</Internal>
<Tracing>
<Verbosity>config</Verbosity>
<OutputFile>stdout</OutputFile>
</Tracing>
</CycloneDDS>
$ 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 ..

View file

@ -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

View file

@ -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 <Package>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 <info@adlinktech.com>")
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!

49
docs/CMakeLists.txt Normal file
View file

@ -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)

View file

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Before After
Before After

122
docs/manual/CMakeLists.txt Normal file
View file

@ -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})

View file

@ -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

View file

@ -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

View file

@ -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

View file

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

105
examples/CMakeLists.txt Normal file
View file

@ -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/*")

View file

@ -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.

View file

@ -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 <Package>Config.cmake and packages.
include(Packaging)

View file

@ -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")

View file

@ -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@" %*

View file

@ -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@" "$@"

View file

@ -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@" %*

View file

@ -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@" "$@"

View file

@ -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()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View file

@ -1,228 +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
-->
<!--
Installing the Hello World! example at the USERPROFILE directory.
-->
<CPackWiXPatch>
<CPackWiXFragment Id="#PRODUCT">
<DirectoryRef Id="TARGETDIR">
<Directory Id="PersonalFolder">
<Directory Id="CYCLONEUSERDIR" Name="Cyclone DDS">
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples" Name="examples">
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Name="helloworld">
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Name="vs"/>
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Name="generated"/>
</Directory>
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Name="roundtrip" />
<Directory Id="CM_DP_dev.usr.CycloneDDS.examples.throughput" Name="throughput" />
</Directory>
</Directory>
</Directory>
</DirectoryRef>
<Feature Id="UserWritableExampleFeature" Display="expand" Absent="disallow" ConfigurableDirectory="CYCLONEUSERDIR" Title="Cyclone DDS Examples" Description="Example code to getting started with DDS development." Level="1">
<Feature Id="CM_C_usr" Title="Cyclone DDS Development Examples" Description="Example Development files for use with Cyclone DDS. Typically installed in the users 'Document' directory.">
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.Launcher.ApplicationShortcut" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.environment" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" />
<!-- helloworld -->
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.remove" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.sln" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" />
<!-- roundtrip -->
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" />
<!-- throughput -->
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" />
<ComponentRef Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" />
</Feature>
</Feature>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.remove" Directory="CYCLONEUSERDIR" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="Remove.CM_CP_dev.usr.CycloneDDS.examples" Value="Remove.CM_CP_dev.usr.CycloneDDS.examples" KeyPath="yes" />
<!-- helloworld -->
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.helloworld" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" On="uninstall"/>
<!-- roundtrip -->
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" On="uninstall"/>
<!-- throughput -->
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples.throughput" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS.examples" Directory="CM_DP_dev.usr.CycloneDDS.examples" On="uninstall"/>
<RemoveFolder Id="Remove.CM_DP_dev.usr.CycloneDDS" Directory="CYCLONEUSERDIR" On="uninstall"/>
</Component>
<!-- Hello World - files -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" Value="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.idl" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/HelloWorldData.idl" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.sln" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorld.sln" Value="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorld.sln" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorld.sln" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/HelloWorld.sln" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldPublisher.vcxproj" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/HelloWorldPublisher.vcxproj" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldSubscriber.vcxproj" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/HelloWorldSubscriber.vcxproj" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldType.vcxproj" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/HelloWorldType.vcxproj" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.vs" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.directories.props" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.directories.props" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/vs/directories.props" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/generated/HelloWorldData.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld.generated" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.HelloWorldData.h" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/generated/HelloWorldData.h" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.publisher.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.publisher.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/publisher.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.subscriber.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.subscriber.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/subscriber.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" Directory="CM_DP_dev.usr.CycloneDDS.examples.helloworld" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" Value="CM_CP_dev.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.helloworld.CMakeLists.txt" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/helloworld/CMakeLists.txt" KeyPath="no"/>
</Component>
<!-- RoundTrip - files -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.CMakeLists.txt" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/CMakeLists.txt" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.RoundTrip.idl" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/RoundTrip.idl" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.ping.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.ping.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/ping.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.roundtrip" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" Value="CM_CP_dev.usr.CycloneDDS.examples.roundtrip.pong.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.roundtrip.pong.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/roundtrip/pong.c" KeyPath="no"/>
</Component>
<!-- Throughput - files -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.CMakeLists.txt" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.CMakeLists.txt" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/CMakeLists.txt" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.Throughput.idl" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.Throughput.idl" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/Throughput.idl" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.publisher.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.publisher.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/publisher.c" KeyPath="no"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" Directory="CM_DP_dev.usr.CycloneDDS.examples.throughput" Guid="">
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" Value="CM_CP_dev.usr.CycloneDDS.examples.throughput.subscriber.c" KeyPath="yes" />
<File Id="CM_FP_usr.usr.CycloneDDS.examples.throughput.subscriber.c" Source="$(sys.SOURCEFILEDIR)/$(var.CPACK_PACKAGE_NAME)-$(var.CPACK_PACKAGE_VERSION)-win64/dev/share/CycloneDDS/examples/throughput/subscriber.c" KeyPath="no"/>
</Component>
<!-- Add the location of the ddsc.dll to the system path -->
<Component Id="CM_CP_dev.usr.CycloneDDS.examples.environment" Directory="CYCLONEUSERDIR" Guid="">
<!-- CreateFolder and RegistryValue are needed to keep Wix happy -->
<CreateFolder Directory="CYCLONEUSERDIR"/>
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.environment" Value="CM_CP_dev.usr.CycloneDDS.environment" KeyPath="yes" />
<Environment Action="set" Id="CycloneDDSPath" Name="PATH" Part="last" Permanent="yes" System="yes" Value="[INSTALL_ROOT]bin"/>
</Component>
<Component Id="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" Directory="CYCLONEUSERDIR" Guid="">
<!-- CreateFolder and RegistryValue are needed to keep Wix happy -->
<CreateFolder Directory="CYCLONEUSERDIR"/>
<RegistryValue Type="string" Root="HKCU" Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)" Name="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" Value="CM_CP_dev.usr.CycloneDDS.cmake.prefix.path" KeyPath="yes" />
<Environment Action="set" Id="CMakePrefixPath" Name="CMAKE_PREFIX_PATH" Permanent="no" Value="[INSTALL_ROOT]share/CycloneDDS"/>
</Component>
<!-- Offer the user the ability the start the launcher -->
<Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="After clicking Finish, the Vortex DDS Launcher will start (if indicated below). The Vortex DDS Laucher will help to get started with Cyclone DDS." />
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1"/>
<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Start the Vortex DDS Launcher" />
<Property Id="WixShellExecTarget" Value="[INSTALL_ROOT]/bin/vortexddslauncher.exe" />
<CustomAction Id="CM_CA_dev.user.CycloneDDS.Launcher.Launch" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
<UI>
<UIRef Id="$(var.CPACK_WIX_UI_REF)" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="CM_CA_dev.user.CycloneDDS.Launcher.Launch">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
</UI>
<!-- Create start-menu -->
<DirectoryRef Id="TARGETDIR">
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Cyclone DDS"/>
</Directory>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="CM_CP_dev.usr.CycloneDDS.Launcher.ApplicationShortcut" Guid="C21831A3-FBCE-44D0-A098-A1F21FD4846F">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="CycloneDDS Launcher"
Directory="ApplicationProgramsFolder"
Description="My Application Description"
Target="[INSTALL_ROOT]/bin/vortexddslauncher.exe"
Icon="ShortcutIcon"
IconIndex="0">
<Icon Id="ShortcutIcon" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)" />
</Shortcut>
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\AdLink" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
</CPackWiXFragment>
</CPackWiXPatch>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

View file

@ -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:
# <WindRiver>/gnu/4.3.3-vxworks-6.9/x86-linux2/bin
# <WindRiver>/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}")

View file

@ -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=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoverageConvenience.cmake
# If you start the scripts while in <cham bld> 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()

View file

@ -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=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePreCobertura.cmake
# $ ctest -T test
# $ ctest -T coverage
# $ ctest -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePostCobertura.cmake
# If you start the scripts while in <cham bld> 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")

View file

@ -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=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePreHtml.cmake
# $ ctest -T test
# $ ctest -T coverage
# $ ctest -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePostHtml.cmake
# If you start the scripts while in <cham bld> 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")

View file

@ -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=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePreCobertura.cmake
# $ ctest -T test
# $ ctest -T coverage
# $ ctest -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePostCobertura.cmake
# If you start the scripts while in <cham bld> 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.
#

View file

@ -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=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePreHtml.cmake
# $ ctest -T test
# $ ctest -T coverage
# $ ctest -DCOVERAGE_SETTINGS=<cham bld>/CoverageSettings.cmake -P <cham src>/cmake/scripts/CoveragePostHtml.cmake
# If you start the scripts while in <cham bld> 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})

View file

@ -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)

View file

@ -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()

View file

@ -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")

View file

@ -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)

View file

@ -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
)

View file

@ -1,29 +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_PROJECT_NAME@>
<Domain>
<Id>any</Id>
</Domain>
<DDSI2E>
<General>
<NetworkInterfaceAddress>auto</NetworkInterfaceAddress>
<AllowMulticast>true</AllowMulticast>
<EnableMulticastLoopback>true</EnableMulticastLoopback>
</General>
<Compatibility>
<StandardsConformance>lax</StandardsConformance>
</Compatibility>
<Tracing>
<Verbosity>warning</Verbosity> <!-- Set to 'finest' for debugging level output -->
</Tracing>
</DDSI2E>
</@CMAKE_PROJECT_NAME@>

View file

@ -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/*"
)

View file

@ -14,7 +14,6 @@ banner (file, date, version) ::= <<
Generated by Eclipse Cyclone DDS IDL to C Translator
File name: <file>.c
Source: <file>.idl
<if(date)> Generated: <date><endif>
Cyclone DDS: V<version>
*****************************************************************/

View file

@ -14,7 +14,6 @@ banner (file, date, version) ::= <<
Generated by Eclipse Cyclone DDS IDL to C Translator
File name: <file>.h
Source: <file>.idl
<if(date)> Generated: <date><endif>
Cyclone DDS: V<version>
*****************************************************************/

View file

@ -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")

View file

@ -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()

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more