cmake_minimum_required(VERSION 3.10.0) project(smolbote) include(FeatureSummary) # Options option(Feature_ClangLibCpp "Use libc++ over stdlibc++" OFF) option(Feature_Plasma "Enable Plasma integration" OFF) option(Feature_Breakpad "Enable Breakpad crash reports" OFF) option(Devel_QtDeprecated "Enable Qt deprecation warnings" ON) option(Devel_Tests "Enable automatic testing" OFF) set(Vendor "${CMAKE_SOURCE_DIR}/vendor.cmake" CACHE FILEPATH "vendor configuration path") include(${Vendor}) # Libraries find_package(Qt5 5.11.0 COMPONENTS Core Widgets WebEngineWidgets REQUIRED) find_package(Boost 1.66 COMPONENTS program_options REQUIRED) if(Feature_Plasma) find_package(ECM 1.6.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) find_package(KF5 "5.6.0" COMPONENTS Wallet WindowSystem REQUIRED) endif(Feature_Plasma) if(Feature_Breakpad) find_package(Threads REQUIRED) add_subdirectory(3rd-party/breakpad) endif(Feature_Breakpad) # Global C++ settings set(CMAKE_CXX_STANDARD 17) if(Devel_QtDeprecated) add_definitions(-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050900) endif(Devel_QtDeprecated) # link to libc++ if (Feature_ClangLibCpp) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") endif (Feature_ClangLibCpp) # configure a header file to pass version information configure_file("${PROJECT_SOURCE_DIR}/src/version.h.in" "${PROJECT_BINARY_DIR}/src/version.h") add_subdirectory(3rd-party/SingleApplication) add_subdirectory(lib/about) add_subdirectory(lib/addressbar) add_subdirectory(lib/bookmarks) add_subdirectory(lib/downloads) add_subdirectory(lib/configuration) add_subdirectory(lib/web) add_subdirectory(lib/urlfilter) add_subdirectory(plugins/ProfileEditor) add_subdirectory(plugins/ConfigurationEditor) # browser source code add_subdirectory(src) if(Devel_Tests) enable_testing() find_package(Qt5 COMPONENTS Test REQUIRED) add_subdirectory(test) endif(Devel_Tests) # Summarize message(STATUS "=== Configuration summary ===") message(STATUS "Building ${poi_exe} ${poi_Build}") message(STATUS "vendor.cmake: ${Vendor}") message(STATUS "Platform: ${CMAKE_SYSTEM_NAME}") message(STATUS "Generator: ${CMAKE_GENERATOR}") message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") message(STATUS "CXX compiler: ${CMAKE_CXX_COMPILER_ID}") message(STATUS "CXX flags: ${CMAKE_CXX_FLAGS}") feature_summary(WHAT ALL)