forked from jubos/pillowtalk
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
82 lines (64 loc) · 2.42 KB
/
CMakeLists.txt
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_VERBOSE_MAKEFILE off)
PROJECT( pillowtalk )
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_C_FLAGS "-Wall")
SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -g")
SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O2 -Wuninitialized")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET (PILLOWTALK_MAJOR 0)
SET (PILLOWTALK_MINOR 3)
SET (PILLOWTALK_MICRO 0)
# Default to Release type
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
ENDIF (NOT CMAKE_BUILD_TYPE)
# Here we look for curl
#FIND_PATH(CURL_INCLUDE_DIR curl.h /usr/local/include/curl /usr/include/curl )
#FIND_LIBRARY(CURL_LIBRARY NAMES curl PATHS /usr/local/lib /usr/lib NO_DEFAULT_PATH)
FIND_PATH(CURL_INCLUDE_DIR curl/curl.h)
FIND_LIBRARY(CURL_LIBRARY NAMES curl libcurl PATHS ${CMAKE_LIBRARY_PATH})
MESSAGE("-- Curl Include Dir:" ${CURL_INCLUDE_DIR})
MESSAGE("-- Curl Library:" ${CURL_LIBRARY})
IF (CURL_INCLUDE_DIR AND CURL_LIBRARY)
SET(CURL_FOUND TRUE)
ELSE (CURL_INCLUDE_DIR AND CURL_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find CURL")
ENDIF (CURL_INCLUDE_DIR AND CURL_LIBRARY)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
# Here we look for yajl
FIND_PATH(YAJL_INCLUDE_DIR yajl/yajl_parse.h)
FIND_FILE(YAJL_VERSION yajl/yajl_version.h)
FIND_LIBRARY(YAJL_LIBRARY NAMES yajl)
MESSAGE("-- yajl Include Dir:" ${YAJL_INCLUDE_DIR})
MESSAGE("-- yajl Library:" ${YAJL_LIBRARY})
MESSAGE("-- yajl Version File:" ${YAJL_VERSION})
IF (YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
SET(YAJL_FOUND TRUE)
ELSE (YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
MESSAGE(FATAL_ERROR "Could not find YAJL")
ENDIF (YAJL_INCLUDE_DIR AND YAJL_LIBRARY)
IF (YAJL_VERSION)
ADD_DEFINITIONS(-DPT_HAVE_YAJL_VERSION)
ENDIF (YAJL_VERSION)
INCLUDE_DIRECTORIES(${YAJL_INCLUDE_DIR})
# Finding pthreads
FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h)
FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthread pthreadVC2 PATHS ${CMAKE_LIBRARY_PATH})
MESSAGE("-- pthread Include Dir:" ${PTHREAD_INCLUDE_DIR})
MESSAGE("-- pthread Library:" ${PTHREAD_LIBRARY})
IF (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
SET(PTHREAD_FOUND TRUE)
INCLUDE_DIRECTORIES(${PTHREAD_INCLUDE_DIR})
ADD_DEFINITIONS(-DPT_HAVE_PTHREAD)
ELSE (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
MESSAGE(STATUS "-- Could not find pthreads, continuous change feed support disabled")
ENDIF (PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
# Installation Step
IF(WIN32)
ADD_DEFINITIONS(-DPT_BUILD)
ADD_DEFINITIONS(-DPT_SHARED)
ENDIF(WIN32)
add_subdirectory(src)
add_subdirectory(test)
enable_testing()