From 5dea648be6afffcce447f536d1bbd6ed9fd9b522 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Sun, 12 Jan 2020 18:15:36 -0700 Subject: [PATCH] add missing CMakeList for libarchopenfpga --- libopenfpga/libarchopenfpga/CMakeLists.txt | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libopenfpga/libarchopenfpga/CMakeLists.txt diff --git a/libopenfpga/libarchopenfpga/CMakeLists.txt b/libopenfpga/libarchopenfpga/CMakeLists.txt new file mode 100644 index 000000000..ac392b2c0 --- /dev/null +++ b/libopenfpga/libarchopenfpga/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.9) + +project("libarchopenfpga") + +file(GLOB_RECURSE EXEC_SOURCES test/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_SOURCES}) + +#Create the library +add_library(libarchopenfpga STATIC + ${LIB_HEADERS} + ${LIB_SOURCES}) +target_include_directories(libarchopenfpga PUBLIC ${LIB_INCLUDE_DIRS}) +set_target_properties(libarchopenfpga PROPERTIES PREFIX "") #Avoid extra 'lib' prefix + +#Specify link-time dependancies +target_link_libraries(libarchopenfpga + libvtrutil + libpugixml + libpugiutil) + +#Create the test executable +add_executable(read_arch_openfpga ${EXEC_SOURCES}) +target_link_libraries(read_arch_openfpga libarchopenfpga) + +#Supress IPO link warnings if IPO is enabled +get_target_property(READ_ARCH_USES_IPO read_arch_openfpga INTERPROCEDURAL_OPTIMIZATION) +if (READ_ARCH_USES_IPO) + set_target_properties(read_arch_openfpga PROPERTIES LINK_FLAGS ${IPO_LINK_WARN_SUPRESS_FLAGS}) +endif() + +install(TARGETS libarchopenfpga read_arch_openfpga DESTINATION bin)