Update reference files for CMake options

This commit is contained in:
Allen Byrne 2018-01-29 12:40:52 -06:00
parent 468fbc36f1
commit f837afc875
7 changed files with 158 additions and 169 deletions

View File

@ -99,7 +99,7 @@ and/or accompanying materials:
HDF5 is available with the SZIP compression library but SZIP is not part
of HDF5 and has separate copyright and license terms. See “Szip Compression
in HDF Products” (www.hdfgroup.org/doc_resource/SZIP/) for further details.
in HDF Products” (https://support.hdfgroup.org/doc_resource/SZIP/) for further details.
-----------------------------------------------------------------------------

View File

@ -63,13 +63,6 @@ if (APPLE)
set (ENV{CC} "${XCODE_CC}")
set (ENV{CXX} "${XCODE_CXX}")
if (NOT NO_MAC_FORTRAN)
# Shared fortran is not supported, build static
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
else ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
endif ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif ()

View File

@ -64,13 +64,6 @@ if (APPLE)
set (ENV{CC} "${XCODE_CC}")
set (ENV{CXX} "${XCODE_CXX}")
if (NOT NO_MAC_FORTRAN)
# Shared fortran is not supported, build static
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
else ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
endif ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif ()

View File

@ -32,10 +32,6 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR)
# INSTALLDIR - root folder where hdf5 is installed
# CTEST_CONFIGURATION_TYPE - Release, Debug, etc
# CTEST_SOURCE_NAME - source folder
# STATIC_ONLY - Build/use static libraries
# FORTRAN_LIBRARIES - Build/use fortran libraries
# JAVA_LIBRARIES - Build/use java libraries
# NO_MAC_FORTRAN - Yes to be SHARED on a Mac
##############################################################################
set (CTEST_SOURCE_VERSION "1.11.2")
@ -47,10 +43,6 @@ set (CTEST_SOURCE_VERSEXT "")
#INSTALLDIR - HDF5-1.10.0 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0
#STATIC_ONLY - Default is YES
#FORTRAN_LIBRARIES - Default is NO
#JAVA_LIBRARIES - Default is NO
#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
@ -70,6 +62,7 @@ endif ()
###################################################################
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
### (default use command line -C value)
set (CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
###################################################################
@ -86,21 +79,6 @@ endif ()
if (NOT DEFINED CTEST_SOURCE_NAME)
set (CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
endif ()
if (NOT DEFINED STATIC_ONLY)
set (STATICONLYLIBRARIES "YES")
else ()
set (STATICONLYLIBRARIES "NO")
endif ()
if (NOT DEFINED FORTRAN_LIBRARIES)
set (FORTRANLIBRARIES "NO")
else ()
set(FORTRANLIBRARIES "YES")
endif ()
if (NOT DEFINED JAVA_LIBRARIES)
set (JAVALIBRARIES "NO")
else ()
set (JAVALIBRARIES "YES")
endif ()
set (CTEST_BINARY_NAME "build")
set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
@ -212,34 +190,6 @@ set (REPOSITORY_BRANCH "develop")
#set(CTEST_USE_TAR_SOURCE "${CTEST_SOURCE_VERSION}")
###################################################################
###################################################################
if (${STATICONLYLIBRARIES})
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
######### Following describes computer ############
## following is optional to describe build ##
set (SITE_BUILDNAME_SUFFIX "STATIC")
endif ()
###################################################################
#### fortran ####
if (${FORTRANLIBRARIES})
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
else ()
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
endif ()
#### java ####
if (${JAVALIBRARIES})
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
else ()
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
endif ()
### change install prefix
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=$ENV{CMAKE_CONFIG_TYPE}")
###################################################################

View File

@ -20,6 +20,32 @@
#### alternate toolsets ####
#set(CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler 17.0")
#############################################################################################
#### Only build static libraries ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
#### Add PICC option on linux/mac ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
#############################################################################################
#### fortran enabled ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
#### fortran disabled ####
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=OFF")
#############################################################################################
#### java enabled ####
#set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=ON")
#### java disabled ####
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_JAVA:BOOL=OFF")
#############################################################################################
### change install prefix (default use INSTALLDIR value)
set (ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALLDIR}")
#############################################################################################
#### ext libraries ####

View File

@ -664,10 +664,6 @@ cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR)
# INSTALLDIR - root folder where hdf5 is installed
# CTEST_CONFIGURATION_TYPE - Release, Debug, etc
# CTEST_SOURCE_NAME - source folder
# STATIC_ONLY - Build/use static libraries
# FORTRAN_LIBRARIES - Build/use fortran libraries
# JAVA_LIBRARIES - Build/use java libraries
# NO_MAC_FORTRAN - Yes to be SHARED on a Mac
##############################################################################
set (CTEST_SOURCE_VERSION "1.11.0")
@ -679,10 +675,6 @@ set (CTEST_SOURCE_VERSEXT "")
#INSTALLDIR - HDF5-1.10.0 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF5-1.10.0
#STATIC_ONLY - Default is YES
#FORTRAN_LIBRARIES - Default is NO
#JAVA_LIBRARIES - Default is NO
#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2

View File

@ -219,129 +219,113 @@ NOTE: this file is available at the HDF web site:
http://www.hdfgroup.org/HDF5/release/cmakebuild.html
HDF5_Examples.cmake
HDF5_Examples_options.cmake
Also available at the HDF web site is a CMake application framework template.
You can quickly add files to the framework and execute the script to compile
your application with an installed HDF5 binary.
========================================================================
ctest
ctest use of HDF5_Examples.cmake and HDF5_Examples_options.cmake
========================================================================
cmake_minimum_required(VERSION 3.2.2 FATAL_ERROR)
###############################################################################################################
# This script will build and run the examples from a folder
# Execute from a command line:
# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -V -O test.log
# ctest -S HDF5_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log
###############################################################################################################
set (CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set (CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
if("@CMAKE_GENERATOR_TOOLSET@")
set(CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
endif()
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
# handle input parameters to script.
#INSTALLDIR - HDF5 root folder
#CTEST_CONFIGURATION_TYPE - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF4Examples
#STATIC_ONLY - Default is YES
#FORTRAN_LIBRARIES - Default is NO
#JAVA_LIBRARIES - Default is NO
##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac)
if (DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
# to variables with the respective names set to the respective values
string (REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
foreach (current_var ${script_args})
if ("${current_var}" MATCHES "^([^=]+)=(.+)$")
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
endif ()
endforeach ()
endif ()
if (NOT DEFINED INSTALLDIR)
set (INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
endif ()
if (NOT DEFINED CTEST_CONFIGURATION_TYPE)
set (CTEST_CONFIGURATION_TYPE "Release")
endif ()
if (NOT DEFINED CTEST_SOURCE_NAME)
set (CTEST_SOURCE_NAME "HDF5Examples")
endif ()
if (NOT DEFINED STATIC_ONLY)
set (STATICONLYLIBRARIES "YES")
else ()
set (STATICONLYLIBRARIES "NO")
endif ()
if (NOT DEFINED FORTRAN_LIBRARIES)
set (FORTRANLIBRARIES "NO")
else ()
set (FORTRANLIBRARIES "YES")
endif ()
if (NOT DEFINED JAVA_LIBRARIES)
set (JAVALIBRARIES "NO")
else ()
set (JAVALIBRARIES "YES")
endif ()
#CTEST_SOURCE_NAME - name of source folder; HDF5Examples
if(DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
# to variables with the respective names set to the respective values
string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
foreach(current_var ${script_args})
if("${current_var}" MATCHES "^([^=]+)=(.+)$")
set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
endif()
endforeach()
endif()
###################################################################
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
if(NOT DEFINED CTEST_CONFIGURATION_TYPE)
set(CTEST_CONFIGURATION_TYPE "Release")
endif()
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCTEST_CONFIGURATION_TYPE:STRING=${CTEST_CONFIGURATION_TYPE}")
##################################################################
if(NOT DEFINED INSTALLDIR)
set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
endif()
if(NOT DEFINED CTEST_SOURCE_NAME)
set(CTEST_SOURCE_NAME "HDF5Examples")
endif()
if(NOT DEFINED HDF_LOCAL)
set(CDASH_LOCAL "NO")
else()
set(CDASH_LOCAL "YES")
endif()
if(NOT DEFINED CTEST_SITE)
set(CTEST_SITE "local")
endif()
if(NOT DEFINED CTEST_BUILD_NAME)
set(CTEST_BUILD_NAME "examples")
endif()
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DSITE:STRING=${CTEST_SITE} -DBUILDNAME:STRING=${CTEST_BUILD_NAME}")
#TAR_SOURCE - name of tarfile
#if (NOT DEFINED TAR_SOURCE)
# set (CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.1-Source")
#endif ()
#if(NOT DEFINED TAR_SOURCE)
# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.10.5-Source")
#endif()
###############################################################################################################
# Adjust the following SET Commands as needed
###############################################################################################################
if (WIN32)
if (${STATICONLYLIBRARIES})
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
endif ()
set (ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else (WIN32)
if (${STATICONLYLIBRARIES})
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
endif ()
set (ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
set (ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set (CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif(WIN32)
if (${FORTRANLIBRARIES})
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
else ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
endif ()
if (${JAVALIBRARIES})
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON")
else ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=OFF")
endif ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
if(WIN32)
set(SITE_OS_NAME "Windows")
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else()
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif()
if(${CDASH_LOCAL})
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCDASH_LOCAL:BOOL=ON")
endif()
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
###############################################################################################################
# For any comments please contact cdashhelp@hdfgroup.org
#
###############################################################################################################
#-----------------------------------------------------------------------------
# MAC machines need special option
#-----------------------------------------------------------------------------
if (APPLE)
# Compiler choice
execute_process (COMMAND xcrun --find cc OUTPUT_VARIABLE XCODE_CC OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND xcrun --find c++ OUTPUT_VARIABLE XCODE_CXX OUTPUT_STRIP_TRAILING_WHITESPACE)
set (ENV{CC} "${XCODE_CC}")
set (ENV{CXX} "${XCODE_CXX}")
if (NOT NO_MAC_FORTRAN)
# Shared fortran is not supported, build static
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
else ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
endif ()
set (BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif ()
#############################################################################################
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format for file: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#############################################################################################
if(WIN32)
include(${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake)
else()
include(${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake)
endif()
#-----------------------------------------------------------------------------
set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
@ -415,6 +399,57 @@ endif ()
#-----------------------------------------------------------------------------
##############################################################################################################
##############################################################################################################
#### HDF5_Examples_options.cmake ###
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
##############################################################################################################
#############################################################################################
#### Change default configuration of options in config/cmake/cacheinit.cmake file ###
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ") ###
#### DEFAULT: ###
#### BUILD_SHARED_LIBS:BOOL=OFF ###
#### HDF_BUILD_C:BOOL=ON ###
#### HDF_BUILD_CXX:BOOL=OFF ###
#### HDF_BUILD_FORTRAN:BOOL=OFF ###
#### HDF_BUILD_JAVA:BOOL=OFF ###
#### BUILD_TESTING:BOOL=OFF ###
#### HDF_ENABLE_PARALLEL:BOOL=OFF ###
#### HDF_ENABLE_THREADSAFE:BOOL=OFF ###
#############################################################################################
### uncomment/comment and change the following lines for other configuration options
### build with shared libraries
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=ON")
#############################################################################################
#### languages ####
### disable C builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_C:BOOL=OFF")
### enable C++ builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_CXX:BOOL=ON")
### enable Fortran builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
### enable JAVA builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_JAVA:BOOL=ON")
#############################################################################################
### enable parallel program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_PARALLEL:BOOL=ON")
#############################################################################################
### enable threadsafe program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_ENABLE_THREADSAFE:BOOL=ON")
#############################################################################################
### enable test program builds, requires reference files in testfiles subdirectory
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=ON")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DCOMPARE_TESTING:BOOL=ON")
#############################################################################################
========================================================================