Ver código fonte

COMP: Updated ctkFunctionApplyPatches to make use of ctkFunctionLFtoCRLF

On windows, the parch file are expected to have CRLF line endings
Jean-Christophe Fillion-Robin 15 anos atrás
pai
commit
011b790fb8

+ 5 - 1
CMake/ctkFunctionApplyPatches.cmake

@@ -19,7 +19,8 @@
 ###########################################################################
 
 #
-#
+# Depends on:
+#  CTK/CMake/ctkFunctionLFtoCRLF.cmake
 #
 
 FUNCTION(ctkFunctionApplyPatches PATCH_EXE SRC_DIR PATCH_FILES)
@@ -32,6 +33,9 @@ FUNCTION(ctkFunctionApplyPatches PATCH_EXE SRC_DIR PATCH_FILES)
   # Apply patches
   FOREACH(patch_file ${PATCH_FILES})
     MESSAGE("Applying patch: ${patch_file}")
+    IF(WIN32)
+      ctkFunctionLFtoCRLF("${patch_file}" "${patch_file}")
+    ENDIF()
     EXECUTE_PROCESS(COMMAND ${PATCH_EXE} -p0 -i "${patch_file}" -d "${SRC_DIR}" RESULT_VARIABLE result_var)
     IF(result_var)
       MESSAGE("ERROR: ${result_var}")

+ 19 - 0
CMake/ctkFunctionLFtoCRLF.cmake

@@ -1,3 +1,22 @@
+###########################################################################
+#
+#  Library:   CTK
+# 
+#  Copyright (c) 2010  Kitware Inc.
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#      http://www.commontk.org/LICENSE
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+# 
+###########################################################################
 
 #
 #

+ 1 - 0
CMakeLists.txt

@@ -124,6 +124,7 @@ INCLUDE(CMake/ctkMacroSetupQt.cmake)
 INCLUDE(CMake/ctkMacroTargetLibraries.cmake) # Import multiple macros
 INCLUDE(CMake/ctkFunctionExtractOptionNameAndValue.cmake)
 INCLUDE(CMake/ctkFunctionExecuteProcess.cmake)
+INCLUDE(CMake/ctkFunctionLFtoCRLF.cmake)
 INCLUDE(CMake/ctkMacroValidateBuildOptions.cmake)
 INCLUDE(CMake/ctkMacroAddCtkLibraryOptions.cmake)
 INCLUDE(CMake/ctkFunctionGenerateDGraphInput.cmake)