summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 70ef036a386a492dd8f5bdc55999593364a06b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 2.6)
project(MAD)

set(CMAKE_MODULE_PATH ${MAD_SOURCE_DIR})

find_package(LibXml2 REQUIRED)
find_package(Mhash REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Boost REQUIRED date_time filesystem regex signals system thread)
find_package(MySQL)
find_package(KRB5 COMPONENTS krb5 kadm-client)

find_package(Editline)
if(NOT EDITLINE_FOUND)
  find_package(Readline REQUIRED)
  set(EDITLINE_LIBRARY ${READLINE_LIBRARY})
  set(EDITLINE_INCLUDE_DIR ${READLINE_INCLUDE_DIR})
endif(NOT EDITLINE_FOUND)

if(WIN32)
  add_definitions(-DWINVER=0x0501 -D_WIN32_WINNT=0x0501)
  
  if(CYGWIN)
    add_definitions(-D__USE_W32_SOCKETS)
  endif(CYGWIN)
  
  if(NOT MSVC)
    set(Boost_LIBRARIES ${Boost_LIBRARIES} -lws2_32 -lwsock32)
  endif(NOT MSVC)
  
else(WIN32)
  find_package(DL REQUIRED)
endif(WIN32)

configure_file(${MAD_SOURCE_DIR}/config.h.in ${MAD_BINARY_DIR}/config.h)

set(INCLUDES 
  ${MAD_SOURCE_DIR}/src
  ${MAD_BINARY_DIR}
  ${LIBXML2_INCLUDE_DIR}
  ${MHASH_INCLUDE_DIR}
  ${DL_INCLUDE_DIR}
  ${EDITLINE_INCLUDE_DIR}
  ${OPENSSL_INCLUDE_DIR}
  ${Boost_INCLUDE_DIR}
)

add_subdirectory(src)