From 0686d6010719d7aca3dc488e1966b910581bbebe Mon Sep 17 00:00:00 2001 From: Lukas Wagner Date: Tue, 5 Jun 2018 23:37:03 +0200 Subject: [PATCH] refs #24: added bounding box files, create source tree in VS for better overview --- CMakeLists.txt | 15 ++++++++++++++- src/helpers/boundingbox.cpp | 0 src/helpers/boundingbox.hpp | 0 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/helpers/boundingbox.cpp create mode 100644 src/helpers/boundingbox.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ed69b6..c9f4f84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,13 +40,14 @@ set_target_properties(JCVoronoi PROPERTIES LINKER_LANGUAGE CXX) set(source_dir src) set(sources - ${source_dir}/main.cpp + ${source_dir}/main.cpp ${source_dir}/mosaic.cpp ${source_dir}/algorithms/floyd-steinberg.cpp ${source_dir}/algorithms/voronoi.cpp ${source_dir}/mollusc.cpp ${source_dir}/mainwindow.cpp ${source_dir}/Webcam.cpp + ${source_dir}/helpers/boundingbox.cpp ) set(headers @@ -56,7 +57,19 @@ set(headers ${source_dir}/mollusc.hpp ${source_dir}/mainwindow.hpp ${source_dir}/Webcam.hpp + ${source_dir}/helpers/boundingbox.hpp ) add_executable(${target} ${sources} ${headers}) target_link_libraries(${target} Qt5::Widgets Qt5::Multimedia) + +if (NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0") + option(VS_FILE_TREE_SPLIT_HEADER_AND_SOURCE "In the Visual Studio file list, headers and sources are normally split into two folders. Disable this to merge them." ON) + + if(${VS_FILE_TREE_SPLIT_HEADER_AND_SOURCE}) + source_group(TREE ${CMAKE_SOURCE_DIR}/${source_dir} PREFIX "Source Files" FILES ${sources}) + source_group(TREE ${CMAKE_SOURCE_DIR}/${source_dir} PREFIX "Header Files" FILES ${headers}) + else() + source_group(TREE ${CMAKE_SOURCE_DIR}/${source_dir} PREFIX "Source Files" FILES ${sources} ${headers}) + endif() +endif() diff --git a/src/helpers/boundingbox.cpp b/src/helpers/boundingbox.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/helpers/boundingbox.hpp b/src/helpers/boundingbox.hpp new file mode 100644 index 0000000..e69de29