Mercurial > hg > orthanc
annotate Resources/CMake/MongooseConfiguration.cmake @ 1061:4b4ab35c04f5
fix for visual studio 2012
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 25 Jul 2014 14:34:39 +0200 |
parents | 3a26bc6e4867 |
children | becde5351e47 |
rev | line source |
---|---|
735 | 1 if (STATIC_BUILD OR NOT USE_SYSTEM_MONGOOSE) |
2 SET(MONGOOSE_SOURCES_DIR ${CMAKE_BINARY_DIR}/mongoose) | |
3 DownloadPackage( | |
4 "e718fc287b4eb1bd523be3fa00942bb0" | |
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/mongoose-3.1.tgz" | |
6 "${MONGOOSE_SOURCES_DIR}") | |
7 | |
8 # Patch mongoose | |
9 execute_process( | |
1057
3a26bc6e4867
more generic paths in CMake
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
890
diff
changeset
|
10 COMMAND patch mongoose.c ${ORTHANC_ROOT}/Resources/Patches/mongoose-patch.diff |
735 | 11 WORKING_DIRECTORY ${MONGOOSE_SOURCES_DIR} |
12 ) | |
13 | |
14 include_directories( | |
15 ${MONGOOSE_SOURCES_DIR} | |
16 ) | |
17 | |
18 list(APPEND THIRD_PARTY_SOURCES | |
19 ${MONGOOSE_SOURCES_DIR}/mongoose.c | |
20 ) | |
21 | |
22 | |
23 if (${ENABLE_SSL}) | |
24 add_definitions( | |
25 -DNO_SSL_DL=1 | |
26 ) | |
890 | 27 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR |
28 ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") | |
735 | 29 link_libraries(dl) |
30 endif() | |
31 | |
32 else() | |
33 add_definitions( | |
34 -DNO_SSL=1 # Remove SSL support from mongoose | |
35 ) | |
36 endif() | |
37 | |
38 | |
39 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
40 if (${CMAKE_COMPILER_IS_GNUCXX}) | |
41 # This is a patch for MinGW64 | |
42 add_definitions(-D_TIMESPEC_DEFINED=1) | |
43 endif() | |
44 endif() | |
45 | |
46 source_group(ThirdParty\\Mongoose REGULAR_EXPRESSION ${MONGOOSE_SOURCES_DIR}/.*) | |
47 | |
48 else() | |
49 CHECK_INCLUDE_FILE_CXX(mongoose.h HAVE_MONGOOSE_H) | |
50 if (NOT HAVE_MONGOOSE_H) | |
51 message(FATAL_ERROR "Please install the mongoose-devel package") | |
52 endif() | |
53 | |
54 CHECK_LIBRARY_EXISTS(mongoose mg_start "" HAVE_MONGOOSE_LIB) | |
55 if (NOT HAVE_MONGOOSE_LIB) | |
56 message(FATAL_ERROR "Please install the mongoose-devel package") | |
57 endif() | |
58 | |
59 link_libraries(mongoose) | |
60 endif() |