From 94524bfd76cad2cf8b8fffdf2f08f1b4b338bee6 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Tue, 12 Nov 2019 15:26:35 -0800 Subject: [PATCH] Set default BUILD_IDLC based on presence of Maven This will modify the default behavior to select BUILD_IDLC based on whether Maven is discovered or not. The behavior when `-DBUILD_IDLC` is specified on the command line remains unchanged - the build will maintain the current behavior of failing to configure if `BUILD_IDLC=ON` and Maven was later not found. This reverts (part of) commit 860a6aadae5c6e31456454496d5b918892434d18. Signed-off-by: Scott K Logan --- CMakeLists.txt | 11 ++++++----- colcon.pkg | 3 --- package.xml | 2 ++ 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 colcon.pkg diff --git a/CMakeLists.txt b/CMakeLists.txt index f7aaa38..9de873b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,11 +23,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) "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) - # 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. @@ -50,6 +45,12 @@ string(REPLACE " " "-" PROJECT_NAME_DASHED "${PROJECT_NAME_FULL}") string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_CAPS) string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_SMALL) +# 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. +find_package(Maven 3.0 QUIET) +option(BUILD_IDLC "Build IDL preprocessor" ${Maven_FOUND}) + set(CMAKE_C_STANDARD 99) if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks") add_definitions(-std=c99) diff --git a/colcon.pkg b/colcon.pkg deleted file mode 100644 index 2d2a3ae..0000000 --- a/colcon.pkg +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cmake-args": [ "-DBUILD_IDLC=OFF" ] -} diff --git a/package.xml b/package.xml index 9d0980d..5b4b661 100644 --- a/package.xml +++ b/package.xml @@ -12,6 +12,8 @@ https://github.com/eclipse-cyclonedds/cyclonedds cmake + java + maven openssl libcunit-dev python3-sphinx