-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
50 lines (39 loc) · 1.11 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
cmake_minimum_required(VERSION 2.8)
project(spotifyWebApi)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
find_package(libspotify REQUIRED)
find_package(Jansson REQUIRED)
find_package(MySqlClient)
find_package(Threads REQUIRED)
set(spotifyWebApi_SOURCES
appkey.c
browse.c
cmd.c
search.c
spshell.c
spshell_posix.c
toplist.c
)
include_directories(${LIBSPOTIFY_INCLUDE_DIR} ${JANSSON_INCLUDE_DIR})
set(spotifyWebApi_LINK_LIBRARIES
${LIBSPOTIFY_LIBRARIES}
${JANSSON_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
option(BUILD_MYSQL "Build with MySQL" OFF)
if(BUILD_MYSQL AND LIBMYSQLCLIENT_FOUND)
MESSAGE("Building with MySQL")
include_directories(${LIBMYSQLCLIENT_INCLUDE_DIR})
list(APPEND spotifyWebApi_SOURCES sp_mysql.c)
list(APPEND spotifyWebApi_LINK_LIBRARIES ${LIBMYSQLCLIENT_LIBRARIES})
add_definitions( -DUSE_MYSQL )
endif()
add_executable(spshell ${spotifyWebApi_SOURCES})
target_link_libraries(spshell
${spotifyWebApi_LINK_LIBRARIES}
)
if(UNIX AND NOT APPLE)
target_link_libraries(spshell
rt
)
endif()