From 7f390ef8e5d5eb3cd356bd12c0ff9d87a800f5ba Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 23 May 2015 22:20:26 +0200 Subject: [PATCH] Added option to inhibit all warnings from external projects --- CMakeLists.txt | 12 +++++++----- ext/ghoul | 2 +- support/cmake/support_macros.cmake | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25752717c9..e2d2bd6dec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,19 +41,21 @@ cleanup_project() set_build_output_directories() configure_openspace_version(0 1 0 "prerelease-5") -include(src/CMakeLists.txt) -create_openspace_targets() -set_compile_settings() -add_external_dependencies() - option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) if (MSVC) option(OPENSPACE_ENABLE_VLD "Enable the Visual Leak Detector" OFF) handle_option_vld() endif () +option(OPENSPACE_DISABLE_EXTERNAL_WARNINGS "Disable warnings in external libraries" ON) option(OPENSPACE_BUILD_GUI_APPLICATIONS "Build GUI Applications" OFF) + +include(src/CMakeLists.txt) +create_openspace_targets() +set_compile_settings() +add_external_dependencies() + option(OPENSPACE_HAVE_TESTS "Activate the OpenSpace unit tests" ON) handle_option_tests() diff --git a/ext/ghoul b/ext/ghoul index 9df5fdae81..12aba7d7dc 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 9df5fdae818d5c2abb9458e4ccf8f4b8c88b308d +Subproject commit 12aba7d7dc13e2cb33d6bf70466ea9d7b24f5704 diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index bc2ad32338..82ba9bcb80 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -177,8 +177,23 @@ function (add_external_dependencies) add_subdirectory(${KAMELEON_ROOT_DIR}) target_include_directories(libOpenSpace SYSTEM PUBLIC ${KAMELEON_INCLUDES}) target_link_libraries(libOpenSpace ccmc) + if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) + if (MSVC) + target_compile_options(ccmc PUBLIC "/W0" "/MP") + else () + message("Fill me will values ---abock") + endif () + target_compile_definitions(ccmc PUBLIC "_SCL_SECURE_NO_WARNINGS") + endif () set_property(TARGET ccmc PROPERTY FOLDER "External") if (TARGET cdf) + if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) + if (MSVC) + target_compile_options(cdf PUBLIC "/W0" "/MP") + else () + message("Fill me will values ---abock") + endif () + endif () set_property(TARGET cdf PROPERTY FOLDER "External") endif () @@ -188,6 +203,13 @@ function (add_external_dependencies) target_link_libraries(libOpenSpace Imgui) target_include_directories(libOpenSpace PUBLIC ${IMGUI_INCLUDE_DIR}) set_property(TARGET Imgui PROPERTY FOLDER "External") + if (OPENSPACE_DISABLE_EXTERNAL_WARNINGS) + if (MSVC) + target_compile_options(Imgui PUBLIC "/W0" "/MP") + else () + message("Fill me will values ---abock") + endif () + endif () endfunction ()