Newer
Older
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
# Find headers and libraries
FIND_PATH(
TURTLE_INCLUDE_DIR
NAMES
mock.hpp
HINTS
$ENV{TURTLE_INCLUDE_DIR}
${TURTLE_INCLUDE_DIR}
external_dependencies/turtle
PATHS
/usr
/usr/local
/home
/opt/local
PATH_SUFFIXES
include
include/turtle
)
# Set TURTLE_FOUND honoring the QUIET and REQUIRED arguments
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
turtle
"Turtle was NOT found!"
TURTLE_INCLUDE_DIR)
# Output variables
IF(TURTLE_FOUND)
# Include dirs
SET(TURTLE_INCLUDE_DIRS ${TURTLE_INCLUDE_DIR})
ELSE()
MESSAGE(FATAL_ERROR "Set, please, the environmental variable TURTLE_INCLUDE_DIR to the folder, where 'mock.hpp' is located...")
ENDIF(TURTLE_FOUND)
# Add path only to the 'include' folder
set(TMP "")
string(REPLACE "/include/turtle" "/include" TMP ${TURTLE_INCLUDE_DIR})
list(APPEND TURTLE_INCLUDE_DIR ${TMP})
# Advanced options for not cluttering the cmake UIs:
MARK_AS_ADVANCED(TURTLE_INCLUDE_DIR)