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 860a6aadae.

Signed-off-by: Scott K Logan <logans@cottsay.net>
This commit is contained in:
Scott K Logan 2019-11-12 15:26:35 -08:00 committed by eboasson
parent ff79941aeb
commit 94524bfd76
3 changed files with 8 additions and 8 deletions

View file

@ -23,11 +23,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"Debug" "Release" "MinSizeRel" "RelWithDebInfo") "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif() 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 # 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 # 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. # 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(TOUPPER ${PROJECT_NAME} PROJECT_NAME_CAPS)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_SMALL) 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) set(CMAKE_C_STANDARD 99)
if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks") if(CMAKE_SYSTEM_NAME STREQUAL "VxWorks")
add_definitions(-std=c99) add_definitions(-std=c99)

View file

@ -1,3 +0,0 @@
{
"cmake-args": [ "-DBUILD_IDLC=OFF" ]
}

View file

@ -12,6 +12,8 @@
<url type="repository">https://github.com/eclipse-cyclonedds/cyclonedds</url> <url type="repository">https://github.com/eclipse-cyclonedds/cyclonedds</url>
<buildtool_depend>cmake</buildtool_depend> <buildtool_depend>cmake</buildtool_depend>
<buildtool_depend>java</buildtool_depend>
<buildtool_depend>maven</buildtool_depend>
<depend>openssl</depend> <depend>openssl</depend>
<test_depend>libcunit-dev</test_depend> <test_depend>libcunit-dev</test_depend>
<doc_depend>python3-sphinx</doc_depend> <doc_depend>python3-sphinx</doc_depend>