Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1311 Remove CMake warning for cyclonedds
Browse files Browse the repository at this point in the history
Signed-off-by: Dietrich Krönke <[email protected]>
  • Loading branch information
dkroenke committed Apr 11, 2022
1 parent bac5b9d commit 423b450
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions cmake/cyclonedds/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
# Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
# Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,15 +28,15 @@ if(NOT N EQUAL 0)
endif()
endif()

if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(TOOLCHAIN_FILE "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()

set(EXTRA_CMAKE_ARGS)
if(DEFINED CMAKE_CXX_FLAGS)
list(APPEND EXTRA_CMAKE_ARGS -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS})
endif()

if(DEFINED CMAKE_TOOLCHAIN_FILE)
list(APPEND EXTRA_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()

# ===== Helpers
function(fetch_and_install name)
set(DOWNLOAD_CONFIG_DIR ${CMAKE_BINARY_DIR}/dependencies/${name}/download)
Expand All @@ -46,7 +46,7 @@ function(fetch_and_install name)

# Fetch source
configure_file(${name}.cmake.in ${DOWNLOAD_CONFIG_DIR}/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "${TOOLCHAIN_FILE}" "${DOWNLOAD_CONFIG_DIR}"
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "${DOWNLOAD_CONFIG_DIR}" "${EXTRA_CMAKE_ARGS}"
RESULT_VARIABLE result
WORKING_DIRECTORY ${DOWNLOAD_CONFIG_DIR} )
if(result)
Expand All @@ -70,7 +70,13 @@ function(fetch_and_install name)
endforeach()
string( REPLACE ";" " " ADDITIONAL_CMAKE_FLAGS "${ADDITIONAL_CMAKE_FLAGS}")

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${ADDITIONAL_CMAKE_FLAGS}" "${TOOLCHAIN_FILE}" "${EXTRA_CMAKE_ARGS}" "${SOURCE_DIR}"
set(CYCLONE_BUILD_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${EXTRA_CMAKE_ARGS}" "${ADDITIONAL_CMAKE_FLAGS}" "${SOURCE_DIR}")

if(NOT ADDITIONAL_CMAKE_FLAGS STREQUAL "")
list(APPEND CYCLONE_BUILD_ARGS ${ADDITIONAL_CMAKE_FLAGS})
endif()

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" ${CYCLONE_BUILD_ARGS}
RESULT_VARIABLE result
WORKING_DIRECTORY ${BUILD_DIR} )
if(result)
Expand Down
2 changes: 1 addition & 1 deletion cmake/googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
# Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
# Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 423b450

Please sign in to comment.