forked from sonals/py-libelf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (22 loc) · 917 Bytes
/
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
# SPDX-License-Identifier: MIT
# Copyright (C) 2022-2023 Advanced Micro Devices, Inc.
cmake_minimum_required(VERSION 3.18.0)
project(PYLIBELF HOMEPAGE_URL https://github.com/sonals/py-libelf)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(CMAKE_INSTALL_PREFIX "/opt/xilinx")
else()
message(FATAL_ERROR "Unsupported platform")
endif()
message("-- CMAKE_SYSTEM=${CMAKE_SYSTEM}")
message("-- CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBELF REQUIRED libelf)
message("-- Libelf version: ${LIBELF_VERSION}")
find_package(Python3 COMPONENTS Interpreter REQUIRED)
message("-- Python version: ${Python3_VERSION}")
find_program (PYLINT pylint REQUIRED)
set (PYLIBELF_INSTALL_DIR "pylibelf")
set (PYLIBELF_BUILD_INSTALL_DIR "${CMAKE_BINARY_DIR}${CMAKE_INSTALL_PREFIX}/${PYLIBELF_INSTALL_DIR}")
enable_testing()
add_subdirectory(src)
add_subdirectory(test)