Commit 3bdce786 authored by cyrush's avatar cyrush
Browse files

add support for TYPE [CMAKE_TYPE] arg pair to VISIT_OPTION_DEFAULT

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@13489 18c085ea-50e0-402c-830e-de6fd14e8384
parent 5a99282b
......@@ -210,6 +210,10 @@
# Eric Brugger, Fri Jan 7 13:24:41 PST 2011
# I replaced the BOXLIB2D and BOXLIB3D variables with just BOXLIB.
#
# Cyrus Harrison, Wed Jan 12 11:41:21 PST 2011
# Add support for optional TYPE [CMAKE_TYPE] arg par to the
# VISIT_OPTION_DEFAULT function.
#
#****************************************************************************/
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
......@@ -238,14 +242,32 @@ SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SITE_NAME(HOSTNAME)
#-----------------------------------------------------------------------------
# Include this computer's config-site if one exists
# Helper function for setting build options via config-site file.
# Supports optional argument pair: TYPE [CMAKE_TYPE], default type = PATH
#-----------------------------------------------------------------------------
FUNCTION(VISIT_OPTION_DEFAULT var)
SET(${var} ${ARGN} CACHE PATH "${var} default value" FORCE)
SET(opt_ARGS "")
SET(opt_TYPE "PATH")
SET(opt_ARG_PREV "")
FOREACH(opt_ARG ${ARGN})
## if arg is TYPE:
## we want to use the next value as the cmake var type
## otherwise:
## we want to append the argument to the list of args used for "SET"
IF( ${opt_ARG_PREV} STREQUAL "TYPE")
SET(opt_TYPE ${opt_ARG})
ELSEIF(NOT ${opt_ARG} STREQUAL "TYPE")
LIST(APPEND opt_ARGS ${opt_ARG})
ENDIF(${opt_ARG_PREV} STREQUAL "TYPE")
SET(opt_ARG_PREV ${opt_ARG})
ENDFOREACH(opt_ARG in ${ARGN})
SET(${var} "${opt_ARGS}" CACHE ${opt_TYPE} "${var} default value" FORCE)
ENDFUNCTION(VISIT_OPTION_DEFAULT var)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/SetupITAPS.cmake)
#-----------------------------------------------------------------------------
# Include this computer's config-site if one exists
#-----------------------------------------------------------------------------
IF (NOT WIN32)
IF(VISIT_CONFIG_SITE)
SET(VISIT_CONFIG_SITE_FILE ${VISIT_CONFIG_SITE})
......
......@@ -1058,6 +1058,9 @@
# Jeremy Meredith, Wed Jan 12 11:21:11 EST 2011
# Changed HDF4 libdep generation to point to VTK jpeg library.
#
# Cyrus Harrison, Wed Jan 12 11:22:02 PST 2011
# Change config-site gen to add TYPE arguments to VISIT_OPTION_DEFAULT
#
# *****************************************************************************
......@@ -8153,16 +8156,16 @@ function build_hostconf
echo "##" >> $HOSTCONF
echo "## Compiler flags." >> $HOSTCONF
echo "##" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_C_COMPILER $C_COMPILER)">> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_CXX_COMPILER $CXX_COMPILER)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(CMAKE_BUILD_TYPE Release)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_C_COMPILER $C_COMPILER TYPE STRING)">> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_CXX_COMPILER $CXX_COMPILER TYPE STRING)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(CMAKE_BUILD_TYPE Release TYPE STRING)" >> $HOSTCONF
if [[ "$USE_VISIBILITY_HIDDEN" == "yes" ]] ; then
echo "VISIT_OPTION_DEFAULT(VISIT_C_FLAGS \"$CFLAGS -fvisibility=hidden\")" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS \"$CXXFLAGS -fvisibility=hidden\")" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_C_FLAGS \"$CFLAGS -fvisibility=hidden\" TYPE STRING)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS \"$CXXFLAGS -fvisibility=hidden\" TYPE STRING)" >> $HOSTCONF
else
echo "VISIT_OPTION_DEFAULT(VISIT_C_FLAGS \"$CFLAGS\")" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS \"$CXXFLAGS\")" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_C_FLAGS \"$CFLAGS\" TYPE STRING)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_CXX_FLAGS \"$CXXFLAGS\" TYPE STRING)" >> $HOSTCONF
fi
if [[ "$parallel" == "yes" ]] ; then
......@@ -8170,17 +8173,17 @@ function build_hostconf
echo "##" >> $HOSTCONF
echo "## Parallel Build Setup." >> $HOSTCONF
echo "##" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_PARALLEL ON)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_PARALLEL ON TYPE BOOL)" >> $HOSTCONF
# we either set an mpi wrapper compiler in the host conf
if [[ "$VISIT_MPI_COMPILER" != "" ]] ; then
echo "## (configured w/ mpi compiler wrapper)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_COMPILER $VISIT_MPI_COMPILER)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_COMPILER $VISIT_MPI_COMPILER TYPE STRING)" >> $HOSTCONF
else
# or we just set the flags.
echo "## (configued w/ user provided CXX (PAR_INCLUDE) & LDFLAGS (PAR_LIBS) flags)" \
>> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_CXX_FLAGS \"$PAR_INCLUDE\")" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_LD_FLAGS \"$PAR_LINKER_FLAGS\")" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_CXX_FLAGS \"$PAR_INCLUDE\" TYPE STRING)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_LD_FLAGS \"$PAR_LINKER_FLAGS\" TYPE STRING)" >> $HOSTCONF
echo "VISIT_OPTION_DEFAULT(VISIT_MPI_LIBS $PAR_LIBRARY_NAMES)" >> $HOSTCONF
fi
fi
......@@ -8191,7 +8194,7 @@ function build_hostconf
echo "## Static build" >> $HOSTCONF
echo "##" >> $HOSTCONF
echo \
"VISIT_OPTION_DEFAULT(VISIT_STATIC ON)" >> $HOSTCONF
"VISIT_OPTION_DEFAULT(VISIT_STATIC ON TYPE BOOL)" >> $HOSTCONF
fi
echo >> $HOSTCONF
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment