Commit 393c5f35 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

cmake: fixups for inclusion into VILLASnode

parent ff07bc39
......@@ -29,9 +29,16 @@ project(VILLASfpga
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
# Several CMake settings/defaults
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(TOPLEVEL_PROJECT ON)
else()
set(TOPLEVEL_PROJECT OFF)
endif()
# GPU library is optional, check for CUDA presence
include(CheckLanguage)
check_language(CUDA)
......@@ -42,14 +49,24 @@ else()
message("No CUDA support, not building GPU library")
endif()
include(FindPkgConfig)
pkg_check_modules(JANSSON REQUIRED IMPORTED_TARGET jansson)
pkg_check_modules(XIL REQUIRED IMPORTED_TARGET libxil)
find_package(Threads)
include_directories(thirdparty/CLI11)
include_directories(thirdparty/rang)
add_subdirectory(common)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(tests)
if(NOT CMAKE_PROJECT_NAME STREQUAL "villas-node")
add_subdirectory(common)
endif()
# Project settings
set(PROJECT_NAME "VILLASfpga")
set(PROJECT_DESCRIPTION "Host library for configuring and communicating with VILLASfpga")
......
......@@ -46,13 +46,6 @@ set(SOURCES
set_source_files_properties(ips/rtds2gpu/xrtds2gpu.c
PROPERTIES COMPILE_FLAGS -Wno-int-to-pointer-cast)
include(FindPkgConfig)
pkg_check_modules(JANSSON jansson)
pkg_check_modules(XIL libxil)
find_package(Threads)
add_library(villas-fpga SHARED ${SOURCES})
target_link_libraries(villas-fpga PUBLIC villas-common)
......@@ -64,7 +57,8 @@ target_compile_definitions(villas-fpga PRIVATE
target_include_directories(villas-fpga
PUBLIC
../include
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
${XIL_INCLUDE_DIRS}
${JANSSON_INCLUDE_DIRS}
)
......
......@@ -34,22 +34,22 @@ set(SOURCES
# hls.cpp
# intc.cpp
add_executable(unit-tests ${SOURCES})
add_executable(unit-tests-fpga ${SOURCES})
if (CMAKE_CUDA_COMPILER)
enable_language(CUDA)
target_sources(unit-tests PRIVATE
target_sources(unit-tests-fpga PRIVATE
gpu.cpp rtds2gpu.cpp gpu_kernels.cu)
endif ()
find_package(Criterion REQUIRED)
target_include_directories(unit-tests PUBLIC
target_include_directories(unit-tests-fpga PUBLIC
../include
${CRITERION_INCLUDE_DIRECTORIES}
)
target_link_libraries(unit-tests PUBLIC
target_link_libraries(unit-tests-fpga PUBLIC
villas-fpga
${CRITERION_LIBRARIES}
)
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