/
CMakeLists.txt
126 lines (114 loc) · 5.4 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
## Copyright(c) 2020-2022, Intel Corporation
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted provided that the following conditions are met:
##
## * Redistributions of source code must retain the above copyright notice,
## this list of conditions and the following disclaimer.
## * Redistributions in binary form must reproduce the above copyright notice,
## this list of conditions and the following disclaimer in the documentation
## and/or other materials provided with the distribution.
## * Neither the name of Intel Corporation nor the names of its contributors
## may be used to endorse or promote products derived from this software
## without specific prior written permission.
##
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
## POSSIBILITY OF SUCH DAMAGE
cmake_minimum_required(VERSION 3.10)
if(OPAE_WITH_PYBIND11)
if(${CMAKE_VERSION} VERSION_LESS "3.4.0" AND ${PYTHONLIBS_VERSION_STRING} VERSION_LESS "3.9.0")
set(PYBIND11_TAG "v2.4.3")
else()
# Otherwise, pull recent pybind11 tag to enable Python 3.9 support.
set(PYBIND11_TAG "v2.10.0")
endif()
message(STATUS "Using pybind11 ${PYBIND11_TAG}")
opae_external_project_add(PROJECT_NAME pybind11
GIT_URL https://github.com/pybind/pybind11.git
GIT_TAG "${PYBIND11_TAG}"
PRESERVE_REPOS ${OPAE_PRESERVE_REPOS}
)
endif(OPAE_WITH_PYBIND11)
if (OPAE_WITH_CLI11)
if(NOT CLI11_FOUND)
find_package(CLI11 1.8)
endif(NOT CLI11_FOUND)
if(NOT CLI11_FOUND)
set(CLI11_URL
https://github.com/CLIUtils/CLI11.git
CACHE STRING "URL for CLI11 Project")
set(CLI11_TAG
v2.1.2
CACHE STRING "Tag for CLI11")
opae_external_project_add(PROJECT_NAME CLI11
GIT_URL ${CLI11_URL}
GIT_TAG ${CLI11_TAG}
PRESERVE_REPOS ${OPAE_PRESERVE_REPOS}
NO_ADD_SUBDIRECTORY
DEFER
)
set(CLI11_INCLUDE_DIRS ${CLI11_ROOT}/include
CACHE STRING "Path to external CLI11" FORCE)
set(CLI11_LIBRARIES ""
CACHE STRING "Do not link against CLI11 library, using header-only" FORCE)
set(CLI11_DEFINITIONS ""
CACHE STRING "Do not link against CLI11 library, using header-only" FORCE)
set(CLI11_FOUND TRUE CACHE BOOL "CLI11 found as external")
endif(NOT CLI11_FOUND)
endif(OPAE_WITH_CLI11)
if (OPAE_WITH_SPDLOG)
if(NOT spdlog_FOUND)
find_package(spdlog 1.8)
endif(NOT spdlog_FOUND)
if(NOT spdlog_FOUND)
set(SPDLOG_URL
https://github.com/gabime/spdlog.git
CACHE STRING "URL for spdlog Project")
set(SPDLOG_TAG
v1.8.0
CACHE STRING "Tag for spdlog")
opae_external_project_add(PROJECT_NAME spdlog
GIT_URL ${SPDLOG_URL}
GIT_TAG ${SPDLOG_TAG}
PRESERVE_REPOS ${OPAE_PRESERVE_REPOS}
NO_ADD_SUBDIRECTORY
DEFER
)
set(spdlog_INCLUDE_DIRS ${spdlog_ROOT}/include
CACHE STRING "Path to external spdlog" FORCE)
set(spdlog_LIBRARIES ""
CACHE STRING "Do not link against spdlog library, using header-only" FORCE)
set(spdlog_DEFINITIONS ""
CACHE STRING "Do not link against spdlog library, using header-only" FORCE)
set(spdlog_FOUND TRUE CACHE BOOL "spdlog found as external")
else(NOT spdlog_FOUND)
if(spdlog_DEFINITIONS)
string(REGEX MATCH "-DSPDLOG_FMT_EXTERNAL" have_fmt ${spdlog_DEFINITIONS})
if (have_fmt)
find_package(fmt)
set(fmt_LIBRARIES "fmt::fmt" CACHE STRING "fmt library link interface")
endif (have_fmt)
endif(spdlog_DEFINITIONS)
endif(NOT spdlog_FOUND)
endif(OPAE_WITH_SPDLOG)
#if(OPAE_BUILD_TESTS)
# opae_external_project_add(PROJECT_NAME opae-test
# GIT_URL https://github.com/OPAE/opae-test.git
# GIT_TAG ${OPAE_TEST_TAG}
# PRESERVE_REPOS ${OPAE_PRESERVE_REPOS})
#endif(OPAE_BUILD_TESTS)
if(OPAE_BUILD_LEGACY)
opae_external_project_add(PROJECT_NAME opae-legacy
GIT_URL https://github.com/OPAE/opae-legacy.git
GIT_TAG ${OPAE_LEGACY_TAG}
PRESERVE_REPOS ${OPAE_PRESERVE_REPOS})
endif(OPAE_BUILD_LEGACY)