-
Notifications
You must be signed in to change notification settings - Fork 0
/
prrngConfig.cmake
70 lines (59 loc) · 1.8 KB
/
prrngConfig.cmake
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
66
67
68
69
70
# prrng cmake module
#
# This module sets the target:
#
# prrng
#
# In addition, it sets the following variables:
#
# prrng_FOUND - true if prrng found
# prrng_VERSION - prrng's version
# prrng_INCLUDE_DIRS - the directory containing prrng headers
#
# The following support targets are defined to simplify things:
#
# prrng::compiler_warnings - enable compiler warnings
# prrng::assert - enable prrng assertions
# prrng::debug - enable all assertions (slow)
include(CMakeFindDependencyMacro)
# Define target "prrng"
if(NOT TARGET prrng)
include("${CMAKE_CURRENT_LIST_DIR}/prrngTargets.cmake")
get_target_property(prrng_INCLUDE_DIRS prrng INTERFACE_INCLUDE_DIRECTORIES)
endif()
# Find dependencies
find_dependency(xtensor REQUIRED)
find_dependency(Boost REQUIRED)
# Define support target "prrng::compiler_warnings"
if(NOT TARGET prrng::compiler_warnings)
add_library(prrng::compiler_warnings INTERFACE IMPORTED)
if(MSVC)
set_property(
TARGET prrng::compiler_warnings
PROPERTY INTERFACE_COMPILE_OPTIONS
/W4)
else()
set_property(
TARGET prrng::compiler_warnings
PROPERTY INTERFACE_COMPILE_OPTIONS
-Wall -Wextra -pedantic -Wno-unknown-pragmas)
endif()
endif()
# Define support target "prrng::assert"
if(NOT TARGET prrng::assert)
add_library(prrng::assert INTERFACE IMPORTED)
set_property(
TARGET prrng::assert
PROPERTY INTERFACE_COMPILE_DEFINITIONS
PRRNG_ENABLE_ASSERT)
endif()
# Define support target "prrng::debug"
if(NOT TARGET prrng::debug)
add_library(prrng::debug INTERFACE IMPORTED)
set_property(
TARGET prrng::debug
PROPERTY INTERFACE_COMPILE_DEFINITIONS
XTENSOR_ENABLE_ASSERT
PRRNG_ENABLE_ASSERT
PRRNG_ENABLE_DEBUG)
endif()