Mercurial > hg > orthanc
comparison Resources/CMake/Log4CPlusConfiguration.cmake @ 100:27dc762e3dc8
getting rid of static dcmtk for debian
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Oct 2012 09:33:25 +0200 |
parents | |
children | 428784e59dcd |
comparison
equal
deleted
inserted
replaced
99:52ed88d3096a | 100:27dc762e3dc8 |
---|---|
1 add_definitions( | |
2 -DDCMTK_BUNDLES_LOG4CPLUS=${DCMTK_BUNDLES_LOG4CPLUS} | |
3 ) | |
4 | |
5 if (DCMTK_BUNDLES_LOG4CPLUS) | |
6 message("DCMTK already bundles its own copy of Log4CPlus") | |
7 | |
8 elseif (STATIC_BUILD) | |
9 SET(LOG4CPLUS_SOURCES_DIR ${CMAKE_BINARY_DIR}/log4cplus-1.0.4.1) | |
10 DownloadPackage("http://downloads.sourceforge.net/project/log4cplus/log4cplus-stable/1.0.4/log4cplus-1.0.4.1.tar.gz" "${LOG4CPLUS_SOURCES_DIR}" "" "") | |
11 | |
12 execute_process( | |
13 COMMAND patch src/factory.cxx ${CMAKE_SOURCE_DIR}/Resources/log4cplus-patch.diff | |
14 WORKING_DIRECTORY ${LOG4CPLUS_SOURCES_DIR} | |
15 ) | |
16 | |
17 AUX_SOURCE_DIRECTORY(${LOG4CPLUS_SOURCES_DIR}/src THIRD_PARTY_SOURCES) | |
18 | |
19 add_definitions( | |
20 -DLOG4CPLUS_STATIC=1 | |
21 -DINSIDE_LOG4CPLUS=1 | |
22 -DLOG4CPLUS_DECLSPEC_EXPORT= | |
23 -DLOG4CPLUS_DECLSPEC_IMPORT= | |
24 ) | |
25 | |
26 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") | |
27 add_definitions( | |
28 -DLOG4CPLUS_HAVE_STDIO_H=1 | |
29 -DLOG4CPLUS_HAVE_UNISTD_H=1 | |
30 -DLOG4CPLUS_HAVE_SYSLOG_H=1 | |
31 -DLOG4CPLUS_HAVE_NETDB_H=1 | |
32 -DLOG4CPLUS_HAVE_ERRNO_H=1 | |
33 -DLOG4CPLUS_HAVE_STAT=1 | |
34 -DLOG4CPLUS_HAVE_SYS_STAT_H=1 | |
35 ) | |
36 file(WRITE ${LOG4CPLUS_SOURCES_DIR}/include/log4cplus/config/defines.hxx "// Empty file") | |
37 | |
38 list(REMOVE_ITEM THIRD_PARTY_SOURCES | |
39 ${LOG4CPLUS_SOURCES_DIR}/src/socket-win32.cxx | |
40 ) | |
41 | |
42 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
43 list(REMOVE_ITEM THIRD_PARTY_SOURCES | |
44 ${LOG4CPLUS_SOURCES_DIR}/src/socket-unix.cxx | |
45 ) | |
46 | |
47 endif() | |
48 | |
49 include_directories(${LOG4CPLUS_SOURCES_DIR}/include) | |
50 | |
51 source_group(ThirdParty\\Log4Cplus REGULAR_EXPRESSION ${LOG4CPLUS_SOURCES_DIR}/.*) | |
52 | |
53 else() | |
54 message(FATAL_ERROR "Dynamic log4cplus") | |
55 | |
56 endif() |