diff options
author | Robin Linden <dev@robinlinden.eu> | 2020-05-14 01:50:43 +0200 |
---|---|---|
committer | Robin Linden <dev@robinlinden.eu> | 2020-05-29 15:36:26 +0200 |
commit | 56992b099eb5b77adfca15678ada9ec4011d8dd3 (patch) | |
tree | 4500cb5650fccff7294de22a2f72743984292d83 /CMakeLists.txt | |
parent | 03a511482ffa643a636cd5bcce596f110ca2d8e0 (diff) |
Add support for the conan C/C++ package manager
* Don't overwrite the CMAKE_MODULE_PATH
* Allow linking libsodium statically with MSVC
* Allow finding libsodium the normal way on MSVC
* Allow using pthreads4w for pthreads on MSVC
* Fall back to find_package if pkg_find_module fails
* Don't pass incompatible compile flags to MSVC
* Also try to find Opus and libvpx using their canonical names
* Support building using conan
* Allow pkg_use_module to take a list of libraries to look for
* Build for Windows on Appveyor using conan
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 51e1e99f..98a4eabe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 2.8.12) | |||
18 | cmake_policy(VERSION 2.8.12) | 18 | cmake_policy(VERSION 2.8.12) |
19 | project(toxcore) | 19 | project(toxcore) |
20 | 20 | ||
21 | set(CMAKE_MODULE_PATH ${toxcore_SOURCE_DIR}/cmake) | 21 | list(APPEND CMAKE_MODULE_PATH ${toxcore_SOURCE_DIR}/cmake) |
22 | 22 | ||
23 | ################################################################################ | 23 | ################################################################################ |
24 | # | 24 | # |
@@ -115,6 +115,13 @@ option(NON_HERMETIC_TESTS "Whether to build and run tests that depend on an inte | |||
115 | option(BUILD_TOXAV "Whether to build the tox AV library" ON) | 115 | option(BUILD_TOXAV "Whether to build the tox AV library" ON) |
116 | option(MUST_BUILD_TOXAV "Fail the build if toxav cannot be built" OFF) | 116 | option(MUST_BUILD_TOXAV "Fail the build if toxav cannot be built" OFF) |
117 | 117 | ||
118 | if(MSVC) | ||
119 | option(MSVC_STATIC_SODIUM "Whether to link libsodium statically for MSVC" OFF) | ||
120 | if(MSVC_STATIC_SODIUM) | ||
121 | add_definitions(-DSODIUM_STATIC=1 -DSODIUM_EXPORT) | ||
122 | endif() | ||
123 | endif() | ||
124 | |||
118 | include(Dependencies) | 125 | include(Dependencies) |
119 | 126 | ||
120 | if(MUST_BUILD_TOXAV) | 127 | if(MUST_BUILD_TOXAV) |