add option to fail cmake if not all dependencies are found

This commit is contained in:
mpilman 2019-02-11 09:16:40 -08:00 committed by Alex Miller
parent a0b20ef2c1
commit 3401c1f771
1 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,5 @@
set(FORCE_ALL_COMPONENTS OFF CACHE BOOL "Fails cmake if not all dependencies are found")
################################################################################ ################################################################################
# LibreSSL # LibreSSL
################################################################################ ################################################################################
@ -82,7 +84,6 @@ endif()
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages)
add_custom_target(packages) add_custom_target(packages)
function(print_components) function(print_components)
message(STATUS "=========================================") message(STATUS "=========================================")
message(STATUS " Components Build Overview ") message(STATUS " Components Build Overview ")
@ -95,3 +96,10 @@ function(print_components)
message(STATUS "Build Documentation (make html): ${BUILD_DOCUMENTATION}") message(STATUS "Build Documentation (make html): ${BUILD_DOCUMENTATION}")
message(STATUS "=========================================") message(STATUS "=========================================")
endfunction() endfunction()
if(FORCE_ALL_COMPONENTS)
if(NOT BUILD_JAVA OR NOT WITH_TLS OR NOT WITH_GO OR NOT WITH_RUBY OR NOT WITH_PYTHON OR NOT BUILD_DOCUMENTATION)
print_components()
message(FATAL_ERROR "FORCE_ALL_COMPONENTS is set but not all dependencies could be found")
endif()
endif()