-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
82 lines (68 loc) · 1.87 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 3.3 FATAL_ERROR)
project(slack++ VERSION 0.1 LANGUAGES CXX C)
set(CMAKE_BUILD_TYPE Debug)
# set(CMAKE_BUILD_TYPE Release)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include_directories(include src)
set(SOURCES
src/SlackClient.cpp
src/SlackUI.cpp
src/Window.cpp
src/Input.cpp
src/Chat.cpp
src/Roster.cpp
src/Session.cpp
include/SlackClient.hpp
include/SlackUI.hpp
include/Headers.hpp
include/Log.hpp
include/Window.hpp
include/Input.hpp
include/Chat.hpp
include/Roster.hpp
include/Session.hpp
include/WebsocketClient.hpp)
add_executable(slack++ main.cpp ${SOURCES})
find_package(PkgConfig REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
find_package(Jsoncpp REQUIRED)
find_package(Libnotify)
if(LIBNOTIFY_FOUND)
message("Using libnotify")
add_definitions( -DLIBNOTIFY_FOUND)
endif(LIBNOTIFY_FOUND)
find_package(Threads)
set(CURSES_NEED_NCURSES TRUE)
find_package(Ncursesw REQUIRED)
target_include_directories(slack++
PRIVATE ${OPENSSL_INCLUDE_DIRS}
PRIVATE ${CURL_INCLUDE_DIRS}
PRIVATE ${JSONCPP_INCLUDE_DIRS}
PRIVATE ${NCURSESW_INCLUDE_DIRS}
PRIVATE ${LIBNOTIFY_INCLUDE_DIRS}
PUBLIC include)
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
message ("Building on FreeBSD")
find_library(JSONCPP_LIB jsoncpp HINTS /usr/local/lib)
find_library(NCURSESW_LIB ncursesw HINTS /usr/local/lib)
target_link_libraries(slack++
${OPENSSL_SSL_LIBRARY}
${OPENSSL_CRYPTO_LIBRARY}
${CURL_LIBRARIES}
${JSONCPP_LIB}
${NCURSESW_LIB}
${LIBNOTIFY_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
else()
message("Building default (${CMAKE_SYSTEM_NAME})")
target_link_libraries(slack++
${OPENSSL_SSL_LIBRARY}
${OPENSSL_CRYPTO_LIBRARY}
${CURL_LIBRARIES}
${JSONCPP_LIBRARIES}
${NCURSESW_LIBRARIES}
${LIBNOTIFY_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})
endif()
set_property(TARGET slack++ PROPERTY CXX_STANDARD 14)