-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (45 loc) · 1.71 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
cmake_minimum_required (VERSION 2.6)
project (bot)
set (bot_VERSION_MAJOR 0)
set (bot_VERSION_MINOR 1)
set (bot_VERSION_PATCH 0)
set (bot_VERSION_STRING
${bot_VERSION_MAJOR}.${bot_fileio_VERSION_MINOR}.${bot_fileio_VERSION_PATCH} )
set( CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib /usr/lib /usr/local/lib )
set( CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /usr/include /usr/local/include )
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake" )
set ( INSTALL_BIN_PATH /usr/local/bin )
set ( INSTALL_LIB_PATH /usr/local/lib )
set ( INSTALL_AR_PATH /usr/local/lib )
set ( INSTALL_HEADERS_PATH /usr/local/include )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,/usr/local/lib")
# Make relative paths absolute (needed later on)
foreach(p LIB BIN HEADERS AR)
set(var INSTALL_${p}_PATH)
if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
endforeach()
find_package(discord)
if ( discord_FOUND )
message( STATUS "Found libdiscord" )
else()
message( FATAL_ERROR "Error : discord library not found" )
endif()
### Set include directories
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/include/"
"${CMAKE_CURRENT_BINARY_DIR}"
)
### File lists
file( GLOB src "src/*.c" )
### Targets
add_executable( "bot" ${src} )
### Linking
target_link_libraries( "bot"
"${DISCORD_LIBRARY}" curl )
### Install
# install( TARGETS "bot"
# RUNTIME DESTINATION ${INSTALL_BIN_PATH} COMPONENT main
# LIBRARY DESTINATION ${INSTALL_LIB_PATH} COMPONENT main
# ARCHIVE DESTINATION ${INSTALL_AR_PATH} COMPONENT main )
#