Skip to content

Commit

Permalink
Merge pull request #2262 from elBoberido/iox-2011-apply-cpptoml-patch…
Browse files Browse the repository at this point in the history
…-only-if-not-yet-applied-release-2-0

iox-#2011 Apply cpptoml patch only if not yet applied
  • Loading branch information
elBoberido authored Apr 17, 2024
2 parents 1983be8 + aab127d commit ce3475d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions iceoryx_posh/cmake/cpptoml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE)
endif()

execute_process(
COMMAND git apply -p1 --ignore-space-change --whitespace=nowarn
COMMAND git apply -R -p1 --ignore-space-change --whitespace=nowarn --quiet --check
INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001-cpptoml-cmake-version.patch"
WORKING_DIRECTORY "${SOURCE_DIR}"
RESULT_VARIABLE result)
if(result)
message(WARNING "CMake step [patch] for '${PROJECT_NAME}' failed! Error code: ${result}! Build of '${PROJECT_NAME}' might fail")
message(STATUS "Applying patch for minimal cmake version to cpptoml")

execute_process(
COMMAND git apply -p1 --ignore-space-change --whitespace=nowarn
INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001-cpptoml-cmake-version.patch"
WORKING_DIRECTORY "${SOURCE_DIR}"
RESULT_VARIABLE result)
if(result)
message(FATAL_ERROR "CMake step [patch] for '${PROJECT_NAME}' failed! Error code: ${result}!")
endif()
endif()

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DENABLE_LIBCXX=off" "-DCPPTOML_BUILD_EXAMPLES=off" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${SOURCE_DIR}" ${CMAKE_ADDITIONAL_OPTIONS}
Expand Down

0 comments on commit ce3475d

Please sign in to comment.