aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-06-20 16:13:49 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-06-20 16:15:33 +0200
commit36c16cd28e20b362a6185ce52525c98fc187ecf3 (patch)
treecfe36d3ca54a3ab7a95fd472b485d224f65225e6 /CMakeLists.txt
parente14b8bac66bf9a65ddd709fba53aac017691f0c8 (diff)
downloadnextpnr-36c16cd28e20b362a6185ce52525c98fc187ecf3.tar.gz
nextpnr-36c16cd28e20b362a6185ce52525c98fc187ecf3.tar.bz2
nextpnr-36c16cd28e20b362a6185ce52525c98fc187ecf3.zip
Cleanup of cmake files for easier development
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt14
1 files changed, 10 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f2cce58..be2edb62 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,10 @@ find_package(PythonLibs 3.5 REQUIRED)
find_package(Boost REQUIRED COMPONENTS ${boost_libs})
+# Find the Qt5 libraries
+find_package(Qt5 COMPONENTS Core Widgets OpenGL REQUIRED)
+find_package(OpenGL REQUIRED)
+
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
@@ -74,7 +78,6 @@ endif ()
if (NOT Boost_PYTHON_FOUND )
message( FATAL_ERROR "No version of Boost::Python 3.x could be found.")
endif ()
-include(gui/gui.cmake)
include_directories(common/ gui/ frontend/json ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} 3rdparty/QtPropertyBrowser/src)
aux_source_directory(common/ COMMON_SRC_FILES)
@@ -90,8 +93,11 @@ foreach (family ${FAMILIES})
string(TOUPPER ${family} ufamily)
aux_source_directory(${family}/ ${ufamily}_FILES)
aux_source_directory(tests/${family}/ ${ufamily}_TEST_FILES)
+
+ add_subdirectory(gui generated/gui/${family})
+
# Add the CLI binary target
- add_executable(nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES} ${GUI_SOURCE_FILES})
+ add_executable(nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES} )
install(TARGETS nextpnr-${family} RUNTIME DESTINATION bin)
target_compile_definitions(nextpnr-${family} PRIVATE MAIN_EXECUTABLE)
@@ -109,9 +115,9 @@ foreach (family ${FAMILIES})
include(${family}/family.cmake)
foreach (target ${family_targets})
# Include family-specific source files to all family targets and set defines appropriately
- target_include_directories(${target} PRIVATE ${family}/)
+ target_include_directories(${target} PRIVATE ${family}/ generated/)
target_compile_definitions(${target} PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family} ARCH_${ufamily} ARCHNAME=${family} QT_NO_KEYWORDS)
- target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${GUI_LIBRARY_FILES})
+ target_link_libraries(${target} LINK_PUBLIC gui_${family} ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${GUI_LIBRARY_FILES_${ufamily}})
endforeach (target)
endforeach (family)