diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-11-04 18:45:41 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-11-04 18:45:41 (GMT) |
commit | 141383fb261f02c5fab510ffa9b2ff8be11f1cec (patch) | |
tree | afe2beaebfb2aea6750925c64f051a8fa98169de /CMakeLists.txt | |
parent | 9417e52b8be3453b60f7717ab33d42d7d91784a2 (diff) | |
download | hdf5-141383fb261f02c5fab510ffa9b2ff8be11f1cec.zip hdf5-141383fb261f02c5fab510ffa9b2ff8be11f1cec.tar.gz hdf5-141383fb261f02c5fab510ffa9b2ff8be11f1cec.tar.bz2 |
[svn-r21717] Update cmake configuration
Update cmake to generate source folders in VS
Brought parallel changes from trunk
Tested: local linux
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index cb4450e..a0f2f2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ PROJECT (HDF5 C CXX) # # Add the sub project # ADD_SUBDIRECTORY(Utilities/hdf5-1.8) #----------------------------------------------------------------------------- + IF (BUILD_SHARED_LIBS) SET (BUILD_NAME_EXT "SHARED") ELSE (BUILD_SHARED_LIBS) @@ -76,6 +77,21 @@ ELSE (BUILD_SHARED_LIBS) ENDIF (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- +# Allow Visual Studio solution directories +#----------------------------------------------------------------------------- +# Provide a way for Visual Studio Express users to turn OFF the new FOLDER +# organization feature. Default to ON for non-Express users. Express users must +# explicitly turn off this option to build HDF5 in the Express IDE... +# +OPTION (HDF5_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) +MARK_AS_ADVANCED (HDF5_USE_FOLDERS) +IF (HDF5_USE_FOLDERS) + SET_PROPERTY (GLOBAL PROPERTY USE_FOLDERS ON) +ENDIF (HDF5_USE_FOLDERS) +OPTION (HDF5_NO_PACKAGES "CPACK - Disable packaging" OFF) +MARK_AS_ADVANCED (HDF5_NO_PACKAGES) + +#----------------------------------------------------------------------------- # Set the core names of all the libraries #----------------------------------------------------------------------------- SET (HDF5_LIB_CORENAME "hdf5") @@ -389,7 +405,7 @@ IF (CMAKE_COMPILER_IS_GNUCC) IF (CMAKE_BUILD_TYPE MATCHES Debug) SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -finline-functions -fno-common") ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") + SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common") ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) ENDIF (CMAKE_COMPILER_IS_GNUCC) @@ -452,28 +468,25 @@ SET (CMAKE_MODULE_PATH ${HDF5_RESOURCES_DIR} ${CMAKE_MODULE_PATH}) OPTION (HDF5_ENABLE_PARALLEL "Enable parallel build (requires MPI)" OFF) IF (HDF5_ENABLE_PARALLEL) INCLUDE (FindMPI) - INCLUDE_DIRECTORIES (${MPI_INCLUDE_PATH}) - IF (MPI_FOUND) + INCLUDE_DIRECTORIES (${MPI_C_INCLUDE_PATH}) + IF (MPI_C_FOUND) SET (H5_HAVE_PARALLEL 1) - # MPI checks, only do these if MPI_FOUND is true, otherwise they always fail + # MPI checks, only do these if MPI_C_FOUND is true, otherwise they always fail # and once set, they are cached as false and not regenerated - SET (CMAKE_REQUIRED_LIBRARIES "${MPI_LIBRARY};${MPI_EXTRA_LIBRARY}" ) + SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) # Used by Fortran + MPI - CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) - CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) - ENDIF (MPI_FOUND) + CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) + CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) + ENDIF (MPI_C_FOUND) ENDIF (HDF5_ENABLE_PARALLEL) # Parallel IO usage requires MPI to be Linked and Included IF (H5_HAVE_PARALLEL) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_LIBRARY}) - IF (MPI_LINK_FLAGS) - SET (CMAKE_EXE_LINKER_FLAGS ${MPI_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) - ENDIF (MPI_LINK_FLAGS) - IF (MPI_EXTRA_LIBRARY) - SET (LINK_LIBS ${LINK_LIBS} ${MPI_EXTRA_LIBRARY}) - ENDIF (MPI_EXTRA_LIBRARY) + SET (LINK_LIBS ${LINK_LIBS} ${MPI_C_LIBRARIES}) + IF (MPI_C_LINK_FLAGS) + SET (CMAKE_EXE_LINKER_FLAGS ${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}) + ENDIF (MPI_C_LINK_FLAGS) ENDIF (H5_HAVE_PARALLEL) #----------------------------------------------------------------------------- @@ -544,7 +557,7 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (H5_HAVE_LIBZ 1) MESSAGE (STATUS "Filter ZLIB is built") ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") + MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ENDIF (ZLIB_FOUND) ELSE (NOT H5_ZLIB_HEADER) @@ -614,6 +627,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED) ENDIF (HDF5_ENABLE_SZIP_SUPPORT AND SZIP_FOUND) ENDIF (HDF5_PACKAGE_EXTLIBS) ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) + #----------------------------------------------------------------------------- # Option to use threadsafe # Note: Currently CMake only allows configuring of threadsafe on WINDOWS. @@ -627,7 +641,7 @@ IF (WIN32 AND NOT CYGWIN) ENDIF (HDF5_ENABLE_PARALLEL) SET (H5_HAVE_THREADSAFE 1) IF (H5_HAVE_IOEO) - MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7)**** ") + MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7) **** ") SET (H5_HAVE_WIN_THREADS 1) ELSE (H5_HAVE_IOEO) IF (NOT H5_HAVE_PTHREAD_H) |