Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly indicate no config-site or fatal error if not found #19922

Open
wants to merge 2 commits into
base: 3.4RC
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,15 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/CMake/VisItFunctions.cmake)
#-----------------------------------------------------------------------------
macro(include_visit_config_site)
if(VISIT_CONFIG_SITE)
set(VISIT_CONFIG_SITE_FILE ${VISIT_CONFIG_SITE})
string(TOUPPER ${VISIT_CONFIG_SITE} VISIT_CONFIG_SITE_UPPER)
if(VISIT_CONFIG_SITE_UPPER STREQUAL "OFF" OR
VISIT_CONFIG_SITE_UPPER STREQUAL "NO" OR
VISIT_CONFIG_SITE_UPPER STREQUAL "NONE")
set(VISIT_CONFIG_SITE_NONE TRUE)
else()
set(VISIT_CONFIG_SITE_NONE FALSE)
set(VISIT_CONFIG_SITE_FILE ${VISIT_CONFIG_SITE})
endif()
else()
set(VISIT_CONFIG_SITE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/config-site/${HOSTNAME}.cmake")
if(WIN32)
Expand All @@ -669,14 +677,19 @@ macro(include_visit_config_site)
endif()
endif()
endif()
if(EXISTS ${VISIT_CONFIG_SITE_FILE})
message(STATUS "Including config-site file '${VISIT_CONFIG_SITE_FILE}'")
include(${VISIT_CONFIG_SITE_FILE})
else()
message(STATUS "The config-site file (${VISIT_CONFIG_SITE_FILE}) does not exist")
if(NOT VISIT_CONFIG_SITE_NONE)
if(EXISTS ${VISIT_CONFIG_SITE_FILE})
message(STATUS "Including config-site file '${VISIT_CONFIG_SITE_FILE}'")
include(${VISIT_CONFIG_SITE_FILE})
else()
unset(VISIT_CONFIG_SITE_FILE CACHE)
unset(VISIT_CONFIG_SITE CACHE)
message(FATAL_ERROR "The config-site file, ${VISIT_CONFIG_SITE_FILE}, does not exist. Pass -DVISIT_CONFIG_SITE=NONE if no config-site file is needed.")
endif()
endif()

unset(VISIT_CONFIG_SITE_FILE)
unset(VISIT_CONFIG_SITE_FILE CACHE)
unset(VISIT_CONFIG_SITE CACHE)
endmacro()

if(NOT WIN32)
Expand Down