From d3e41b00156187f5ed0adce65cc316001747c278 Mon Sep 17 00:00:00 2001 From: root <root@chamcham.ncbs.res.in> Date: Sat, 19 Nov 2016 09:32:54 +0000 Subject: [PATCH] Changes to cmake file so that we can find the correct static library. --- moose-core/CMakeLists.txt | 21 +++++++++++++-------- moose-core/VERSION | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/moose-core/CMakeLists.txt b/moose-core/CMakeLists.txt index 4cb79023..1be40102 100644 --- a/moose-core/CMakeLists.txt +++ b/moose-core/CMakeLists.txt @@ -218,16 +218,21 @@ if(NOT HDF5_FOUND) endif(NOT HDF5_FOUND) if(HDF5_FOUND) + include_directories( ${HDF5_INCLUDE_DIRS} ) add_definitions( -DUSE_HDF5 ) - # Latest cmake could not find libhdf5_hl.a libraries despite of setting - # USE_HDF5_STATIC_LIBRARIES. - if(USE_HDF5_STATIC_LIBRARIES AND $ENV{HDF5_ROOT}) - find_library(HDF5_CXX_LIBRARIES libhdf5.a PATHS $ENV{HDF5_ROOT}) - find_library(HDF5_HL_LIBRARIES libhdf5_hl.a PATHS $ENV{HDF5_ROOT}) + if(HDF5_USE_STATIC_LIBRARIES) + message(STATUS "Finding static HDF5 libraries in $ENV{HDF5_ROOT}") + find_library(HDF5_CXX_LIBRARIES NAMES libhdf5.a + PATHS $ENV{HDF5_ROOT}/lib $ENV{HDF5_ROOT}/lib64 + ) + find_library(HDF5_HL_LIBRARIES NAMES libhdf5_hl.a + PATHS $ENV{HDF5_ROOT}/lib $ENV{HDF5_ROOT}/lib64 + ) endif() - - include_directories( ${HDF5_INCLUDE_DIRS} ) - foreach(HDF5_LIB ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES} ) + + set(HDF5_LIBRARIES ${HDF5_CXX_LIBRARIES} ${HDF5_HL_LIBRARIES}) + message(STATUS "MOOSE will use ${HDF5_LIBRARIES}" ) + foreach(HDF5_LIB ${HDF5_LIBRARIES}) if(HDF5_LIB) get_filename_component( HDF5_LIB_EXT ${HDF5_LIB} EXT ) if(HDF5_LIB_EXT) diff --git a/moose-core/VERSION b/moose-core/VERSION index 753fb504..50e47c89 100644 --- a/moose-core/VERSION +++ b/moose-core/VERSION @@ -1 +1 @@ -3.1.1-55-g1cd7d7e \ No newline at end of file +3.1.1 \ No newline at end of file -- GitLab