added HDF4 ISIS NeXus class handling.
This commit is contained in:
@@ -1,97 +0,0 @@
|
||||
## Process this file with cmake
|
||||
#=============================================================================
|
||||
# NeXus - Neutron & X-ray Common Data Format
|
||||
#
|
||||
# CMakeLists for building the NeXus library and applications.
|
||||
#
|
||||
# Copyright (C) 2011 Stephen Rankin
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by the
|
||||
# Free Software Foundation; either version 2 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This library is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this library; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# For further information, see <http://www.nexusformat.org>
|
||||
#
|
||||
#
|
||||
#=============================================================================
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# find the runtime binaries of the HDF4 library
|
||||
#------------------------------------------------------------------------------
|
||||
find_library(HDF4_DF_LIBRARY NAMES df hdf
|
||||
HINTS ENV HDF4_ROOT
|
||||
PATH_SUFFIXES hdf)
|
||||
|
||||
|
||||
if(HDF4_DF_LIBRARY MATCHES HDF4_DF_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "Could not find HDF4 DF library!")
|
||||
else()
|
||||
get_filename_component(HDF4_LIBRARY_DIRS ${HDF4_DF_LIBRARY} PATH)
|
||||
message(STATUS "Found HDF4 DF library: ${HDF4_DF_LIBRARY}")
|
||||
message(STATUS "HDF4 libary path: ${HDF4_LIBRARY_DIRS}")
|
||||
endif()
|
||||
|
||||
find_library(HDF4_MFHDF_LIBRARY NAMES mfhdf
|
||||
HINTS ENV HDF4_ROOT
|
||||
PATH_SUFFIXES hdf)
|
||||
|
||||
if(HDF4_MFHDF_LIBRARY MATCHES HDF4_MFHDF_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "Could not find HDF5 MFHDF library!")
|
||||
else()
|
||||
message(STATUS "Found HDF4 MFHDF library: ${HDF4_MFHDF_LIBRARY}")
|
||||
endif()
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# find the HDF4 header file
|
||||
#------------------------------------------------------------------------------
|
||||
find_path(HDF4_INCLUDE_DIRS mfhdf.h
|
||||
HINTS ENV HDF4_ROOT
|
||||
PATH_SUFFIXES hdf)
|
||||
|
||||
if(HDF4_INCLUDE_DIRS MATCHES HDF4_INCLUDE_DIRS-NOTFOUND)
|
||||
message(FATAL_ERROR "Could not find HDF4 header files")
|
||||
else()
|
||||
message(STATUS "Found HDF4 header files in: ${HDF4_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# search for additional packages required to link against HDF4
|
||||
#------------------------------------------------------------------------------
|
||||
find_package(JPEG REQUIRED)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# add libraries to the link list for NAPI
|
||||
#------------------------------------------------------------------------------
|
||||
get_filename_component(LIB_EXT ${HDF4_DF_LIBRARY} EXT)
|
||||
if(LIB_EXT MATCHES .a)
|
||||
message(STATUS "HDF4 DF library is static")
|
||||
list(APPEND NAPI_LINK_LIBS "-Wl,-whole-archive" ${HDF4_DF_LIBRARY} "-Wl,-no-whole-archive")
|
||||
else()
|
||||
list(APPEND NAPI_LINK_LIBS ${HDF4_DF_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
get_filename_component(LIB_EXT ${HDF4_MFHDF_LIBRARY} EXT)
|
||||
if(LIB_EXT MATCHES .a)
|
||||
message(STATUS "HDF4 MFHDF library is static")
|
||||
list(APPEND NAPI_LINK_LIBS "-Wl,-whole-archive" ${HDF4_MFHDF_LIBRARY} "-Wl,-no-whole-archive")
|
||||
else()
|
||||
list(APPEND NAPI_LINK_LIBS ${HDF4_MFHDF_LIBRARY})
|
||||
endif()
|
||||
|
||||
list(APPEND NAPI_LINK_LIBS jpeg)
|
||||
|
||||
include_directories ( SYSTEM ${HDF4_INCLUDE_DIRS} )
|
||||
link_directories(${HDF4_LIBRARY_DIRS})
|
||||
@@ -1,34 +0,0 @@
|
||||
# - find MXML
|
||||
# find the MXML lib and includes
|
||||
# This module defines
|
||||
# LIBMXML_INCLUDE_DIR, where to find mxml.h
|
||||
# LIBMXML_LIBRARY, library to link against
|
||||
# LIBMXML_FOUND, if false, do not try to use the MXML lib
|
||||
|
||||
find_path(LIBMXML_INCLUDE_DIR mxml.h
|
||||
HINT "/usr/include"
|
||||
)
|
||||
# find position of mxml.h from the end
|
||||
string(FIND "${LIBMXML_INCLUDE_DIR}" "/mxml.h" pos REVERSE)
|
||||
# truncate the string
|
||||
string(SUBSTRING "${LIBMXML_INCLUDE_DIR}" 0 ${pos} substr)
|
||||
set(LIBMXML_INCLUDE_DIR ${substr})
|
||||
unset(substr)
|
||||
|
||||
find_library(LIBMXML_LIBRARY mxml)
|
||||
|
||||
# get version string
|
||||
# currently do not know from where to get it automatically
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBMXML_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MXML
|
||||
REQUIRED_VARS LIBMXML_LIBRARY LIBMXML_INCLUDE_DIR)
|
||||
|
||||
if (NOT LIBMXML_FOUND)
|
||||
unset(LIBMXML_LIBRARY)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBMXML_INCLUDE_DIR LIBMXML_LIBRARY)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
# - Find NeXus library
|
||||
# Find the native NEXUS includes and library
|
||||
# This module defines
|
||||
# NEXUS_INCLUDE_DIR, where to find NeXus.h, etc.
|
||||
# NEXUS_LIBRARY, library to link against to use NEXUS
|
||||
# NEXUS_FOUND, if false, do not try to use NEXUS.
|
||||
|
||||
find_path(NEXUS_INCLUDE_DIR napi.h
|
||||
HINTS "/usr/local/include" "/opt/nexus/include" "/usr/local/include/nexus"
|
||||
)
|
||||
# find position of napi.h from the end
|
||||
string(FIND "${NEXUS_INCLUDE_DIR}" "/napi.h" pos REVERSE)
|
||||
# truncate the string
|
||||
string(SUBSTRING "${NEXUS_INCLUDE_DIR}" 0 ${pos} substr)
|
||||
set(NEXUS_INCLUDE_DIR ${substr})
|
||||
unset(substr)
|
||||
|
||||
find_library(NEXUS_LIBRARY NeXus
|
||||
HINTS "/usr/lib" "/usr/lib64" "/usr/local/lib" "/usr/local/lib64" "/opt/nexus/lib")
|
||||
|
||||
# get version string
|
||||
if (NEXUS_INCLUDE_DIR AND EXISTS ${NEXUS_INCLUDE_DIR}/napi.h)
|
||||
file(STRINGS "${NEXUS_INCLUDE_DIR}/napi.h" NEXUS_version_str
|
||||
REGEX "^#define[\t ]+NEXUS_VERSION[\t ].*")
|
||||
|
||||
string(REGEX REPLACE "^#define[\t ]+NEXUS_VERSION[\t ]+\"([^\"]*).*"
|
||||
"\\1" NEXUS_VERSION_STRING "${NEXUS_version_str}")
|
||||
unset(NEXUS_version_str)
|
||||
endif()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set NEXUS_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NEXUS
|
||||
REQUIRED_VARS NEXUS_LIBRARY NEXUS_INCLUDE_DIR
|
||||
VERSION_VAR NEXUS_VERSION_STRING)
|
||||
|
||||
if (NOT NEXUS_FOUND)
|
||||
unset(NEXUS_LIBRARY)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NEXUS_INCLUDE_DIR NEXUS_LIBRARY)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user