add download-default-if-not-found logic to voro++ library for VORONOI package

This commit is contained in:
Axel Kohlmeyer 2019-04-06 17:17:17 -04:00
parent 8c02ce7302
commit 72b69783de
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 10 additions and 3 deletions

View File

@ -448,7 +448,13 @@ endif()
if(PKG_VORONOI)
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" OFF)
find_package(VORO QUIET)
if(VORO_FOUND)
set(DOWNLOAD_VORO_DEFAULT OFF)
else()
set(DOWNLOAD_VORO_DEFAULT ON)
endif()
option(DOWNLOAD_VORO "Download and compile the Voro++ library instead of using an already installed one" ${DOWNLOAD_VORO_DEFAULT})
if(DOWNLOAD_VORO)
message(STATUS "Voro++ download requested - we will build our own")
include(ExternalProject)
@ -692,10 +698,11 @@ if(PKG_KIM)
endif()
find_package(KIM-API QUIET)
if(KIM-API_FOUND)
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" OFF)
set(DOWNLOAD_KIM_DEFAULT OFF)
else()
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ON)
set(DOWNLOAD_KIM_DEFAULT ON)
endif()
option(DOWNLOAD_KIM "Download KIM-API from OpenKIM instead of using an already installed one" ${DOWNLOAD_KIM_DEFAULT})
if(DOWNLOAD_KIM)
message(STATUS "KIM-API download requested - we will build our own")
enable_language(C)