summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-24 12:17:41 -0400
committerbd <bdunahu@operationnull.com>2025-03-24 12:17:41 -0400
commit895b5ddd6fe4db906720ecbf0de0cab5acdb35ec (patch)
tree8d2d9df8054214d4c019ace03e33f74e6ba571d0 /CMakeLists.txt
parente05f5306f50029b0f5f471b70cfe45749d0d21f6 (diff)
Added gui folder with its own CMake to house GUI+main.cc
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt49
1 files changed, 18 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4be3ee..9daac12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,58 +1,45 @@
cmake_minimum_required(VERSION 3.5)
+set(CMAKE_CXX_COMPILER "g++")
project(risc_vector)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-set(CMAKE_AUTOUIC ON) # automatically process .ui files into headers
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-add_compile_options(-Wall -lstdc++)
+add_compile_options(-Wall -lstdc++ -g -O0)
add_compile_options(-Wextra -Wpedantic)
# cpp standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_COMPILER "g++")
-
# header files
include_directories(
${PROJECT_SOURCE_DIR}/inc
)
+# add gui
+add_subdirectory(gui)
+
# gather source files
file(GLOB_RECURSE SRCS "src/*.cc")
-list(REMOVE_ITEM SRCS "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cc")
# find QT components
find_package(Qt6 COMPONENTS Widgets REQUIRED)
+qt_standard_project_setup()
# binary executable
-add_executable(${PROJECT_NAME} ${SRCS})
-qt_add_resources(GUI_RESOURCES "src/gui/resources.qrc")
-target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets)
-
-# find_package(Catch2 REQUIRED)
-
-# #gather test files
-# file(GLOB_RECURSE TESTS "tests/*.cc")
-
-# # test executable
-# add_executable(tests ${SRCS} ${TESTS})
-# target_link_libraries(tests PRIVATE Catch2::Catch2WithMain PRIVATE Qt6::Widgets)
-
-# # test discovery
-# include(CTest)
-# include(Catch)
-# catch_discover_tests(tests)
+add_library(${PROJECT_NAME}_lib ${SRCS})
+target_link_libraries(${PROJECT_NAME}_lib)
+find_package(Catch2 REQUIRED)
-# # Gather GUI Source Files
-# file(GLOB_RECURSE GUI_SRCS "src/gui/*.cc")
+#gather test files
+file(GLOB_RECURSE TESTS "tests/*.cc")
-# # Gather GUI Resources
-# qt_add_resources(GUI_RESOURCES "src/gui/resources.qrc")
+# test executable
+add_executable(tests ${SRCS} ${TESTS})
+target_link_libraries(tests PRIVATE Catch2::Catch2WithMain PRIVATE)
-# # GUI executable
-# qt_add_executable("${PROJECT_NAME}_gui" ${GUI_SRCS} ${SRCS} ${GUI_RESOURCES})
-# target_link_libraries("${PROJECT_NAME}_gui" PRIVATE Qt6::Widgets)
+# test discovery
+include(CTest)
+include(Catch)
+catch_discover_tests(tests)