forked from Xilinx/XRT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
85 lines (67 loc) · 2.66 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
PROJECT(XRT)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.0)
ENABLE_TESTING()
SET(PROJECT_DESCRIPTION "https://github.com/Xilinx/XRT")
# Exported interface into XRT for include from implemenation
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/runtime_src
${CMAKE_CURRENT_SOURCE_DIR}/runtime_src/core/include
${CMAKE_CURRENT_SOURCE_DIR}/../tests/validate
)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("-- Host system processor is ${CMAKE_HOST_SYSTEM_PROCESSOR}")
message("-- Target system processor is ${CMAKE_SYSTEM_PROCESSOR}")
set(XRT_NATIVE_BUILD "yes")
if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
set(XRT_NATIVE_BUILD "no")
endif()
if (DEFINED ENV{XRT_NATIVE_BUILD})
set(XRT_NATIVE_BUILD $ENV{XRT_NATIVE_BUILD})
endif()
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RelWithDebInfo)
endif (NOT CMAKE_BUILD_TYPE)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX "/opt/xilinx")
endif()
set (CMAKE_INSTALL_PREFIX "/opt/xilinx")
if (${XRT_NATIVE_BUILD} STREQUAL "no")
set (CMAKE_INSTALL_PREFIX "/usr")
endif()
# Default component name for any install() command without the COMPONENT argument
# The default component is the xrt run-time component, if XRT_DEV_COMPONENT is
# set to something different then a development component will be created with
# link libraries and header which are then excluded from runtime component
set (CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "xrt")
# Enable development package by specifying development component name
# If XRT_DEV_COMPONENT is same DEFAULT_COMPONENT then only that package
# is created with both development and run-time content.
#set (XRT_DEV_COMPONENT "xrt-dev")
set (XRT_DEV_COMPONENT "xrt")
set (XRT_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(XRT_VERSION_RELEASE 202020)
SET(XRT_VERSION_MAJOR 2)
SET(XRT_VERSION_MINOR 8)
if (DEFINED ENV{XRT_VERSION_PATCH})
SET(XRT_VERSION_PATCH $ENV{XRT_VERSION_PATCH})
else(DEFINED $ENV{XRT_VERSION_PATCH})
SET(XRT_VERSION_PATCH 0)
endif(DEFINED ENV{XRT_VERSION_PATCH})
#set(XRT_SOVERSION ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR})
set(XRT_SOVERSION ${XRT_VERSION_MAJOR})
set(XRT_VERSION_STRING ${XRT_VERSION_MAJOR}.${XRT_VERSION_MINOR}.${XRT_VERSION_PATCH})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
if (${XRT_NATIVE_BUILD} STREQUAL "yes")
# Temporary native wrapper while Linux code is being ported to windows.
# When completed the two build flows will once again be merged into one
# common file
if (WIN32)
include(CMake/nativeWin.cmake)
else()
include(CMake/nativeLnx.cmake)
endif()
include(CMake/nativeTests.cmake)
else()
include(CMake/embedded_system.cmake)
endif()