tFindParallelIO.cmake - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch) (HTM) git clone git://src.adamsgaard.dk/pism (DIR) Log (DIR) Files (DIR) Refs (DIR) LICENSE --- tFindParallelIO.cmake (1642B) --- 1 # - Find ParallelIO 2 # Find ParallelIO includes and library 3 # 4 # ParallelIO_INCLUDES - where to find pio.h 5 # ParallelIO_LIBRARIES - List of libraries to link with when using ParallelIO 6 # ParallelIO_FOUND - True if ParallelIO was found 7 8 if (ParallelIO_INCLUDES) 9 # Already in cache, be silent 10 set (ParallelIO_FIND_QUIETLY TRUE) 11 endif (ParallelIO_INCLUDES) 12 13 find_path (ParallelIO_INCLUDES pio.h 14 HINTS "${ParallelIO_ROOT}/include" "$ENV{ParallelIO_ROOT}/include") 15 16 string(REGEX REPLACE "/include/?$" "/lib" 17 ParallelIO_LIB_HINT ${ParallelIO_INCLUDES}) 18 19 find_library (ParallelIO_LIB 20 NAMES pioc 21 HINTS ${ParallelIO_LIB_HINT}) 22 23 if ((NOT ParallelIO_LIB) OR (NOT ParallelIO_INCLUDES)) 24 message(STATUS "Trying to find ParallelIO using LD_LIBRARY_PATH (we're desperate)...") 25 26 file(TO_CMAKE_PATH "$ENV{LD_LIBRARY_PATH}" LD_LIBRARY_PATH) 27 28 find_library(ParallelIO_LIB 29 NAMES pioc 30 HINTS ${LD_LIBRARY_PATH}) 31 32 if (ParallelIO_LIB) 33 get_filename_component(ParallelIO_LIB_DIR ${ParallelIO_LIB} PATH) 34 string(REGEX REPLACE "/lib/?$" "/include" 35 ParallelIO_H_HINT ${ParallelIO_LIB_DIR}) 36 37 find_path (ParallelIO_INCLUDES pio.h 38 HINTS ${ParallelIO_H_HINT} 39 DOC "Path to pio.h") 40 endif() 41 endif() 42 43 if (ParallelIO_LIB AND ParallelIO_INCLUDES) 44 set (ParallelIO_LIBRARIES "${ParallelIO_LIB}") 45 endif() 46 47 # handle the QUIETLY and REQUIRED arguments and set ParallelIO_FOUND to TRUE if 48 # all listed variables are TRUE 49 include (FindPackageHandleStandardArgs) 50 find_package_handle_standard_args (ParallelIO DEFAULT_MSG ParallelIO_LIBRARIES ParallelIO_INCLUDES) 51 52 mark_as_advanced (ParallelIO_LIB ParallelIO_INCLUDES)