diff --git a/CMakeLists.txt b/CMakeLists.txt index c8da424..269486b 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() @@ -319,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 ) @@ -327,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