-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
63 lines (47 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
51
52
53
54
55
56
57
58
59
60
61
62
63
cmake_minimum_required(VERSION 2.8)
find_package(PkgConfig REQUIRED)
project(libnolimits)
set(LIBNOLIMITS_VERSION "1.0.0-beta")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_CXX_FLAGS "-std=c++11")
pkg_check_modules (ZLIB zlib>=1.2.7)
pkg_search_module(ZLIB REQUIRED zlib>=1.2.7)
pkg_check_modules (GLM glm=>0.9.8)
pkg_search_module(GLM REQUIRED glm=>0.9.8)
include_directories("${GLM_INCLUDEDIR}")
include_directories("${ZLIB_INCLUDEDIR}")
link_directories("${GLM_LIBDIR}")
link_directories("${ZLIB_LIBDIR}")
include_directories("${PROJECT_SOURCE_DIR}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
add_subdirectory(include)
add_subdirectory(libnolimits)
# build pkg-config file
configure_file(
"./cmake/libnolimits.pc.in"
"libnolimits.pc"
@ONLY
)
# install pkg-config file
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/libnolimits.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
export(PACKAGE glm)
add_custom_target(
uninstall
COMMAND
cat install_manifest.txt | xargs rm
COMMAND
xargs cmake/rm-empty-dirs < install_manifest.txt
WORKING_DIRECTORY
"${CMAKE_BINARY_DIR}"
)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/examples")
add_subdirectory(examples)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/test")
add_subdirectory(test)