Use CMakeDeps and CMakeToolchain as Generators on Conan (#4335)

* deps(conan): use `CMakeDeps` as generator

* chore: add changelog entry

* deps(conan): add `CMakeToolchain` generator

* fix: use generated toolchain file

* docs: mention toolchain as well

* fix: spelling

* fix: formatting

* revert: use nmake

* docs: fix documentation
This commit is contained in:
nerix
2023-01-29 14:10:39 +01:00
committed by GitHub
parent 6a4f0befd4
commit b80d41c327
6 changed files with 22 additions and 35 deletions
+6 -13
View File
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.12)
cmake_policy(SET CMP0087 NEW)
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0087 NEW) # evaluates generator expressions in `install(CODE/SCRIPT)`
cmake_policy(SET CMP0091 NEW) # select MSVC runtime library through `CMAKE_MSVC_RUNTIME_LIBRARY`
include(FeatureSummary)
list(APPEND CMAKE_MODULE_PATH
@@ -24,8 +25,6 @@ option(BUILD_TRANSLATIONS "" OFF)
option(BUILD_SHARED_LIBS "" OFF)
option(CHATTERINO_LTO "Enable LTO for all targets" OFF)
option(USE_CONAN "Use conan" OFF)
if(CHATTERINO_LTO)
include(CheckIPOSupported)
check_ipo_supported(RESULT CHATTERINO_ENABLE_LTO OUTPUT IPO_ERROR)
@@ -40,13 +39,6 @@ else()
set(MAJOR_QT_VERSION "5")
endif()
if (USE_CONAN OR CONAN_EXPORTED)
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
else ()
set(QT_CREATOR_SKIP_CONAN_SETUP ON)
endif()
find_program(CCACHE_PROGRAM ccache)
if (CCACHE_PROGRAM)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
@@ -75,8 +67,9 @@ endif ()
find_package(Sanitizers)
# Find boost on the system
find_package(Boost REQUIRED)
find_package(Boost COMPONENTS random)
# `OPTIONAL_COMPONENTS random` is required for vcpkg builds to link.
# `OPTIONAL` is required, because conan doesn't set `boost_random_FOUND`.
find_package(Boost REQUIRED OPTIONAL_COMPONENTS random)
# Find OpenSSL on the system
find_package(OpenSSL REQUIRED)