Commit 6c9714b3 authored by Oliver Horst's avatar Oliver Horst
Browse files

[add] ultra96-zynqmp port

parent f1451490
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
option(ENABLE_INSTALL "Enable target installation possibility" ON)
project(
toki-libc-repl-machine
#
VERSION 0.1
LANGUAGES C ASM
)
find_package(
toki-libc-repl-headers 0.1
REQUIRED
)
find_package(
xil-headers 7.0
REQUIRED
)
add_library(
toki-libc-repl-machine
#
STATIC
"" # The sources are added in the respective sub-folders
)
target_link_libraries(
toki-libc-repl-machine
PRIVATE
toki-libc-repl-headers
xil-headers
)
add_subdirectory(src)
if (ENABLE_INSTALL)
# Configure and install the following files:
# - ${PROJECT_NAME}-config.cmake,
# - ${PROJECT_NAME}-config-version.cmake,
include(CMakePackageConfigHelpers)
set(ConfigPackageLocation lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION})
# ${PROJECT_NAME}-config.cmake
configure_package_config_file(
${PROJECT_NAME}-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
INSTALL_DESTINATION ${ConfigPackageLocation}
)
# ${PROJECT_NAME}-config-config-version.cmake
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
COMPATIBILITY SameMajorVersion
)
# Install exported CMake target files
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}-targets
ARCHIVE DESTINATION lib
)
install(
EXPORT ${PROJECT_NAME}-targets
DESTINATION ${ConfigPackageLocation}
EXPORT_LINK_INTERFACE_LIBRARIES
)
# Install package/module configuration files
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION ${ConfigPackageLocation}
)
endif()
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
target_sources(
toki-libc-repl-machine
#
PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/putchar.c"
)
#include <stdio.h>
#include "xil/xparameters.h"
#include "xil/drivers/xuartps_hw.h"
void _putchar(char character) {
XUartPs_SendByte(STDOUT_BASEADDRESS, character);
}
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(xil-headers 7.0)
find_dependency(toki-libc-repl-headers 0.1)
# Import targets
include(${CMAKE_CURRENT_LIST_DIR}/toki-libc-repl-machine-targets.cmake)
check_required_components(toki-libc-repl-machine)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment