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.
This commit is contained in:
Scott Furry 2019-06-25 23:41:48 -06:00 committed by Daniel Marjamäki
parent be5778c416
commit fc61596c40
2 changed files with 6 additions and 2 deletions

View File

@ -109,7 +109,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror") set(EXTRA_C_FLAGS "${EXTRA_C_FLAGS} -Werror")
endif() 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") set(EXTRA_C_FLAGS_DEBUG "${EXTRA_C_FLAGS_DEBUG} -O0")

View File

@ -26,7 +26,11 @@ message( STATUS )
message( STATUS "USE_MATCHCOMPILER = ${USE_MATCHCOMPILER}" ) message( STATUS "USE_MATCHCOMPILER = ${USE_MATCHCOMPILER}" )
message( STATUS "USE_MATCHCOMPILER_OPT = ${USE_MATCHCOMPILER_OPT}" ) message( STATUS "USE_MATCHCOMPILER_OPT = ${USE_MATCHCOMPILER_OPT}" )
message( STATUS ) message( STATUS )
if(NOT DEFINED BUILD_SHARED_LIBS)
message( STATUS "BUILD_SHARED_LIBS = OFF" )
else()
message( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" ) message( STATUS "BUILD_SHARED_LIBS = ${BUILD_SHARED_LIBS}" )
endif(NOT DEFINED BUILD_SHARED_LIBS)
message( STATUS "BUILD_TESTS = ${BUILD_TESTS}" ) message( STATUS "BUILD_TESTS = ${BUILD_TESTS}" )
message( STATUS "BUILD_GUI = ${BUILD_GUI}" ) message( STATUS "BUILD_GUI = ${BUILD_GUI}" )
message( STATUS "WITH_QCHART = ${WITH_QCHART}" ) message( STATUS "WITH_QCHART = ${WITH_QCHART}" )