aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-06-29 10:47:12 -0700
committerrtk0c <[email protected]>2022-06-29 10:47:12 -0700
commit2cf952088d375ac8b2f45b144462af0953436cff (patch)
treed437c348cff8fa79729b8bd3367f3e7c25cd0f32
parentfad6a88a13ab1f888ab25ad0aae19c1d63aa0623 (diff)
Convert CMake to use include directory inheritance through library targets
-rw-r--r--3rdparty/iconfontheaders/CMakeLists.txt5
-rw-r--r--3rdparty/imgui-node-editor/CMakeLists.txt11
-rw-r--r--3rdparty/imgui/CMakeLists.txt5
-rw-r--r--3rdparty/implot/CMakeLists.txt11
-rw-r--r--CMakeLists.txt3
-rw-r--r--core/CMakeLists.txt10
6 files changed, 29 insertions, 16 deletions
diff --git a/3rdparty/iconfontheaders/CMakeLists.txt b/3rdparty/iconfontheaders/CMakeLists.txt
new file mode 100644
index 0000000..cd7535f
--- /dev/null
+++ b/3rdparty/iconfontheaders/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_library(icon-font-headers INTERFACE)
+target_include_directories(icon-font-headers
+INTERFACE
+ ${CMAKE_CURRENT_LIST_DIR}
+)
diff --git a/3rdparty/imgui-node-editor/CMakeLists.txt b/3rdparty/imgui-node-editor/CMakeLists.txt
index 614b7e9..83f2915 100644
--- a/3rdparty/imgui-node-editor/CMakeLists.txt
+++ b/3rdparty/imgui-node-editor/CMakeLists.txt
@@ -1,10 +1,13 @@
file(GLOB IMGUI_NODE_EDITOR_SOURCES *.cpp)
add_library(imgui-node-editor ${IMGUI_NODE_EDITOR_SOURCES})
-set_target_properties(imgui-node-editor PROPERTIES UNITY_BUILD OFF)
-target_include_directories(imgui-node-editor PRIVATE
- ${CMAKE_SOURCE_DIR}/3rdparty/imgui-node-editor
- ${CMAKE_SOURCE_DIR}/3rdparty/imgui
+target_link_libraries(imgui-node-editor
+PUBLIC
+ imgui
+)
+target_include_directories(imgui-node-editor
+PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}
)
set_target_properties(imgui-node-editor
diff --git a/3rdparty/imgui/CMakeLists.txt b/3rdparty/imgui/CMakeLists.txt
index c0910d3..4bdfe9c 100644
--- a/3rdparty/imgui/CMakeLists.txt
+++ b/3rdparty/imgui/CMakeLists.txt
@@ -5,10 +5,9 @@ file(GLOB IMGUI_SOURCES *.cpp)
# the build flags twice both in here and in core/CMakeLists.txt
add_library(imgui ${IMGUI_SOURCES} ../../core/src/Model/Template/TableTemplateIterator.hpp)
-set_target_properties(imgui PROPERTIES UNITY_BUILD OFF)
target_include_directories(imgui
-PRIVATE
- ${CMAKE_SOURCE_DIR}/3rdparty/imgui
+PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}
)
set_target_properties(imgui
diff --git a/3rdparty/implot/CMakeLists.txt b/3rdparty/implot/CMakeLists.txt
index ee02f6a..ab6b3aa 100644
--- a/3rdparty/implot/CMakeLists.txt
+++ b/3rdparty/implot/CMakeLists.txt
@@ -1,10 +1,13 @@
file(GLOB IMPLOT_SOURCES *.cpp)
add_library(implot ${IMPLOT_SOURCES})
-set_target_properties(implot PROPERTIES UNITY_BUILD OFF)
-target_include_directories(implot PRIVATE
- ${CMAKE_SOURCE_DIR}/3rdparty/implot
- ${CMAKE_SOURCE_DIR}/3rdparty/imgui
+target_link_libraries(implot
+PUBLIC
+ imgui
+)
+target_include_directories(implot
+PUBLIC
+ ${CMAKE_CURRENT_LIST_DIR}
)
set_target_properties(implot
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a05b14..da50547 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,5 @@
cmake_minimum_required(VERSION 3.18)
project(Cplt LANGUAGES CXX)
-set(CMAKE_CXX_STANDARD 20)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." ON)
if(FORCE_COLORED_OUTPUT)
@@ -17,6 +15,7 @@ set(LINUX ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
+add_subdirectory(3rdparty/iconfontheaders)
add_subdirectory(3rdparty/imgui)
add_subdirectory(3rdparty/implot)
add_subdirectory(3rdparty/imgui-node-editor)
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index f17335a..337ed63 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -38,6 +38,12 @@ file(GLOB_RECURSE CPLT_CORE_SOURCES_NORMAL
)
add_executable(CpltCore ${CPLT_CORE_SOURCES_SPECIAL} ${CPLT_CORE_SOURCES_NORMAL})
+set_target_properties(CpltCore
+PROPERTIES
+ CXX_STANDARD 20
+ CXX_STANDARD_REQUIRED ON
+ CXX_EXTENSIONS OFF
+)
set(CPLT_CORE_SOURCES_NORMAL_UNITY_EXCLUDED
src/Entrypoint/main.cpp
@@ -65,13 +71,11 @@ PROPERTIES
target_include_directories(CpltCore PRIVATE
${CMAKE_CURRENT_LIST_DIR}/src
- ${CMAKE_SOURCE_DIR}/3rdparty/iconfontheaders
- ${CMAKE_SOURCE_DIR}/3rdparty/imgui
- ${CMAKE_SOURCE_DIR}/3rdparty/imgui-node-editor
)
target_link_libraries(CpltCore
PRIVATE
${CONAN_LIBS}
+ icon-font-headers
imgui
implot
imgui-node-editor