depot/third_party/nixpkgs/pkgs/applications/misc/kemai/000-cmake-disable-conan.diff

39 lines
1.4 KiB
Diff
Raw Normal View History

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce78a9d..3cd51e0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,18 +8,21 @@ list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
# Common configuration
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
-
-# Setup Conan
-if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
- message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
- file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
- "${CMAKE_BINARY_DIR}/conan.cmake"
- TLS_VERIFY ON)
-endif()
-include(${CMAKE_BINARY_DIR}/conan.cmake)
-
-conan_cmake_autodetect(settings)
-conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR} BUILD missing SETTINGS ${settings})
+set(USE_CONAN ON CACHE BOOL "Use conan for dependency managment")
+
+if(USE_CONAN)
+ # Setup Conan
+ if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
+ message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
+ file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
+ "${CMAKE_BINARY_DIR}/conan.cmake"
+ TLS_VERIFY ON)
+ endif()
+ include(${CMAKE_BINARY_DIR}/conan.cmake)
+
+ conan_cmake_autodetect(settings)
+ conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR} BUILD missing SETTINGS ${settings})
+endif ()
# Setup Qt
set(CMAKE_AUTOMOC ON)