CMakeLists.txt 2.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
## CMakeLists.txt
#
# @author Daniel Krebs <github@daniel-krebs.net>
# @copyright 2018, RWTH Institute for Automation of Complex Power Systems (ACS)
# @license GNU General Public License (version 3)
#
# VILLASfpga
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
##############################################################################

23
set(SOURCES
24
	vlnv.cpp
25
	card.cpp
26 27
	ip.cpp
	ip_node.cpp
28

29 30 31 32 33
	ips/timer.cpp
	ips/switch.cpp
	ips/fifo.cpp
	ips/intc.cpp
	ips/pcie.cpp
34
	ips/dma.cpp
35
	ips/bram.cpp
36
	ips/rtds.cpp
37

Daniel Krebs's avatar
Daniel Krebs committed
38 39
	ips/rtds2gpu/rtds2gpu.cpp
	ips/rtds2gpu/xrtds2gpu.c
40
	ips/rtds2gpu/gpu2rtds.cpp
41 42
)

43 44 45 46
# we don't have much influence on drivers generated by Xilinx, so ignore warnings
set_source_files_properties(ips/rtds2gpu/xrtds2gpu.c
	PROPERTIES COMPILE_FLAGS -Wno-int-to-pointer-cast)

47 48 49 50 51 52 53
include(FindPkgConfig)

pkg_check_modules(JANSSON jansson)
pkg_check_modules(XIL libxil)

find_package(Threads)

54
add_library(villas-fpga SHARED ${SOURCES})
55

56
target_link_libraries(villas-fpga PUBLIC villas-common)
57

58 59 60 61 62
target_compile_definitions(villas-fpga PRIVATE
	BUILDID=\"abc\"
	_GNU_SOURCE
)

63 64 65 66 67
target_include_directories(villas-fpga
	PUBLIC
		../include
		${XIL_INCLUDE_DIRS}
		${JANSSON_INCLUDE_DIRS}
68 69 70 71 72 73 74 75
)

target_link_libraries(villas-fpga PUBLIC
	${XIL_LIBRARIES}
	${JANSSON_LIBRARIES}
	${CMAKE_THREAD_LIBS_INIT}
	${CMAKE_DL_LIBS}
	m
76
	villas-common
77
)
78

79 80 81 82
if(CMAKE_CUDA_COMPILER)
	target_link_libraries(villas-fpga PUBLIC villas-gpu)
endif()

83 84 85 86 87 88 89 90 91 92 93
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)