mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
cmake: fixups for inclusion into VILLASnode
This commit is contained in:
parent
a9f9dc4a37
commit
d938bd95b1
3 changed files with 24 additions and 13 deletions
|
@ -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}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue