diff --git a/src/idlc/cmake/IdlcGenerate.cmake b/src/idlc/cmake/IdlcGenerate.cmake index 64f5f32..083bfb4 100644 --- a/src/idlc/cmake/IdlcGenerate.cmake +++ b/src/idlc/cmake/IdlcGenerate.cmake @@ -9,14 +9,16 @@ # # SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause # +find_package(Java 1.8 REQUIRED) + if(NOT IDLC_JAR) - set(IDLC_JAR "${CMAKE_CURRENT_LIST_DIR}/idlc-jar-with-dependencies.jar") + set(IDLC_JAR "${CMAKE_CURRENT_LIST_DIR}/idlc-jar-with-dependencies.jar") endif() set(LINE_ENDINGS "UNIX") -if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") - set(EXTENSION ".bat") - set(LINE_ENDINGS "WIN32") +if(WIN32) + set(EXTENSION ".bat") + set(LINE_ENDINGS "WIN32") endif() set(IDLC_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE STRING "") @@ -30,13 +32,6 @@ configure_file( @ONLY NEWLINE_STYLE ${LINE_ENDINGS}) -# FIXME: C++ IDL compiler depends idlpp. Leave it disabled for now. -#configure_file( -# "cmake/dds_idlcpp${EXTENSION}.in" -# "dds_idlcpp${EXTENSION}" -# @ONLY -# NEWLINE_STYLE ${LINE_ENDINGS}) - if(NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")) execute_process(COMMAND chmod +x "${IDLC_DIR}/${IDLC}") endif() diff --git a/src/idlc/cmake/dds_idlc.bat.in b/src/idlc/cmake/dds_idlc.bat.in index 21e9857..7b7f174 100644 --- a/src/idlc/cmake/dds_idlc.bat.in +++ b/src/idlc/cmake/dds_idlc.bat.in @@ -15,5 +15,5 @@ if "%CLASSPATH%"=="" ( set "CLASSPATH=@IDLC_JAR@;%CLASSPATH%" ) -java org.eclipse.cyclonedds.compilers.Idlc %* +"@Java_JAVA_EXECUTABLE@" org.eclipse.cyclonedds.compilers.Idlc %* diff --git a/src/idlc/cmake/dds_idlcpp.bat.in b/src/idlc/cmake/dds_idlcpp.bat.in deleted file mode 100644 index c5aa460..0000000 --- a/src/idlc/cmake/dds_idlcpp.bat.in +++ /dev/null @@ -1,19 +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 - -if "%CLASSPATH%"=="" ( - set "CLASSPATH=@IDLC_JAR@" -) else ( - set "CLASSPATH=@IDLC_JAR@;%CLASSPATH%" -) - -java org.eclipse.cyclonedds.compilers.Idlcpp %* - diff --git a/src/idlc/cmake/dds_idlcpp.in b/src/idlc/cmake/dds_idlcpp.in deleted file mode 100644 index 065bff9..0000000 --- a/src/idlc/cmake/dds_idlcpp.in +++ /dev/null @@ -1,13 +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 -# -java -classpath "@IDLC_JAR@" org.eclipse.cyclonedds.compilers.Idlcpp "$@"