aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt108
1 files changed, 10 insertions, 98 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3139afe3..40f0c496 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,29 +4,27 @@ project(monero-gui)
message(STATUS "Initiating compile using CMake ${CMAKE_VERSION}")
set(VERSION_MAJOR "17")
-set(VERSION_MINOR "2")
+set(VERSION_MINOR "3")
set(VERSION_REVISION "1")
set(VERSION "0.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")
option(STATIC "Link libraries statically, requires static Qt")
option(USE_DEVICE_TREZOR "Trezor support compilation" ON)
-option(ENABLE_PASS_STRENGTH_METER "Enable zxcvbn library for password strength" OFF)
option(WITH_SCANNER "Enable webcam QR scanner" OFF)
+option(WITH_DESKTOP_ENTRY "Ask to install desktop entry on first startup" ON)
option(DEV_MODE "Checkout latest monero master on build" OFF)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)
-include(FindCcache)
if(DEBUG)
set(CMAKE_VERBOSE_MAKEFILE ON)
endif()
set(BUILD_GUI_DEPS ON)
-set(ARCH "x86-64" CACHE STRING "Target architecture")
set(BUILD_64 ON CACHE BOOL "Build 64-bit binaries")
if(NOT MANUAL_SUBMODULES)
@@ -58,6 +56,7 @@ if(NOT MANUAL_SUBMODULES)
endif()
add_subdirectory(monero)
+add_subdirectory(external)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
@@ -71,19 +70,10 @@ endif()
if(STATIC)
message(STATUS "Initiating static build")
- set(Boost_USE_STATIC_LIBS ON)
- set(Boost_USE_STATIC_RUNTIME ON)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ${CMAKE_FIND_LIBRARY_SUFFIXES})
add_definitions(-DMONERO_GUI_STATIC)
endif()
-# Include password strength library
-if(ENABLE_PASS_STRENGTH_METER)
- message(STATUS "Building with pass strength meter support.")
-else()
- add_definitions(-DDISABLE_PASS_STRENGTH_METER)
-endif()
-
include(CMakePackageConfigHelpers)
include_directories(${EASYLOGGING_INCLUDE})
@@ -93,56 +83,18 @@ include(VersionGui)
message(STATUS "${CMAKE_MODULE_PATH}")
-# OpenSSL
-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}")
-message(STATUS "OpenSSL: libraries at ${OPENSSL_LIBRARIES} ${OPENSSL_SSL_LIBRARIES}")
-
if(WITH_SCANNER)
add_definitions(-DWITH_SCANNER)
endif()
+if(WITH_DESKTOP_ENTRY)
+ add_definitions(-DWITH_DESKTOP_ENTRY)
+endif()
+
# Sodium
find_library(SODIUM_LIBRARY sodium)
message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}")
-# LibUSB
-find_package(LibUSB)
-message(STATUS "libusb: include dir at ${LibUSB_INCLUDE_DIRS}")
-message(STATUS "libusb: libraries at ${LibUSB_LIBRARIES}")
-
-# HIDApi
-if(NOT ANDROID)
- find_package(HIDAPI REQUIRED)
- message(STATUS "libhidapi: include dir at ${HIDAPI_INCLUDE_DIRS}")
- message(STATUS "libhidapi: libraries at ${HIDAPI_LIBRARIES}")
-endif()
-
-# Boost
-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()
-find_package(Boost 1.58 REQUIRED COMPONENTS
- system
- filesystem
- thread
- date_time
- chrono
- regex
- serialization
- program_options
- locale)
-
if(UNIX AND NOT APPLE AND NOT ANDROID)
set(CMAKE_SKIP_RPATH ON)
set(CMAKE_FIND_LIBRARY_SUFFIXES_PREV ${CMAKE_FIND_LIBRARY_SUFFIXES})
@@ -160,19 +112,6 @@ if(UNIX AND NOT APPLE AND NOT ANDROID)
endif()
endif()
-if(MINGW)
- string(REGEX MATCH "^[^/]:/[^/]*" msys2_install_path "${CMAKE_C_COMPILER}")
- message(STATUS "MSYS location: ${msys2_install_path}")
- set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw${ARCH_WIDTH}/include")
- # This is necessary because otherwise CMake will make Boost libraries -lfoo
- # rather than a full path. Unfortunately, this makes the shared libraries get
- # linked due to a bug in CMake which misses putting -static flags around the
- # -lfoo arguments.
- set(DEFLIB ${msys2_install_path}/mingw${ARCH_WIDTH}/lib)
- list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
- list(REMOVE_ITEM CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES ${DEFLIB})
-endif()
-
set(QT5_LIBRARIES
Qt5Core
Qt5Quick
@@ -304,7 +243,7 @@ if(STATIC)
if(WITH_SCANNER)
list(APPEND QT5_EXTRA_LIBRARIES_LIST
declarative_multimedia
- Qt5MultimediaQuick_p
+ Qt5MultimediaQuick
)
endif()
@@ -385,10 +324,6 @@ if(ANDROID)
endforeach()
endif()
-message(STATUS "Using Boost include dir at ${Boost_INCLUDE_DIRS}")
-message(STATUS "Using Boost libraries at ${Boost_LIBRARIES}")
-
-include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj")
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt)
@@ -423,7 +358,7 @@ if(APPLE)
endif()
if (APPLE AND NOT IOS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default -std=c++11")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default -std=c++11")
endif()
if(APPLE)
@@ -431,8 +366,6 @@ if(APPLE)
endif()
# warnings
-add_c_flag_if_supported(-Werror C_SECURITY_FLAGS)
-add_cxx_flag_if_supported(-Werror CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-Wformat C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-Wformat CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-Wformat-security C_SECURITY_FLAGS)
@@ -451,7 +384,7 @@ if (NOT OPENBSD AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE
add_c_flag_if_supported(-fcf-protection=full C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fcf-protection=full CXX_SECURITY_FLAGS)
endif()
-if (NOT WIN32 AND NOT OPENBSD)
+if (NOT WIN32 AND NOT OPENBSD AND NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_c_flag_if_supported(-fstack-clash-protection C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
endif()
@@ -514,26 +447,5 @@ 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 (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED)
- if (APPLE)
- if(DEPENDS)
- list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework IOKit")
- else()
- find_library(COREFOUNDATION CoreFoundation)
- find_library(IOKIT IOKit)
- list(APPEND EXTRA_LIBRARIES ${IOKIT})
- list(APPEND EXTRA_LIBRARIES ${COREFOUNDATION})
- endif()
- endif()
- if (WIN32)
- find_library(VERSION_LIBRARY version PATHS /usr/x86_64-w64-mingw32/lib)
- if(VERSION_LIBRARY STREQUAL "VERSION_LIBRARY-NOTFOUND")
- set(VERSION_LIBRARY Version)
- endif()
- list(APPEND EXTRA_LIBRARIES setupapi ${VERSION_LIBRARY})
- endif()
-endif()
-
-add_subdirectory(external)
add_subdirectory(translations)
add_subdirectory(src)