summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--3rdparty/imgui-node-editor/CMakeLists.txt5
-rw-r--r--3rdparty/imgui/CMakeLists.txt5
-rw-r--r--3rdparty/implot/CMakeLists.txt5
-rw-r--r--3rdparty/sqlitecpp/CMakeLists.txt8
-rw-r--r--core/CMakeLists.txt126
5 files changed, 60 insertions, 89 deletions
diff --git a/3rdparty/imgui-node-editor/CMakeLists.txt b/3rdparty/imgui-node-editor/CMakeLists.txt
index 47199dc..614b7e9 100644
--- a/3rdparty/imgui-node-editor/CMakeLists.txt
+++ b/3rdparty/imgui-node-editor/CMakeLists.txt
@@ -6,3 +6,8 @@ target_include_directories(imgui-node-editor PRIVATE
${CMAKE_SOURCE_DIR}/3rdparty/imgui-node-editor
${CMAKE_SOURCE_DIR}/3rdparty/imgui
)
+
+set_target_properties(imgui-node-editor
+PROPERTIES
+ UNITY_BUILD OFF
+)
diff --git a/3rdparty/imgui/CMakeLists.txt b/3rdparty/imgui/CMakeLists.txt
index 3f55c75..c0910d3 100644
--- a/3rdparty/imgui/CMakeLists.txt
+++ b/3rdparty/imgui/CMakeLists.txt
@@ -10,3 +10,8 @@ target_include_directories(imgui
PRIVATE
${CMAKE_SOURCE_DIR}/3rdparty/imgui
)
+
+set_target_properties(imgui
+PROPERTIES
+ UNITY_BUILD OFF
+)
diff --git a/3rdparty/implot/CMakeLists.txt b/3rdparty/implot/CMakeLists.txt
index 4fae8f2..ee02f6a 100644
--- a/3rdparty/implot/CMakeLists.txt
+++ b/3rdparty/implot/CMakeLists.txt
@@ -6,3 +6,8 @@ target_include_directories(implot PRIVATE
${CMAKE_SOURCE_DIR}/3rdparty/implot
${CMAKE_SOURCE_DIR}/3rdparty/imgui
)
+
+set_target_properties(implot
+PROPERTIES
+ UNITY_BUILD OFF
+)
diff --git a/3rdparty/sqlitecpp/CMakeLists.txt b/3rdparty/sqlitecpp/CMakeLists.txt
index 1ba64db..0944519 100644
--- a/3rdparty/sqlitecpp/CMakeLists.txt
+++ b/3rdparty/sqlitecpp/CMakeLists.txt
@@ -2,9 +2,13 @@ file(GLOB_RECURSE SQLiteCpp_SOURCE ${CMAKE_CURRENT_LIST_DIR}/source/*.cpp)
add_library(SQLiteCpp ${SQLiteCpp_SOURCE})
target_include_directories(SQLiteCpp
PUBLIC
- ${CMAKE_CURRENT_LIST_DIR}/source
+ ${CMAKE_CURRENT_LIST_DIR}/source
)
target_link_libraries(SQLiteCpp
PRIVATE
- sqlite3 # This comes from conan
+ sqlite3 # This comes from conan
+)
+set_target_properties(SQLiteCpp
+PROPERTIES
+ UNITY_BUILD OFF
)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index ff2adff..f17335a 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -1,6 +1,3 @@
-# We use a custom flag instead of letting user set CMAKE_UNITY_BUILD because we don't want stuff in 3rdparty to be built with unity build
-# (they may not support them, and configuring each is very time consuming)
-option(BUILD_CORE_WITH_UNITY_BUILD OFF)
option(BUILD_CORE_TESTS "Whether to make executable tests or not." OFF)
set(TARGET_LOCALE "en_US" CACHE STRING "Locale to build.")
@@ -15,102 +12,57 @@ elseif(APPLE)
option(BUILD_CORE_WITH_METAL_BACKEND ON)
endif()
-macro(add_source_group GROUP_NAME)
- list(APPEND CPLT_CORE_SOURCES ${ARGN})
- set_source_files_properties(${ARGN}
- PROPERTIES
- UNITY_GROUP "${GROUP_NAME}"
- )
-endmacro()
-
-list(APPEND CPLT_CORE_SOURCES # Entrypoint
- src/Entrypoint/main.cpp
- src/Entrypoint/Backend_OpenGL2.cpp
- src/Entrypoint/Backend_OpenGL3.cpp
- src/Entrypoint/Backend_Vulkan.cpp
- src/Entrypoint/Backend_DirectX11.cpp
- src/Entrypoint/Backend_DirectX12.cpp
- src/Entrypoint/Backend_Metal.mm
-)
-
-add_source_group(Model
- src/Model/Assets.cpp
- src/Model/Database.cpp
- src/Model/Filter.cpp
- src/Model/GlobalStates.cpp
- src/Model/Items.cpp
- src/Model/Project.cpp
-)
-
-add_source_group(Model.Template
- src/Model/Template/Template_Main.cpp
- src/Model/Template/Template_RTTI.cpp
- src/Model/Template/TableTemplate.cpp
- src/Model/Template/TableTemplateIterator.cpp
-)
-
-add_source_group(Model.Workflow
- src/Model/Workflow/Evaluation.cpp
- src/Model/Workflow/Value_Main.cpp
- src/Model/Workflow/Value_RTTI.cpp
- src/Model/Workflow/Workflow_Main.cpp
- src/Model/Workflow/Workflow_RTTI.cpp
-)
-
-add_source_group(Model.Workflow.Nodes
- src/Model/Workflow/Nodes/DocumentNodes.cpp
- src/Model/Workflow/Nodes/UserInputNodes.cpp
- src/Model/Workflow/Nodes/NumericNodes.cpp
- src/Model/Workflow/Nodes/TextNodes.cpp
-)
-
-add_source_group(Model.Workflow.Value
- src/Model/Workflow/Values/Basic.cpp
- src/Model/Workflow/Values/Database.cpp
- src/Model/Workflow/Values/Dictionary.cpp
- src/Model/Workflow/Values/List.cpp
-)
-
-list(APPEND CPLT_CORE_SOURCES # UI
- src/UI/UI_DatabaseView.cpp
- src/UI/UI_Items.cpp
- src/UI/UI_MainWindow.cpp
- src/UI/UI_Settings.cpp
- src/UI/UI_Templates.cpp
- src/UI/UI_Utils.cpp
- src/UI/UI_Workflows.cpp
-)
-
-add_source_group(Utils
- src/Utils/IO/Archive.cpp
- src/Utils/IO/CstdioFile.cpp
- src/Utils/IO/DataStream.cpp
- src/Utils/Sigslot.cpp
- src/Utils/StandardDirectories.cpp
- src/Utils/Time.cpp
-)
-
-list(APPEND CPLT_CORE_SOURCES
- src/Utils/IO/FileStream.cpp
-)
-
message("CpltCore: generating executable CpltCore")
if(BUILD_CORE_WITH_OPENGL2_BACKEND OR
BUILD_CORE_WITH_OPENGL3_BACKEND OR
BUILD_CORE_WITH_VULKAN_BACKEND OR
BUILD_CORE_WITH_METAL_BACKEND)
- list(APPEND CPLT_CORE_SOURCES
+ list(APPEND CPLT_CORE_SOURCES_SPECIAL
${CMAKE_SOURCE_DIR}/3rdparty/imgui/backend/imgui_impl_glfw.cpp
- )
+)
endif()
if(BUILD_CORE_WITH_DX11_BACKEND OR BUILD_CORE_WITH_DX12_BACKEND)
- list(APPEND CPLT_CORE_SOURCES
+ list(APPEND CPLT_CORE_SOURCES_SPECIAL
${CMAKE_SOURCE_DIR}/3rdparty/imgui/backend/imgui_impl_win32.cpp
)
endif()
-add_executable(CpltCore ${CPLT_CORE_SOURCES})
+file(GLOB_RECURSE CPLT_CORE_SOURCES_NORMAL
+ ${CMAKE_CURRENT_LIST_DIR}/src/*.h
+ ${CMAKE_CURRENT_LIST_DIR}/src/*.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/*.m
+ ${CMAKE_CURRENT_LIST_DIR}/src/*.hpp
+ ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp
+ ${CMAKE_CURRENT_LIST_DIR}/src/*.mm
+)
+
+add_executable(CpltCore ${CPLT_CORE_SOURCES_SPECIAL} ${CPLT_CORE_SOURCES_NORMAL})
+
+set(CPLT_CORE_SOURCES_NORMAL_UNITY_EXCLUDED
+ src/Entrypoint/main.cpp
+ src/Entrypoint/Backend_OpenGL2.cpp
+ src/Entrypoint/Backend_OpenGL3.cpp
+ src/Entrypoint/Backend_Vulkan.cpp
+ src/Entrypoint/Backend_DirectX11.cpp
+ src/Entrypoint/Backend_DirectX12.cpp
+ src/Entrypoint/Backend_Metal.mm
+ src/UI/UI_DatabaseView.cpp
+ src/UI/UI_Items.cpp
+ src/UI/UI_MainWindow.cpp
+ src/UI/UI_Settings.cpp
+ src/UI/UI_Templates.cpp
+ src/UI/UI_Utils.cpp
+ src/UI/UI_Workflows.cpp
+ src/Utils/IO/FileStream.cpp
+)
+set_source_files_properties(
+ ${CPLT_CORE_SOURCES_SPECIAL}
+ ${CPLT_CORE_SOURCES_NORMAL_UNITY_EXCLUDED}
+PROPERTIES
+ SKIP_UNITY_BUILD_INCLUSION ON
+)
+
target_include_directories(CpltCore PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_SOURCE_DIR}/3rdparty/iconfontheaders
@@ -220,7 +172,7 @@ endif()
if(CMAKE_UNITY_BUILD)
message("CpltCore: - using unity build")
set_target_properties(CpltCore PROPERTIES
- UNITY_BUILD_MODE GROUP
+ UNITY_BUILD_MODE BATCH
UNITY_BUILD_UNIQUE_ID "CPLT_UNITY_ID"
)
else()