Skip to content

Commit 76854de

Browse files
authored
Merge pull request #2261 from elBoberido/iox-2011-apply-cpptoml-patch-only-if-not-yet-applied
iox-#2011 Apply cpptoml patch only if not yet applied
2 parents fefa6ad + a3458f8 commit 76854de

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

iceoryx_posh/cmake/cpptoml/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,21 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE)
7373
endif()
7474

7575
execute_process(
76-
COMMAND git apply -p1 --ignore-space-change --whitespace=nowarn
76+
COMMAND git apply -R -p1 --ignore-space-change --whitespace=nowarn --quiet --check
7777
INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001-cpptoml-cmake-version.patch"
7878
WORKING_DIRECTORY "${SOURCE_DIR}"
7979
RESULT_VARIABLE result)
8080
if(result)
81-
message(WARNING "CMake step [patch] for '${PROJECT_NAME}' failed! Error code: ${result}! Build of '${PROJECT_NAME}' might fail")
81+
message(STATUS "Applying patch for minimal cmake version to cpptoml")
82+
83+
execute_process(
84+
COMMAND git apply -p1 --ignore-space-change --whitespace=nowarn
85+
INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001-cpptoml-cmake-version.patch"
86+
WORKING_DIRECTORY "${SOURCE_DIR}"
87+
RESULT_VARIABLE result)
88+
if(result)
89+
message(FATAL_ERROR "CMake step [patch] for '${PROJECT_NAME}' failed! Error code: ${result}!")
90+
endif()
8291
endif()
8392

8493
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}

0 commit comments

Comments
 (0)