-
Notifications
You must be signed in to change notification settings - Fork 45
/
FindMeta.cmake
38 lines (33 loc) · 1.07 KB
/
FindMeta.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
# Find the Meta include directory
# The following variables are set if Meta is found.
# Meta_FOUND - True when the Meta include directory is found.
# Meta_INCLUDE_DIR - The path to where the meta include files are.
# If Meta is not found, Meta_FOUND is set to false.
find_package(PkgConfig)
if(NOT EXISTS "${Meta_INCLUDE_DIR}")
find_path(Meta_INCLUDE_DIR
NAMES meta/meta.hpp
DOC "Meta library header files"
)
endif()
if(EXISTS "${Meta_INCLUDE_DIR}")
include(FindPackageHandleStandardArgs)
mark_as_advanced(Meta_INCLUDE_DIR)
else()
include(ExternalProject)
ExternalProject_Add(meta
GIT_REPOSITORY https://github.com/ericniebler/meta.git
TIMEOUT 5
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
INSTALL_COMMAND "" # Disable install step
)
# Specify include dir
ExternalProject_Get_Property(meta source_dir)
set(Meta_INCLUDE_DIR ${source_dir}/include)
endif()
if(EXISTS "${Meta_INCLUDE_DIR}")
set(Meta_FOUND 1)
else()
set(Meta_FOUND 0)
endif()