summaryrefslogtreecommitdiffstats
path: root/release_docs/USING_HDF5_CMake.txt
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-10-06 19:09:59 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-10-06 19:09:59 (GMT)
commit8e9b142d9cd347432d400b4f9b3b88a3f047c06d (patch)
tree47f400406beacaac0a987619ee17a7f4ef0bb44d /release_docs/USING_HDF5_CMake.txt
parent8d131aca15bca2d042ef175af5cf5a642d4c1152 (diff)
parent58db7babe40a10916a1c3b7667eaaeb5d48c2fb8 (diff)
downloadhdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.zip
hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.tar.gz
hdf5-8e9b142d9cd347432d400b4f9b3b88a3f047c06d.tar.bz2
[svn-r27976] merge from trunk.
Diffstat (limited to 'release_docs/USING_HDF5_CMake.txt')
-rw-r--r--release_docs/USING_HDF5_CMake.txt82
1 files changed, 57 insertions, 25 deletions
diff --git a/release_docs/USING_HDF5_CMake.txt b/release_docs/USING_HDF5_CMake.txt
index 578f957..c48bca5 100644
--- a/release_docs/USING_HDF5_CMake.txt
+++ b/release_docs/USING_HDF5_CMake.txt
@@ -99,12 +99,12 @@ These steps are described in more detail below.
* MinGW Makefiles
* NMake Makefiles
* Unix Makefiles
- * Visual Studio 12
- * Visual Studio 12 Win64
- * Visual Studio 11
- * Visual Studio 11 Win64
- * Visual Studio 10
- * Visual Studio 10 Win64
+ * Visual Studio 12 2013
+ * Visual Studio 12 2013 Win64
+ * Visual Studio 11 2012
+ * Visual Studio 11 2012 Win64
+ * Visual Studio 10 2010
+ * Visual Studio 10 2010 Win64
<options> is:
* BUILD_TESTING:BOOL=ON
@@ -114,7 +114,7 @@ These steps are described in more detail below.
2.1 Visual CMake users, click the Configure button. If this is the first time you are
running cmake-gui in this directory, you will be prompted for the
- generator you wish to use (for example on Windows, Visual Studio 10).
+ generator you wish to use (for example on Windows, Visual Studio 12 2013).
CMake will read in the CMakeLists.txt files from the source directory and
display options for the HDF5 project. After the first configure you
can adjust the cache settings and/or specify locations of other programs.
@@ -176,8 +176,8 @@ These steps are described in more detail below.
III. Minimum C Project Files for CMake
========================================================================
-Create a CMakeLists.txt file at the source root. Include the
-following text in the file:
+Given the preconditions in section I, create a CMakeLists.txt file at the
+source root. Include the following text in the file:
##########################################################
cmake_minimum_required (VERSION 3.1.0)
@@ -206,18 +206,15 @@ add_test (NAME test_example COMMAND ${example})
IV. APPENDIX
========================================================================
-Below is an example of the ctest script used by The HDF Group. See the
-Appendix in the INSTALL_CMake.txt file for the CTestScript.cmake file used
-by this script. Adjust the values as necessary. Note that the source folder
-is entered on the command line and the build folder is created as a sub-folder.
-Windows should adjust the forward slash to double backslashes, except for
-the HDF_DIR environment variable.
+Below is an example of a ctest script that can be used to build the examples.
+Adjust the values as necessary. Note that the source folder is entered on the
+command line and the build folder is created as a sub-folder. Windows should
+adjust the forward slash to double backslashes, except for the HDF_DIR
+environment variable.
-NOTE: these files are available at the HDF web site:
+NOTE: this file is available at the HDF web site:
http://www.hdfgroup.org/HDF5/release/cmakebuild.html
- CTestScript.cmake
-
HDF518_Examples.cmake
@@ -228,22 +225,24 @@ ctest
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
############################################################################
-# Product specific script, HDF518_Examples.cmake, that uses the
-# CTestScript.cmake file (see Appendix in the CMake.txt). Usage:
+# Product specific script, HDF518_Examples.cmake. Usage:
# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log
# where valid options for OPTION are:
+# BUILD_GENERATOR - The cmake build generator:
+# Unix * Unix Makefiles
+# VS2013 * Visual Studio 12 2013
+# VS201364 * Visual Studio 12 2013 Win64
+# VS2012 * Visual Studio 11 2012
+# VS201264 * Visual Studio 11 2012 Win64
+#
# INSTALLDIR - root folder where hdf5 is installed
# CTEST_BUILD_CONFIGURATION - Release, Debug, etc
# CTEST_SOURCE_NAME - source folder
# STATICLIBRARIES - Build/use static libraries
# NO_MAC_FORTRAN - Yes to be SHARED on a Mac
###############################################################################################################
-
-set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
-#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
-
# handle input parameters to script.
+#BUILD_GENERATOR - which CMake generator to use, required
#INSTALLDIR - HDF5-1.8 root folder
#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF4Examples
@@ -260,8 +259,34 @@ if(DEFINED CTEST_SCRIPT_ARG)
endif()
endforeach()
endif()
+
+# build generator must be defined
+if(NOT DEFINED BUILD_GENERATOR)
+ message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264")
+else()
+ if(${BUILD_GENERATOR} STREQUAL "Unix")
+ set(CMAKE_GENERATOR "Unix Makefiles")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS2013")
+ set(CMAKE_GENERATOR "Visual Studio 12 2013")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
+ set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS2012")
+ set(CMAKE_GENERATOR "Visual Studio 11 2012")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS201264")
+ set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
+ else()
+ message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264")
+ endif()
+endif()
+set(CTEST_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
+set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
+
if(NOT DEFINED INSTALLDIR)
+ if(WIN32)
set(INSTALLDIR "/usr/local/myhdf5")
+ else()
+ set(INSTALLDIR "C:\\Program\ Files\\myhdf5")
+ endif()
endif()
if(NOT DEFINED CTEST_BUILD_CONFIGURATION)
set(CTEST_BUILD_CONFIGURATION "Release")
@@ -272,6 +297,9 @@ endif()
if(NOT DEFINED STATICLIBRARIES)
set(STATICLIBRARIES "YES")
endif()
+if(NOT DEFINED FORTRANLIBRARIES)
+ set(FORTRANLIBRARIES "NO")
+endif()
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
@@ -281,6 +309,10 @@ endif()
###############################################################################################################
# Adjust the following SET Commands as needed
###############################################################################################################
+if(FORTRANLIBRARIES)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
+endif(FORTRANLIBRARIES)
+
if(WIN32)
if(STATICLIBRARIES)
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")