# - Find the Hurricane includes and libraries. # The following variables are set if Hurricane is found. If HURRICANE is not # found, HURRICANE_FOUND is set to false. # HURRICANE_FOUND - True when the Hurricane include directory is found. # HURRICANE_INCLUDE_DIR - the path to where the Hurricane include files are. # HURRICANE_LIBRARIES - The path to where the Hurricane library files are. MACRO(SET_LIBRARIES_PATH configname library) SET(${configname}_FOUND "NOTFOUND") SET(${configname}_STATIC_FOUND "NOTFOUND") IF(${library}_LIBRARY_PATH) SET(${configname}_FOUND "YES") SET(${configname}_INCLUDE_DIR ${${library}_INCLUDE_PATH}) SET(${configname}_LIBRARIES ${${library}_LIBRARY_PATH} ${${configname}_LIBRARIES}) MARK_AS_ADVANCED(${configname}_INCLUDE_DIR ${configname}_LIBRARIES) ENDIF(${library}_LIBRARY_PATH) IF(${library}_STATIC_LIBRARY_PATH) SET(${configname}_STATIC_FOUND "YES") SET(${configname}_INCLUDE_DIR ${${library}_INCLUDE_PATH}) SET(${configname}_STATIC_LIBRARIES ${${library}_STATIC_LIBRARY_PATH} ${${configname}_STATIC_LIBRARIES}) MARK_AS_ADVANCED(${configname}_INCLUDE_DIR ${configname}_STATIC_LIBRARIES) ENDIF(${library}_STATIC_LIBRARY_PATH) IF(NOT ${library}_INCLUDE_PATH) SET(${configname}_FOUND "NOTFOUND") SET(${configname}_STATIC_FOUND "NOTFOUND") ENDIF(NOT ${library}_INCLUDE_PATH) ENDMACRO ( SET_LIBRARIES_PATH ) MACRO(HURRICANE_CHECK_LIBRARIES package) IF(${package}_FOUND OR ${package}_STATIC_FOUND) IF(NOT ${package}_FIND_QUIETLY) IF(${package}_FOUND) MESSAGE(STATUS "Found ${package} : ${${package}_LIBRARIES}") ENDIF(${package}_FOUND) IF(${package}_STATIC_FOUND) MESSAGE(STATUS "Found ${package} (static): ${${package}_STATIC_LIBRARIES}") ENDIF(${package}_STATIC_FOUND) ENDIF(NOT ${package}_FIND_QUIETLY) ELSE(${package}_FOUND OR ${package}_STATIC_FOUND) IF(${package}_FIND_REQUIRED) MESSAGE(FATAL_ERROR "${package} was not found. ${${package}_DIR_MESSAGE}") ENDIF(${package}_FIND_REQUIRED) ENDIF(${package}_FOUND OR ${package}_STATIC_FOUND) ENDMACRO(HURRICANE_CHECK_LIBRARIES) SET(HURRICANE_INCLUDE_PATH_DESCRIPTION "The directory containing the Hurricane include files. E.g /usr/local/include or /asim/coriolis/include") SET(HURRICANE_LIBRARY_PATH_DESCRIPTION "The directory containing the Hurricane library files. E.g /usr/local/lib or /asim/coriolis/lib") SET(HURRICANE_DIR_MESSAGE "Set the HURRICANE_INCLUDE_DIR cmake cache entry to the ${HURRICANE_INCLUDE_PATH_DESCRIPTION}") # don't even bother under WIN32 IF(UNIX) SET(HURRICANE_DIR_SEARCH $ENV{HURRICANE_TOP}) IF(HURRICANE_DIR_SEARCH) FILE(TO_CMAKE_PATH ${HURRICANE_DIR_SEARCH} HURRICANE_DIR_SEARCH) ENDIF(HURRICANE_DIR_SEARCH) # # Look for an installation. # FIND_PATH(HURRICANE_INCLUDE_PATH NAMES hurricane/Cell.h PATHS # Look in other places. ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES include # Help the user find it if we cannot. DOC "${HURRICANE_INCLUDE_PATH_DESCRIPTION}" ) FIND_LIBRARY(HURRICANE_LIBRARY_PATH NAMES hurricane PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES lib # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) FIND_LIBRARY(HURRICANE_STATIC_LIBRARY_PATH NAMES hurricane-static PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES lib # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) FIND_PATH(HURRICANE_GRAPHICAL_INCLUDE_PATH NAMES hurricane/viewer/CellViewer.h hurricane/viewer/HInspectorWidget.h PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES include # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) FIND_LIBRARY(HURRICANE_GRAPHICAL_LIBRARY_PATH NAMES hviewer PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES lib # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) FIND_LIBRARY(HURRICANE_GRAPHICAL_STATIC_LIBRARY_PATH NAMES hviewer-static PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES lib # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) FIND_PATH(HURRICANE_PYTHON_INCLUDE_PATH NAMES hurricane/isobar/PyCell.h PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES include # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) FIND_LIBRARY(HURRICANE_PYTHON_LIBRARY_PATH NAMES isobar PATHS ${HURRICANE_DIR_SEARCH} PATH_SUFFIXES lib # Help the user find it if we cannot. DOC "${HURRICANE_LIBRARY_PATH_DESCRIPTION}" ) SET_LIBRARIES_PATH(HURRICANE HURRICANE) SET_LIBRARIES_PATH(HURRICANE_GRAPHICAL HURRICANE_VIEWER) SET_LIBRARIES_PATH(HURRICANE_PYTHON HURRICANE_PYTHON) HURRICANE_CHECK_LIBRARIES(HURRICANE) ENDIF(UNIX)