@@ -180,6 +180,8 @@ option(WITH_JAVA "libjpeg-turbo" OFF)
180180set (CMAKE_INSTALL_DOCDIR "${CMAKE_CURRENT_BINARY_DIR} /libjpeg-turbo/install/docdir" )
181181set (CMAKE_INSTALL_MANDIR "${CMAKE_CURRENT_BINARY_DIR} /libjpeg-turbo/install/mandir" )
182182add_subdirectory (libjpeg-turbo libjpeg-turbo EXCLUDE_FROM_ALL )
183+ NBL_TARGET_FORCE_ASSEMBLER_EXECUTABLE (simd ASM_NASM libjpeg-turbo/simd/ )
184+
183185unset (CMAKE_INSTALL_DOCDIR)
184186unset (CMAKE_INSTALL_MANDIR)
185187
@@ -233,9 +235,6 @@ if(_NBL_COMPILE_WITH_OPEN_EXR_)
233235 set (BUILD_TESTING ${_OLD_BUILD_TESTING} )
234236endif ()
235237
236-
237-
238-
239238#gli
240239option (_NBL_COMPILE_WITH_GLI_ "Build with GLI library" ON )
241240if (_NBL_COMPILE_WITH_GLI_)
@@ -289,54 +288,113 @@ add_library(spirv_cross OBJECT
289288target_compile_definitions (spirv_cross PUBLIC SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS )
290289
291290# cmake-git-version-tracking
291+ # note that checking if a repository is dirty may cost build time (especially a lot if like us you have a lot of submodules) - by default we run with all checks but if you want to increase build time iterations I recommend to exclude this check
292+ option (GIT_EXCLUDE_IS_DIRTY "Exclude IS_DIRTY from git tracking checks, will increase build time iterations at the expense of the meta information loss" OFF )
292293add_subdirectory (git-version-tracking EXCLUDE_FROM_ALL )
293294NBL_ADD_GIT_TRACKING_META_LIBRARY (nabla "${NBL_ROOT_PATH} " )
294295NBL_ADD_GIT_TRACKING_META_LIBRARY (dxc "${CMAKE_CURRENT_SOURCE_DIR} /dxc/dxc" )
295296NBL_GENERATE_GIT_TRACKING_META ()
296297
297298if (NBL_BUILD_IMGUI)
299+ set (NBL_IMGUI_ROOT "${CMAKE_CURRENT_SOURCE_DIR} /imgui" )
300+ set (NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT "${THIRD_PARTY_SOURCE_DIR} /imgui_test_engine" )
301+ set (NBL_IMGUI_TEST_ENGINE_ROOT "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT} /imgui_test_engine" )
302+ set (NBL_IMGUI_TEST_SUITE_ROOT "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT} /imgui_test_suite" )
303+ set (NBL_IMPLOT_ROOT "${NBL_IMGUI_TEST_SUITE_ROOT} /thirdparty/implot" )
304+
298305 add_library (imgui STATIC
299- "imgui/imconfig.h"
300- "imgui/imgui_demo.cpp"
301- "imgui/imgui_draw.cpp"
302- "imgui/imgui_internal.h"
303- "imgui/imgui_tables.cpp"
304- "imgui/imgui_widgets.cpp"
305- "imgui/imgui.cpp"
306- "imgui/imgui.h"
307- "imgui/misc/cpp/imgui_stdlib.cpp"
308- "imgui/misc/cpp/imgui_stdlib.h"
309- "imgui/imstb_rectpack.h"
310- "imgui/imstb_textedit.h"
311- "imgui/imstb_truetype.h"
306+ "${NBL_IMGUI_ROOT} /imconfig.h"
307+ "${NBL_IMGUI_ROOT} /imgui_demo.cpp"
308+ "${NBL_IMGUI_ROOT} /imgui_draw.cpp"
309+ "${NBL_IMGUI_ROOT} /imgui_internal.h"
310+ "${NBL_IMGUI_ROOT} /imgui_tables.cpp"
311+ "${NBL_IMGUI_ROOT} /imgui_widgets.cpp"
312+ "${NBL_IMGUI_ROOT} /imgui.cpp"
313+ "${NBL_IMGUI_ROOT} /misc/freetype/imgui_freetype.cpp"
314+ "${NBL_IMGUI_ROOT} /imgui.h"
315+ "${NBL_IMGUI_ROOT} /misc/cpp/imgui_stdlib.cpp"
316+ "${NBL_IMGUI_ROOT} /misc/cpp/imgui_stdlib.h"
317+ "${NBL_IMGUI_ROOT} /imstb_rectpack.h"
318+ "${NBL_IMGUI_ROOT} /imstb_textedit.h"
319+ "${NBL_IMGUI_ROOT} /imstb_truetype.h"
312320 )
313- target_include_directories (imgui
314- PUBLIC "imgui"
315- PUBLIC "imgui/misc/cpp"
316- PUBLIC "imgui/backends"
321+
322+ target_link_libraries (imgui PUBLIC freetype )
323+
324+ target_include_directories (imgui PUBLIC
325+ "${NBL_IMGUI_ROOT} "
326+ "${NBL_IMGUI_ROOT} /misc/cpp"
327+ "${NBL_IMGUI_ROOT} /backends"
328+ "${NBL_IMGUI_TEST_SUITE_ROOT} "
329+ $<TARGET_PROPERTY :freetype ,INCLUDE_DIRECTORIES >
317330 )
318331
319- # ImPlot
320332 add_library (implot STATIC
321- "implot/implot.h"
322- "implot/implot_internal.h"
323- "implot/implot.cpp"
324- "implot/implot_items.cpp"
333+ "${NBL_IMPLOT_ROOT} /implot.h"
334+ "${NBL_IMPLOT_ROOT} /implot_internal.h"
335+ "${NBL_IMPLOT_ROOT} /implot.cpp"
336+ "${NBL_IMPLOT_ROOT} /implot_items.cpp"
337+ "${NBL_IMPLOT_ROOT} /implot_demo.cpp"
325338 )
339+
326340 target_include_directories (implot
327- PUBLIC "imgui"
341+ PUBLIC $<TARGET_PROPERTY :imgui ,INCLUDE_DIRECTORIES >
342+ PUBLIC "${NBL_IMPLOT_ROOT} "
328343 )
344+
329345 target_link_libraries (implot PUBLIC imgui )
330346 target_compile_definitions (implot PUBLIC IMPLOT_DEBUG IMPLOT_DLL_EXPORT )
331- set_property (TARGET implot PROPERTY CXX_STANDARD 11 )
347+ set_target_properties (implot PROPERTIES CXX_STANDARD 20 )
348+
332349 if (MSVC )
333350 target_compile_options (implot PRIVATE /MT /W4 /WX /arch:AVX2 /fp:fast /permissive- )
334351 else ()
335352 target_compile_options (implot PRIVATE -Wall -Wextra -pedantic -Werror -mavx2 -Ofast )
336353 endif ()
354+
355+ file (GLOB_RECURSE NBL_TEST_SUITE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_SUITE_ROOT} /imgui_test*.cpp" )
356+ file (GLOB_RECURSE NBL_TEST_SUITE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_SUITE_ROOT} /imgui_test*.cpp" )
357+
358+ add_library (imtestsuite STATIC
359+ ${NBL_TEST_SUITE_SOURCES}
360+ )
361+
362+ target_include_directories (imtestsuite PUBLIC
363+ "${NBL_IMGUI_TEST_ENGINE_PROJECT_ROOT} "
364+ "${NBL_IMGUI_TEST_ENGINE_ROOT} "
365+ "${NBL_IMGUI_TEST_SUITE_ROOT} "
366+ $<TARGET_PROPERTY :imgui ,INCLUDE_DIRECTORIES >
367+ $<TARGET_PROPERTY :implot ,INCLUDE_DIRECTORIES >
368+ )
369+
370+ set_target_properties (imtestsuite PROPERTIES CXX_STANDARD 14 ) # NOTE! THOSE TESTS DO NOT COMPILE WITH HIGHER STANDARDS SO WE WRAP SOURCES INTO LIBRARY COMPILED WITH LOWER ONE
371+ target_link_libraries (imtestsuite PUBLIC implot )
372+
373+ file (GLOB_RECURSE NBL_TEST_ENGINE_SOURCES CONFIGURE_DEPENDS "${NBL_IMGUI_TEST_ENGINE_ROOT} /*.cpp" )
374+
375+ add_library (imtestengine STATIC
376+ ${NBL_TEST_ENGINE_SOURCES}
377+ )
378+
379+ target_include_directories (imtestengine PUBLIC
380+ $<TARGET_PROPERTY :imtestsuite ,INCLUDE_DIRECTORIES >
381+ )
382+
383+ target_link_libraries (imtestengine PUBLIC imtestsuite )
337384
338385 set (IMGUIZMO_BUILD_EXAMPLE OFF )
339386 add_subdirectory (imguizmo EXCLUDE_FROM_ALL )
387+
388+ # note we override imgui config with our own
389+ set (NBL_IMGUI_USER_CONFIG_FILEPATH "${NBL_IMGUI_ROOT} /nabla_imconfig.h" )
390+
391+ if (NOT EXISTS "${NBL_IMGUI_USER_CONFIG_FILEPATH} " )
392+ message (FATAL_ERROR "\" ${NBL_IMGUI_USER_CONFIG_FILEPATH} \" doesn't exist!" )
393+ endif ()
394+
395+ target_compile_definitions (imgui PUBLIC
396+ IMGUI_USER_CONFIG= "${NBL_IMGUI_USER_CONFIG_FILEPATH} "
397+ )
340398endif ()
341399
342400add_library (aesGladman OBJECT
@@ -427,7 +485,7 @@ if (NBL_BUILD_MITSUBA_LOADER)
427485 list (APPEND NBL_3RDPARTY_TARGETS expat)
428486endif ()
429487if (NBL_BUILD_IMGUI)
430- list (APPEND NBL_3RDPARTY_TARGETS imgui implot imguizmo)
488+ list (APPEND NBL_3RDPARTY_TARGETS imgui implot imtestsuite imtestengine imguizmo)
431489endif ()
432490if (ENABLE_HLSL)
433491 list (APPEND NBL_3RDPARTY_TARGETS HLSL)
0 commit comments