This repository was archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
64 lines (56 loc) · 2.13 KB
/
CMakeLists.txt
File metadata and controls
64 lines (56 loc) · 2.13 KB
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
# Copyright 2012 Nedim Srndic, University of Tuebingen
#
# This file is part of libquickly.
#
# libquickly is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# libquickly is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with libquickly. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8)
project(libquickly)
set(QUICKLY_VERSION "1.1")
# A macro for aborting if a required library is not found
macro(require_library RL_LIBRARY_NAME)
find_library(RL_LIB ${RL_LIBRARY_NAME})
if (RL_LIB STREQUAL "RL_LIB-NOTFOUND")
message(FATAL_ERROR "The library '${RL_LIBRARY_NAME}' is required, not found")
else (RL_LIB STREQUAL "RL_LIB-NOTFOUND")
message(STATUS "Found library '${RL_LIBRARY_NAME}'")
endif (RL_LIB STREQUAL "RL_LIB-NOTFOUND")
unset(RL_LIB CACHE)
unset(RL_LIB)
endmacro(require_library)
# If boost_thread is not installed, do not proceed
require_library(boost_thread)
require_library(boost_system)
# Set some important names
set(QUICKLY_SHARED_LIBRARY_NAME quickly)
set(QUICKLY_STATIC_LIBRARY_NAME quickly-static)
set(QUICKLY_REQUIRED_LIBRARIES boost_thread boost_system)
# Set default compile flags for GCC
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wformat=2 -Wall -Wextra -Wl,-z,defs")
endif(CMAKE_COMPILER_IS_GNUCXX)
# Source directory
add_subdirectory(src)
# Test directory
if (MAKE_TESTS)
message(STATUS "Will make tests")
add_subdirectory(test)
endif (MAKE_TESTS)
unset(MAKE_TESTS CACHE)
unset(MAKE_TESTS)
# Install include files
install(DIRECTORY src/
DESTINATION include/quickly
FILES_MATCHING PATTERN "*.h"
PATTERN ".svn" EXCLUDE)