2020-01-20 19:14:24 -06:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
2020-01-21 21:46:24 -06:00
|
|
|
project("libopenfpgashell")
|
2020-01-20 19:14:24 -06:00
|
|
|
|
2020-01-21 23:59:53 -06:00
|
|
|
# We need readline to compile
|
|
|
|
find_package(Readline REQUIRED)
|
|
|
|
|
|
|
|
file(GLOB_RECURSE EXEC_TEST_SHELL test/test_shell.cpp)
|
|
|
|
file(GLOB_RECURSE EXEC_TEST_CMD test/test_command_parser.cpp)
|
2020-01-20 19:14:24 -06:00
|
|
|
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
|
2020-01-21 23:59:53 -06:00
|
|
|
list(REMOVE_ITEM LIB_SOURCES ${EXEC_TEST_SHELL})
|
|
|
|
list(REMOVE_ITEM LIB_SOURCES ${EXEC_TEST_CMD})
|
2020-01-20 19:14:24 -06:00
|
|
|
|
|
|
|
#Create the library
|
2020-01-21 21:46:24 -06:00
|
|
|
add_library(libopenfpgashell STATIC
|
2020-01-20 19:14:24 -06:00
|
|
|
${LIB_HEADERS}
|
|
|
|
${LIB_SOURCES})
|
2020-01-21 21:46:24 -06:00
|
|
|
target_include_directories(libopenfpgashell PUBLIC ${LIB_INCLUDE_DIRS})
|
|
|
|
set_target_properties(libopenfpgashell PROPERTIES PREFIX "") #Avoid extra 'lib' prefix
|
2020-01-20 19:14:24 -06:00
|
|
|
|
|
|
|
#Specify link-time dependancies
|
2020-01-21 21:46:24 -06:00
|
|
|
target_link_libraries(libopenfpgashell
|
|
|
|
libopenfpgautil
|
2020-01-21 23:59:53 -06:00
|
|
|
libvtrutil
|
|
|
|
readline)
|
2020-01-20 19:14:24 -06:00
|
|
|
|
|
|
|
#Create the test executable
|
2020-01-21 23:59:53 -06:00
|
|
|
add_executable(test_shell ${EXEC_TEST_SHELL})
|
|
|
|
target_link_libraries(test_shell libopenfpgashell)
|
|
|
|
|
|
|
|
add_executable(test_command_parser ${EXEC_TEST_CMD})
|
2020-01-21 21:46:24 -06:00
|
|
|
target_link_libraries(test_command_parser libopenfpgashell)
|
2020-01-20 19:14:24 -06:00
|
|
|
|
|
|
|
#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)
|