-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
50 lines (37 loc) · 1.49 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
set(ENV_EXTRA_CMAKE_MODULES_DIRS $ENV{EXTRA_CMAKE_MODULES_DIRS})
if(ENV_EXTRA_CMAKE_MODULES_DIRS)
set(EXTRA_CMAKE_MODULES_DIRS ${EXTRA_CMAKE_MODULES_DIRS} ${ENV_EXTRA_CMAKE_MODULES_DIRS})
endif(ENV_EXTRA_CMAKE_MODULES_DIRS)
if(NOT EXTRA_CMAKE_MODULES_DIRS)
message(FATAL_ERROR
"Cannot find EXTRA_CMAKE_MODULES_DIRS.
1. Please clone it from https://ssl.izenesoft.cn/cmake.
2. Then set EXTRA_CMAKE_MODULES_DIRS through environment variable
export EXTRA_CMAKE_MODULES_DIRS=/path/to/cmake
You can put it in your .bashrc so it is loaded automatically.
or cmake options
cmake -DEXTRA_CMAKE_MODULES_DIRS=/path/to/cmake (other options)
")
endif(NOT EXTRA_CMAKE_MODULES_DIRS)
set(CMAKE_MODULE_PATH ${EXTRA_CMAKE_MODULES_DIRS})
project(thevoid)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -W -Wall -Wextra")
find_package(blackhole REQUIRED)
find_package(Boost COMPONENTS system thread program_options regex filesystem REQUIRED)
include(cmake/locate_library.cmake)
locate_library(URIPARSER "Uri.h" "uriparser" "uriparser")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
include_directories(
${URIPARSER_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}
${blackhole_INCLUDE_DIR}
)
link_directories(
${URIPARSER_LIBRARY_DIRS}
${Boost_LIBRARY_DIRS}
)
add_subdirectory(thevoid)
add_subdirectory(example)