-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
74 lines (54 loc) · 2.03 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
project(devicehub_cpp)
cmake_minimum_required(VERSION 2.8)
set(VERSION "0.0.2")
aux_source_directory(devicehub SRC_LIB_LIST)
aux_source_directory(examples SRC_LIST)
cmake_policy(SET CMP0016 OLD)
add_definitions(-std=c++11)
add_executable(${PROJECT_NAME} ${SRC_LIST} ${SRC_LIB_LIST})
add_library(devicehub SHARED ${SRC_LIB_LIST})
include_directories("${CMAKE_SOURCE_DIR}/devicehub")
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
SET(CMAKE_BUILD_TYPE Debug)
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
find_package(Mosquitto)
if(MOSQUITTO_FOUND)
include_directories(${MOSQUITTO_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} ${MOSQUITTO_LIBRARIES})
target_link_libraries (devicehub ${MOSQUITTO_LIBRARIES})
endif (MOSQUITTO_FOUND)
find_package(Mosquittopp)
if(MOSQUITTOPP_FOUND)
include_directories(${MOSQUITTOPP_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} ${MOSQUITTOPP_LIBRARIES})
target_link_libraries (devicehub ${MOSQUITTOPP_LIBRARIES})
endif (MOSQUITTOPP_FOUND)
find_package(OpenSSL)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} ${OPENSSL_LIBRARIES})
target_link_libraries (devicehub ${OPENSSL_LIBRARIES})
endif(OPENSSL_FOUND)
find_package(LibCURL)
if(LIBCURL_FOUND)
include_directories(${LibCURL_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${LibCURL_LIBRARIES})
target_link_libraries(devicehub ${LibCURL_LIBRARIES})
endif(LIBCURL_FOUND)
find_package(UUID)
if(UUID_FOUND)
include_directories(${UUID_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${UUID_LIBRARY})
target_link_libraries(devicehub ${UUID_LIBRARY})
endif(UUID_FOUND)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
if(APPLE)
elseif(UNIX)
SET(CPACK_GENERATOR "DEB")
endif()
SET(CPACK_PACKAGE_VERSION ${VERSION})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Ionut Cotoi")
SET(CPACK_PACKAGE_VENDOR "devicehub.net")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_COMPONENTS_ALL applications libraries headers)
INCLUDE(CPack)