2020-01-22 21:20:10 -06:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
|
|
|
project("libopenfpga")
|
|
|
|
|
|
|
|
file(GLOB_RECURSE EXEC_SOURCE src/main.cpp)
|
|
|
|
file(GLOB_RECURSE LIB_SOURCES src/*/*.cpp)
|
|
|
|
file(GLOB_RECURSE LIB_HEADERS src/*/*.h)
|
|
|
|
files_to_dirs(LIB_HEADERS LIB_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
#Remove test executable from library
|
|
|
|
list(REMOVE_ITEM LIB_SOURCES ${EXEC_SOURCE})
|
|
|
|
|
|
|
|
#Create the library
|
|
|
|
add_library(libopenfpga STATIC
|
|
|
|
${LIB_HEADERS}
|
|
|
|
${LIB_SOURCES})
|
|
|
|
target_include_directories(libopenfpga PUBLIC ${LIB_INCLUDE_DIRS})
|
|
|
|
set_target_properties(libopenfpga PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
|
|
|
|
|
|
|
|
#Specify link-time dependancies
|
|
|
|
target_link_libraries(libopenfpga
|
|
|
|
libarchopenfpga
|
|
|
|
libopenfpgashell
|
|
|
|
libopenfpgautil
|
2020-06-12 11:41:34 -05:00
|
|
|
libfabrickey
|
2020-06-20 19:25:17 -05:00
|
|
|
libfpgabitstream
|
2020-02-27 19:01:47 -06:00
|
|
|
libini
|
2021-01-19 17:56:30 -06:00
|
|
|
libpcf
|
2020-01-22 21:20:10 -06:00
|
|
|
libvtrutil
|
2022-02-17 19:28:55 -06:00
|
|
|
libbusgroup
|
2022-07-28 12:30:43 -05:00
|
|
|
libvpr)
|
2020-01-22 21:20:10 -06:00
|
|
|
|
|
|
|
#Create the test executable
|
|
|
|
add_executable(openfpga ${EXEC_SOURCE})
|
|
|
|
target_link_libraries(openfpga libopenfpga)
|
|
|
|
|
|
|
|
#Supress IPO link warnings if IPO is enabled
|
|
|
|
get_target_property(OPENFPGA_USES_IPO openfpga INTERPROCEDURAL_OPTIMIZATION)
|
|
|
|
if (OPENFPGS_USES_IPO)
|
|
|
|
set_target_properties(openfpga PROPERTIES LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
install(TARGETS libopenfpga openfpga DESTINATION bin)
|