Mercurial > hg > orthanc
annotate Resources/CMake/MongooseConfiguration.cmake @ 1232:f1c01451a8ee
Introspection of plugins, Plugins can extend Orthanc Explorer with custom JavaScript
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 04 Dec 2014 17:04:40 +0100 |
parents | 96a280b815f4 |
children | afaa55d42ddd 6784a119484d |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_MONGOOSE) |
2 SET(MONGOOSE_SOURCES_DIR ${CMAKE_BINARY_DIR}/mongoose) | |
1112
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
3 |
1116
96a280b815f4
Upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1114
diff
changeset
|
4 if (0) |
1112
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
5 # Use Mongoose 3.1 |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
6 DownloadPackage( |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
7 "e718fc287b4eb1bd523be3fa00942bb0" |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
8 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/mongoose-3.1.tgz" |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
9 "${MONGOOSE_SOURCES_DIR}") |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
10 |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
11 add_definitions(-DMONGOOSE_USE_CALLBACKS=0) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
12 set(MONGOOSE_PATCH ${ORTHANC_ROOT}/Resources/Patches/mongoose-3.1-patch.diff) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
13 |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
14 else() |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
15 # Use Mongoose 3.8 |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
16 DownloadPackage( |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
17 "7e3296295072792cdc3c633f9404e0c3" |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
18 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/mongoose-3.8.tgz" |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
19 "${MONGOOSE_SOURCES_DIR}") |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
20 |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
21 add_definitions(-DMONGOOSE_USE_CALLBACKS=1) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
22 set(MONGOOSE_PATCH ${ORTHANC_ROOT}/Resources/Patches/mongoose-3.8-patch.diff) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
23 endif() |
735 | 24 |
25 # Patch mongoose | |
26 execute_process( | |
1112
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
27 COMMAND patch mongoose.c ${MONGOOSE_PATCH} |
735 | 28 WORKING_DIRECTORY ${MONGOOSE_SOURCES_DIR} |
29 ) | |
30 | |
31 include_directories( | |
32 ${MONGOOSE_SOURCES_DIR} | |
33 ) | |
34 | |
35 list(APPEND THIRD_PARTY_SOURCES | |
36 ${MONGOOSE_SOURCES_DIR}/mongoose.c | |
37 ) | |
38 | |
39 | |
40 if (${ENABLE_SSL}) | |
41 add_definitions( | |
42 -DNO_SSL_DL=1 | |
43 ) | |
890 | 44 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
45 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") | |
735 | 46 link_libraries(dl) |
47 endif() | |
48 | |
49 else() | |
50 add_definitions( | |
51 -DNO_SSL=1 # Remove SSL support from mongoose | |
52 ) | |
53 endif() | |
54 | |
55 | |
56 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
57 if (${CMAKE_COMPILER_IS_GNUCXX}) | |
58 # This is a patch for MinGW64 | |
59 add_definitions(-D_TIMESPEC_DEFINED=1) | |
60 endif() | |
61 endif() | |
62 | |
63 source_group(ThirdParty\\Mongoose REGULAR_EXPRESSION ${MONGOOSE_SOURCES_DIR}/.*) | |
64 | |
65 else() | |
66 CHECK_INCLUDE_FILE_CXX(mongoose.h HAVE_MONGOOSE_H) | |
67 if (NOT HAVE_MONGOOSE_H) | |
68 message(FATAL_ERROR "Please install the mongoose-devel package") | |
69 endif() | |
70 | |
71 CHECK_LIBRARY_EXISTS(mongoose mg_start "" HAVE_MONGOOSE_LIB) | |
72 if (NOT HAVE_MONGOOSE_LIB) | |
73 message(FATAL_ERROR "Please install the mongoose-devel package") | |
74 endif() | |
75 | |
1112
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
76 if (SYSTEM_MONGOOSE_USE_CALLBACKS) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
77 add_definitions(-DMONGOOSE_USE_CALLBACKS=1) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
78 else() |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
79 add_definitions(-DMONGOOSE_USE_CALLBACKS=0) |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
80 endif() |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
81 |
735 | 82 link_libraries(mongoose) |
83 endif() | |
1112
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
84 |
a119f9ae3640
upgrade to Mongoose 3.8
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1110
diff
changeset
|
85 |