cmake_minimum_required(VERSION 3.13) project(ProjectBrussel LANGUAGES C CXX) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() include(buildtools/cmake/RTTI.cmake) find_package(OpenGL REQUIRED) add_subdirectory(3rdparty/glfw) add_subdirectory(3rdparty/glm) add_subdirectory(3rdparty/imgui) add_subdirectory(3rdparty/imguicolortextedit) add_subdirectory(3rdparty/tracy) # ============================================================================== file(GLOB_RECURSE commonthings_SOURCES source-common/*.c source-common/*.cpp) add_library(commonthings OBJECT ${commonthings_SOURCES}) set_target_properties(commonthings PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF # Many files include platform headers, we don't want to leak them - it's just simpler to disable unity build for everything UNITY_BUILD OFF ) target_include_directories(commonthings PUBLIC source-common) target_link_libraries(commonthings PUBLIC # External dependencies ${CONAN_LIBS} glm::glm ) # ============================================================================== # NOTE: delibrately not recursive, see README.md in the folder for details file(GLOB meta_codegen_SOURCES buildtools/codegen/*.c buildtools/codegen/*.cpp) add_executable(meta_codegen ${meta_codegen_SOURCES}) set_target_properties(meta_codegen PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF UNITY_BUILD OFF ) target_link_libraries(meta_codegen PRIVATE # External dependencies ${CONAN_LIBS} # Project internal components commonthings ) target_flag_rtti(meta_codegen OFF) # ============================================================================== # add_executable requires at least one source file add_executable(${PROJECT_NAME} dummy.c) add_subdirectory(source) set_target_properties(${PROJECT_NAME} PROPERTIES UNITY_BUILD_MODE BATCH UNITY_BUILD_UNIQUE_ID "${PROJECT_NAME}_UNITY_ID" ) set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON CXX_EXTENSIONS OFF ) target_compile_definitions(${PROJECT_NAME} PRIVATE RAPIDJSON_HAS_STDSTRING=1 IMGUI_DISABLE_OBSOLETE_FUNCTIONS BRUSSEL_DEV_ENV=1 ) target_include_directories(${PROJECT_NAME} PRIVATE sources ) target_link_libraries(${PROJECT_NAME} PRIVATE # External dependencies ${CONAN_LIBS} OpenGL::GL glfw glm::glm imgui ImGuiColorTextEdit tracy # Project internal components commonthings ) option(BRUSSEL_ENABLE_PROFILING "Whether profiling support is enabled or not." OFF) if(BRUSSEL_ENABLE_PROFILING) target_compile_definitions(${PROJECT_NAME} PRIVATE TRACY_ENABLE ) endif() option(BRUSSEL_ENABLE_EDITOR "Enable editor support or not." ON) if(BRUSSEL_ENABLE_EDITOR) target_compile_definitions(${PROJECT_NAME} PRIVATE BRUSSEL_ENABLE_EDITOR=1 ) endif() option(BRUSSEL_ENABLE_ASAN "Enable AddressSanitizer or not." OFF) if(BRUSSEL_ENABLE_ASAN) target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address -fno-omit-frame-pointer ) target_link_options(${PROJECT_NAME} PRIVATE -fsanitize=address -fno-omit-frame-pointer ) endif()