summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-02-04 17:32:36 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-02-06 20:22:33 +0000
commitdcd439a5c3d80cd89c493a900c78e2a398f65248 (patch)
tree5069a26e19b929aa441397727be154cc3af70e22
parent835b9fbdc933878a744cd6ba1c77942610f4fe06 (diff)
Make cmake script more forgiving.
Instead of hard-erroring when we don't find dependencies, we just don't build the things requested and print a warning. This is less annoying to users because we enable a bunch of things by default. This way, we can at least build something with the default "cmake" invocation.
-rw-r--r--CMakeLists.txt17
-rw-r--r--cmake/Dependencies.cmake2
2 files changed, 11 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cd5bae6..742facd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,7 +66,7 @@ enable_testing()
66 66
67set(CMAKE_MACOSX_RPATH ON) 67set(CMAKE_MACOSX_RPATH ON)
68 68
69if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 69if(NOT MSVC)
70 # Set standard version for compiler. 70 # Set standard version for compiler.
71 add_cflag("-std=c99") 71 add_cflag("-std=c99")
72 add_cxxflag("-std=c++11") 72 add_cxxflag("-std=c++11")
@@ -183,10 +183,12 @@ include(Dependencies)
183 183
184if(BUILD_TOXAV) 184if(BUILD_TOXAV)
185 if(NOT OPUS_FOUND) 185 if(NOT OPUS_FOUND)
186 message(SEND_ERROR "Option BUILD_TOXAV is enabled but required library OPUS was not found.") 186 message(WARNING "Option BUILD_TOXAV is enabled but required library OPUS was not found.")
187 set(BUILD_TOXAV OFF)
187 endif() 188 endif()
188 if(NOT VPX_FOUND) 189 if(NOT VPX_FOUND)
189 message(SEND_ERROR "Option BUILD_TOXAV is enabled but required library VPX was not found.") 190 message(WARNING "Option BUILD_TOXAV is enabled but required library VPX was not found.")
191 set(BUILD_TOXAV OFF)
190 endif() 192 endif()
191endif() 193endif()
192 194
@@ -492,7 +494,7 @@ elseif(FORMAT_TEST)
492endif() 494endif()
493 495
494function(auto_test target) 496function(auto_test target)
495 if(CHECK_FOUND AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" AND ARGV1 STREQUAL "MSVC_DONT_BUILD")) 497 if(CHECK_FOUND AND NOT (MSVC AND ARGV1 STREQUAL "MSVC_DONT_BUILD"))
496 add_executable(auto_${target}_test auto_tests/${target}_test.c) 498 add_executable(auto_${target}_test auto_tests/${target}_test.c)
497 target_link_modules(auto_${target}_test 499 target_link_modules(auto_${target}_test
498 toxcore 500 toxcore
@@ -568,10 +570,11 @@ if(DHT_BOOTSTRAP)
568endif() 570endif()
569 571
570option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON) 572option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON)
573if(BOOTSTRAP_DAEMON AND WIN32)
574 message(WARNING "Building tox-bootstrapd for Windows is not supported")
575 set(BOOTSTRAP_DAEMON OFF)
576endif()
571if(BOOTSTRAP_DAEMON) 577if(BOOTSTRAP_DAEMON)
572 if(WIN32)
573 message(FATAL_ERROR "Building tox-bootstrapd for Windows is not supported")
574 endif()
575 if(LIBCONFIG_FOUND) 578 if(LIBCONFIG_FOUND)
576 add_executable(tox-bootstrapd 579 add_executable(tox-bootstrapd
577 other/bootstrap_daemon/src/command_line_arguments.c 580 other/bootstrap_daemon/src/command_line_arguments.c
diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
index be21bbf8..572b77b0 100644
--- a/cmake/Dependencies.cmake
+++ b/cmake/Dependencies.cmake
@@ -42,7 +42,7 @@ pkg_use_module(SNDFILE sndfile )
42# 42#
43############################################################################### 43###############################################################################
44 44
45if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 45if(MSVC)
46 # libsodium 46 # libsodium
47 # --------- 47 # ---------
48 find_library(LIBSODIUM_LIBRARIES 48 find_library(LIBSODIUM_LIBRARIES