From b28e998a84721f1334b58105516de0bb16c71eeb Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Thu, 29 Sep 2016 14:11:30 -0400 Subject: [PATCH 1/2] Allow CPP_STANDARD to be overridden --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8da424..2cf93d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,6 +274,10 @@ if(WIN32) endif(WIN32) # end readline stuff +if( NOT CPP_STANDARD ) + set( CPP_STANDARD, "-std=c++11" ) +endif() + IF(WIN32) target_compile_definitions(fc PUBLIC WIN32 NOMINMAX _WIN32_WINNT=0x0501 _CRT_SECURE_NO_WARNINGS _SCL_SERCURE_NO_WARNINGS @@ -295,12 +299,12 @@ ELSE() SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall") IF(APPLE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP_STANDARD} -stdlib=libc++ -Wall") ELSE() if( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) - target_compile_options(fc PUBLIC -std=c++11 -Wall -fnon-call-exceptions) + target_compile_options(fc PUBLIC ${CPP_STANDARD} -Wall -fnon-call-exceptions) endif() - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fnon-call-exceptions") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CPP_STANDARD} -Wall -fnon-call-exceptions") ENDIF() ENDIF() From 0d7916b7c2267ab96086166e1e31d77d6877c9a7 Mon Sep 17 00:00:00 2001 From: theoreticalbts Date: Thu, 29 Sep 2016 14:55:09 -0400 Subject: [PATCH 2/2] Handle zlib / bzip2 not found --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cf93d5..269486b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,6 +323,7 @@ if( ZLIB_FOUND ) add_definitions( -DHAS_ZLIB ) else() MESSAGE( STATUS "zlib not found" ) + set( ZLIB_LIBRARIES "" ) endif( ZLIB_FOUND ) find_package( BZip2 ) @@ -331,6 +332,7 @@ if( BZIP2_FOUND ) add_definitions( -DHAS_BZIP2 ) else() MESSAGE( STATUS "bzip2 not found" ) + set( BZIP2_LIBRARIES "" ) endif( BZIP2_FOUND ) # This will become unnecessary once we update to websocketpp which fixes upstream issue #395