From fc61596c40e8b57b61d0ae934a14056ab75de246 Mon Sep 17 00:00:00 2001 From: Scott Furry Date: Tue, 25 Jun 2019 23:41:48 -0600 Subject: [PATCH] Adjustments to CMake Building (#1925) From CMake Docs( https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html ), BUILD_SHARED_LIBS may not be defined. This can result in printinfo.cmake outputing variable without a value. A conditional is applied to ensure that some output is provided to the user should variable not be defined. Removed explicit C++ standard flag. Any setting user would add on the command line would be replaced due to ordering. `-std=c++0x` would be last value added to CMAKE_CXX_FLAGS and ultimately the one used by the compiler. --- cmake/compileroptions.cmake | 2 +- cmake/printInfo.cmake | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/compileroptions.cmake b/cmake/compileroptions.cmake index c406c1e84..f5581da9d 100644 --- a/cmake/compileroptions.cmake +++ b/cmake/compileroptions.cmake @@ -109,7 +109,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") endif() - set(EXTRA_C_FLAGS "-Wall -std=c++0x ${EXTRA_C_FLAGS}") + set(EXTRA_C_FLAGS "-Wall ${EXTRA_C_FLAGS}") set(EXTRA_C_FLAGS_DEBUG "${EXTRA_C_FLAGS_DEBUG} -O0") diff --git a/cmake/printInfo.cmake b/cmake/printInfo.cmake index 6cc345f66..8e3ea18ed 100644 --- a/cmake/printInfo.cmake +++ b/cmake/printInfo.cmake @@ -26,7 +26,11 @@ message( STATUS ) message( STATUS "USE_MATCHCOMPILER = ${USE_MATCHCOMPILER}" ) message( STATUS "USE_MATCHCOMPILER_OPT = ${USE_MATCHCOMPILER_OPT}" ) message( STATUS ) -message( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" ) +if(NOT DEFINED BUILD_SHARED_LIBS) + message( STATUS "BUILD_SHARED_LIBS = OFF" ) +else() + message( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" ) +endif(NOT DEFINED BUILD_SHARED_LIBS) message( STATUS "BUILD_TESTS = ${BUILD_TESTS}" ) message( STATUS "BUILD_GUI = ${BUILD_GUI}" ) message( STATUS "WITH_QCHART = ${WITH_QCHART}" )