Skip to content
Snippets Groups Projects
Commit 00ec355c authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Use Conan as default when executable is found.

Developer having Conan installed typically also want to use it
for third-party library handling. This avoids strange things
happening when switching Conan to ON from the CMake GUI.
parent 22600b08
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ option(OGS_USE_PCH "Should pre-compiled headers be used?" ON) ...@@ -41,7 +41,7 @@ option(OGS_USE_PCH "Should pre-compiled headers be used?" ON)
if(DEFINED CMAKE_CXX_CLANG_TIDY) if(DEFINED CMAKE_CXX_CLANG_TIDY)
set(OGS_USE_PCH OFF CACHE INTERNAL "") set(OGS_USE_PCH OFF CACHE INTERNAL "")
endif() endif()
option(OGS_USE_CONAN "Should Conan package manager be used?" OFF) option(OGS_USE_CONAN "Should Conan package manager be used?" ON)
set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \ set(OGS_CONAN_BUILD "missing" CACHE STRING "Possible values: all, missing, \
never or list of libs to build" ) never or list of libs to build" )
if(OGS_USE_PETSC) if(OGS_USE_PETSC)
......
if(NOT OGS_USE_CONAN) if(NOT OGS_USE_CONAN)
return() return()
endif() endif()
find_program(CONAN_CMD conan)
if(NOT CONAN_CMD)
message(WARNING "conan executable not found. Consider installing Conan for "
"automatic third-party library handling. https://www.opengeosys.org/doc"
"s/devguide/getting-started/prerequisites/#step-install-conan-package-m"
"anager OR disable this warning with OGS_USE_CONAN=OFF")
return()
endif()
if(CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) if(CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
message(FATAL_ERROR "Multi-config generators are not yet supported when " message(FATAL_ERROR "Multi-config generators are not yet supported when "
...@@ -61,7 +70,7 @@ if(OGS_BUILD_GUI) ...@@ -61,7 +70,7 @@ if(OGS_BUILD_GUI)
) )
endif() endif()
conan_check(VERSION 1.0.0 REQUIRED) conan_check(VERSION 1.0.0)
conan_add_remote(NAME ogs INDEX 0 conan_add_remote(NAME ogs INDEX 0
URL https://ogs.jfrog.io/ogs/api/conan/conan) URL https://ogs.jfrog.io/ogs/api/conan/conan)
conan_add_remote(NAME conan-community INDEX 1 conan_add_remote(NAME conan-community INDEX 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment