2018-04-13 16:09:02 +02:00
|
|
|
add_subdirectory(common)
|
|
|
|
|
2017-11-21 21:31:08 +01:00
|
|
|
set(SOURCES
|
2018-02-13 14:13:14 +01:00
|
|
|
vlnv.cpp
|
2017-12-06 12:37:24 +01:00
|
|
|
card.cpp
|
2018-02-13 14:13:14 +01:00
|
|
|
ip.cpp
|
|
|
|
ip_node.cpp
|
2017-11-21 21:31:08 +01:00
|
|
|
|
2018-02-13 14:13:14 +01:00
|
|
|
ips/timer.cpp
|
|
|
|
ips/switch.cpp
|
|
|
|
ips/fifo.cpp
|
|
|
|
ips/intc.cpp
|
|
|
|
ips/pcie.cpp
|
2018-03-26 16:14:37 +02:00
|
|
|
ips/dma.cpp
|
2018-04-13 15:30:12 +02:00
|
|
|
ips/bram.cpp
|
2018-06-04 14:13:33 +02:00
|
|
|
ips/rtds.cpp
|
2018-02-13 14:13:14 +01:00
|
|
|
|
2017-11-21 21:31:08 +01:00
|
|
|
kernel/kernel.c
|
|
|
|
kernel/pci.c
|
2018-03-26 15:39:26 +02:00
|
|
|
kernel/vfio.cpp
|
2017-11-21 21:31:08 +01:00
|
|
|
|
|
|
|
utils.c
|
|
|
|
list.c
|
|
|
|
log.c
|
|
|
|
log_config.c
|
|
|
|
log_helper.c
|
|
|
|
)
|
|
|
|
|
|
|
|
include(FindPkgConfig)
|
|
|
|
|
|
|
|
pkg_check_modules(JANSSON jansson)
|
|
|
|
pkg_check_modules(XIL libxil)
|
|
|
|
|
|
|
|
find_package(Threads)
|
|
|
|
|
2017-11-22 19:36:03 +01:00
|
|
|
add_library(villas-fpga SHARED ${SOURCES})
|
2017-11-21 21:31:08 +01:00
|
|
|
|
2018-04-13 16:09:02 +02:00
|
|
|
target_link_libraries(villas-fpga PUBLIC villas-common)
|
2018-05-16 10:58:18 +02:00
|
|
|
|
|
|
|
# GPU library is optional, check for CUDA presence
|
|
|
|
include(CheckLanguage)
|
|
|
|
check_language(CUDA)
|
|
|
|
if(CMAKE_CUDA_COMPILER)
|
|
|
|
add_subdirectory(gpu)
|
|
|
|
target_link_libraries(villas-fpga PUBLIC villas-gpu)
|
|
|
|
else()
|
|
|
|
message("No CUDA support, not building GPU library")
|
|
|
|
endif()
|
2018-04-13 16:09:02 +02:00
|
|
|
|
2017-11-21 21:31:08 +01:00
|
|
|
target_compile_definitions(villas-fpga PRIVATE
|
|
|
|
BUILDID=\"abc\"
|
|
|
|
_GNU_SOURCE
|
|
|
|
)
|
|
|
|
|
2018-06-04 14:05:02 +02:00
|
|
|
target_include_directories(villas-fpga
|
|
|
|
PUBLIC
|
|
|
|
../include
|
|
|
|
${XIL_INCLUDE_DIRS}
|
|
|
|
${JANSSON_INCLUDE_DIRS}
|
2017-11-21 21:31:08 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(villas-fpga PUBLIC
|
|
|
|
${XIL_LIBRARIES}
|
|
|
|
${JANSSON_LIBRARIES}
|
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
m
|
|
|
|
)
|
2018-04-05 11:29:16 +02:00
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
|
|
install(TARGETS villas-fpga
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static
|
|
|
|
)
|
|
|
|
|
|
|
|
install(DIRECTORY ../include/villas DESTINATION include)
|
|
|
|
|
|
|
|
|