Mercurial > hg > orthanc
annotate Resources/CMake/MongooseConfiguration.cmake @ 635:cd3b60f6e7d4
refactoring cmake
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 29 Oct 2013 10:48:03 +0100 |
parents | d775a3cb5a06 |
children | ee0d5abf7958 |
rev | line source |
---|---|
634 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_MONGOOSE) |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
2 SET(MONGOOSE_SOURCES_DIR ${CMAKE_BINARY_DIR}/mongoose) |
411
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
3 DownloadPackage( |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
4 "e718fc287b4eb1bd523be3fa00942bb0" |
5f6d75cd4b46
md5 of third party downlaods
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
407
diff
changeset
|
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/mongoose-3.1.tgz" |
553
27d32fc6209a
simplifications to cmake, use a digest of boost 1.54.0 thanks bcp
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
497
diff
changeset
|
6 "${MONGOOSE_SOURCES_DIR}") |
8 | 7 |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
8 # Patch mongoose |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
9 execute_process( |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
10 COMMAND patch mongoose.c ${CMAKE_SOURCE_DIR}/Resources/Patches/mongoose-patch.diff |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
11 WORKING_DIRECTORY ${MONGOOSE_SOURCES_DIR} |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
12 ) |
8 | 13 |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
14 include_directories( |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
15 ${MONGOOSE_SOURCES_DIR} |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
16 ) |
8 | 17 |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
18 list(APPEND THIRD_PARTY_SOURCES |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
19 ${MONGOOSE_SOURCES_DIR}/mongoose.c |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
20 ) |
8 | 21 |
26 | 22 |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
23 if (${ENABLE_SSL}) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
24 add_definitions( |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
25 -DNO_SSL_DL=1 |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
26 ) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
27 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
28 link_libraries(dl) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
29 endif() |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
30 |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
31 else() |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
32 add_definitions( |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
33 -DNO_SSL=1 # Remove SSL support from mongoose |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
34 ) |
23 | 35 endif() |
36 | |
495 | 37 |
497 | 38 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") |
39 if (${CMAKE_COMPILER_IS_GNUCXX}) | |
40 # This is a patch for MinGW64 | |
41 add_definitions(-D_TIMESPEC_DEFINED=1) | |
42 endif() | |
495 | 43 endif() |
44 | |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
45 source_group(ThirdParty\\Mongoose REGULAR_EXPRESSION ${MONGOOSE_SOURCES_DIR}/.*) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
46 |
23 | 47 else() |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
48 CHECK_INCLUDE_FILE_CXX(mongoose.h HAVE_MONGOOSE_H) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
49 if (NOT HAVE_MONGOOSE_H) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
50 message(FATAL_ERROR "Please install the mongoose-devel package") |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
51 endif() |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
52 |
391 | 53 CHECK_LIBRARY_EXISTS(mongoose mg_start "" HAVE_MONGOOSE_LIB) |
389
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
54 if (NOT HAVE_MONGOOSE_LIB) |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
55 message(FATAL_ERROR "Please install the mongoose-devel package") |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
56 endif() |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
57 |
9aa8ecbeeeb9
dynamically linking against Mongoose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
102
diff
changeset
|
58 link_libraries(mongoose) |
23 | 59 endif() |