Mercurial > hg > orthanc
comparison Resources/CMake/MongooseConfiguration.cmake @ 1537:fbf763bb1fa3
error detection in patches
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 13 Aug 2015 15:25:38 +0200 |
parents | 728c22ade2e2 |
children | 8b6d8f9b9f71 |
comparison
equal
deleted
inserted
replaced
1536:1b03676d68c2 | 1537:fbf763bb1fa3 |
---|---|
1 if (STATIC_BUILD OR NOT USE_SYSTEM_MONGOOSE) | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_MONGOOSE) |
2 SET(MONGOOSE_SOURCES_DIR ${CMAKE_BINARY_DIR}/mongoose) | 2 SET(MONGOOSE_SOURCES_DIR ${CMAKE_BINARY_DIR}/mongoose) |
3 | |
4 if (IS_DIRECTORY "${MONGOOSE_SOURCES_DIR}") | |
5 set(FirstRun OFF) | |
6 else() | |
7 set(FirstRun ON) | |
8 endif() | |
3 | 9 |
4 if (0) | 10 if (0) |
5 # Use Mongoose 3.1 | 11 # Use Mongoose 3.1 |
6 DownloadPackage( | 12 DownloadPackage( |
7 "e718fc287b4eb1bd523be3fa00942bb0" | 13 "e718fc287b4eb1bd523be3fa00942bb0" |
22 set(MONGOOSE_PATCH ${ORTHANC_ROOT}/Resources/Patches/mongoose-3.8-patch.diff) | 28 set(MONGOOSE_PATCH ${ORTHANC_ROOT}/Resources/Patches/mongoose-3.8-patch.diff) |
23 endif() | 29 endif() |
24 | 30 |
25 # Patch mongoose | 31 # Patch mongoose |
26 execute_process( | 32 execute_process( |
27 COMMAND patch -N mongoose.c ${MONGOOSE_PATCH} | 33 COMMAND ${PATCH_EXECUTABLE} -N mongoose.c ${MONGOOSE_PATCH} |
28 WORKING_DIRECTORY ${MONGOOSE_SOURCES_DIR} | 34 WORKING_DIRECTORY ${MONGOOSE_SOURCES_DIR} |
35 RESULT_VARIABLE Failure | |
29 ) | 36 ) |
37 | |
38 if (Failure AND FirstRun) | |
39 message(FATAL_ERROR "Error while patching a file") | |
40 endif() | |
30 | 41 |
31 include_directories( | 42 include_directories( |
32 ${MONGOOSE_SOURCES_DIR} | 43 ${MONGOOSE_SOURCES_DIR} |
33 ) | 44 ) |
34 | 45 |
79 add_definitions(-DMONGOOSE_USE_CALLBACKS=0) | 90 add_definitions(-DMONGOOSE_USE_CALLBACKS=0) |
80 endif() | 91 endif() |
81 | 92 |
82 link_libraries(mongoose) | 93 link_libraries(mongoose) |
83 endif() | 94 endif() |
84 | |
85 |