@ -5,9 +5,9 @@ message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
set ( THREADS_PREFER_PTHREAD_FLAG ON )
set ( VERSION_MAJOR "4" )
set ( VERSION_MINOR " 0 ")
set ( VERSION_REVISION " 0 ")
set ( VERSION "beta- 7 ")
set ( VERSION_MINOR " 1 ")
set ( VERSION_REVISION " 1 ")
set ( VERSION "beta- 8 ")
option ( FETCH_DEPS "Download dependencies if they are not found" ON )
option ( OPENVR "Include OpenVR support" )
@ -30,11 +30,6 @@ set(BUILD_GUI_DEPS ON)
set ( BUILD_64 ON CACHE BOOL "Build 64-bit binaries" )
set ( INSTALL_VENDORED_LIBUNBOUND ${ STATIC } )
set ( USE_SINGLE_BUILDDIR ON )
if ( UNIX AND NOT APPLE )
set ( LINUX_ACTIVATION ON )
else ( )
set ( LINUX_ACTIVATION OFF )
endif ( )
# A r e w e i n d e b u g m o d e ?
set ( _CMAKE_BUILD_TYPE "" )
@ -101,9 +96,6 @@ include_directories(${EASYLOGGING_INCLUDE})
link_directories ( ${ EASYLOGGING_LIBRARY_DIRS } )
# O p e n S S L
if ( APPLE AND NOT OPENSSL_ROOT_DIR )
execute_process ( COMMAND brew --prefix openssl OUTPUT_VARIABLE OPENSSL_ROOT_DIR OUTPUT_STRIP_TRAILING_WHITESPACE )
endif ( )
find_package ( OpenSSL REQUIRED )
message ( STATUS "OpenSSL: Version ${OPENSSL_VERSION}" )
message ( STATUS "OpenSSL: include dir at ${OPENSSL_INCLUDE_DIR}" )
@ -129,20 +121,15 @@ find_package(wownero-seed CONFIG REQUIRED)
if ( DEBUG )
set ( Boost_DEBUG ON )
endif ( )
if ( APPLE AND NOT BOOST_ROOT )
execute_process ( COMMAND brew --prefix boost OUTPUT_VARIABLE BOOST_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE )
endif ( )
if ( MINGW )
set ( Boost_THREADAPI win32 )
endif ( )
set ( _BOOST_COMPONENTS system filesystem thread date_time chrono regex serialization program_options locale )
if ( APPLE )
# a t o m i c i s o n l y p r e s e n t / n e e d e d o n A p p l e
list ( APPEND _BOOST_COMPONENTS atomic )
endif ( )
find_package ( Boost 1.58 REQUIRED COMPONENTS ${ _BOOST_COMPONENTS } )
if ( UNIX AND NOT A PPLE AND NOT A NDROID)
if ( UNIX AND NOT ANDROID )
if ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
# h t t p s : / / g i t h u b . c o m / m o n e r o - p r o j e c t / m o n e r o - g u i / i s s u e s / 3 1 4 2 # i s s u e c o m m e n t - 7 0 5 9 4 0 4 4 6
set ( CMAKE_SKIP_RPATH ON )
@ -184,38 +171,17 @@ if(TOR_BIN)
# o n t h e buildbot ( s ) T o r i s b a k e d i n t o t h e i m a g e
# - l i n u x : S e e ` D o c k e r f i l e `
# - w i n d o w s : S e e ` D o c k e r f i l e . w i n d o w s `
#
# # # M a c O S :
# w e a s s u m e t h e f o l l o w i n g f i l e s a r e a l r e a d y p r e s e n t i n s r c / a s s e t s / e x e c :
# - t o r
# - l i b e v e n t - 2 . 1 . 7 . d y l i b
# s o c o p y t h e m b e f o r e h a n d a n d s e t T O R _ B I N t o s o m e t h i n g r a n d o m .
# M a c O S , c h e c k i f r e q u i r e d f i l e s a r e p r e s e n t
if ( APPLE )
foreach ( fn libevent-2.1.7.dylib tor )
set ( tor_path "${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/${fn}" )
if ( EXISTS "${tor_path}" )
message ( STATUS "Tor found: ${tor_path}" )
else ( )
message ( FATAL_ERROR "TOR_BIN is set, so the following file needs to be present: '${tor_path}'" )
endif ( )
set ( TOR_BIN "${tor_path}" )
endforeach ( )
else ( )
if ( NOT EXISTS "${TOR_BIN}" )
message ( FATAL_ERROR "TOR_BIN is set, but file does not exist: '${TOR_BIN}'" )
endif ( )
# c o p y t h e T o r e x e c u t a b l e o v e r
set ( TOR_COPY_CMD "cp ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor" )
message ( STATUS "Tor cmd: ${TOR_COPY_CMD}" )
if ( NOT EXISTS "${TOR_BIN}" )
message ( FATAL_ERROR "TOR_BIN is set, but file does not exist: '${TOR_BIN}'" )
endif ( )
execute_process ( COMMAND bash -c "${TOR_COPY_CMD}" RESULT_VARIABLE ret )
if ( ret EQUAL "1" )
message ( FATAL_ERROR "Tor copy failure: ${TOR_COPY_CMD}" )
endif ( )
# c o p y t h e T o r e x e c u t a b l e o v e r
set ( TOR_COPY_CMD "cp ${TOR_BIN} ${CMAKE_CURRENT_SOURCE_DIR}/src/assets/exec/tor" )
message ( STATUS "Tor cmd: ${TOR_COPY_CMD}" )
execute_process ( COMMAND bash -c "${TOR_COPY_CMD}" RESULT_VARIABLE ret )
if ( ret EQUAL "1" )
message ( FATAL_ERROR "Tor copy failure: ${TOR_COPY_CMD}" )
endif ( )
# g e t T o r v e r s i o n w h i l e w e ' r e a t i t
@ -260,8 +226,6 @@ if(MINGW)
else ( )
set ( ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv )
endif ( )
elseif ( APPLE )
set ( EXTRA_LIBRARIES "-framework AppKit" )
elseif ( OPENBSD )
set ( EXTRA_LIBRARIES "" )
elseif ( FREEBSD )
@ -278,14 +242,6 @@ endif()
list ( APPEND EXTRA_LIBRARIES ${ CMAKE_DL_LIBS } )
if ( APPLE )
include_directories ( SYSTEM /usr/include/malloc )
if ( POLICY CMP0042 )
cmake_policy ( SET CMP0042 NEW )
endif ( )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -std=c++11 -DGTEST_HAS_TR1_TUPLE=0" )
endif ( )
# w a r n i n g s
# @ T O D O : e n a b l e t h e s e 2 f o r m i g r a t i o n t o Q t 6
# add_c_flag_if_supported ( -Werror C_SECURITY_FLAGS )
@ -320,12 +276,7 @@ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VER
endif ( )
# l i n k e r
if ( APPLE )
add_linker_flag_if_supported ( -Wl,-bind_at_load LD_SECURITY_FLAGS )
add_linker_flag_if_supported ( -Wl,-dead_strip LD_SECURITY_FLAGS )
add_linker_flag_if_supported ( -Wl,-dead_strip_dylibs LD_SECURITY_FLAGS )
endif ( )
if ( NOT APPLE AND NOT ( WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU" ) )
if ( NOT ( WIN32 AND CMAKE_C_COMPILER_ID STREQUAL "GNU" ) )
# W i n d o w s b i n a r i e s d i e o n s t a r t u p w i t h P I E w h e n c o m p i l e d w i t h G C C
add_linker_flag_if_supported ( -pie LD_SECURITY_FLAGS )
endif ( )
@ -376,10 +327,6 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${C_SECURITY_FLAGS}")
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${CXX_SECURITY_FLAGS}" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${STATIC_FLAGS}" )
if ( APPLE )
add_subdirectory ( "${CMAKE_CURRENT_SOURCE_DIR}/contrib/KDMacTouchBar" )
endif ( )
if ( OPENVR )
# A d d c o n t r i b / o p e n v r a s l i b r a r y
add_definitions ( -DVR_API_PUBLIC )