source: PSPA/madxPSPA/cmake/FindSDDS.cmake @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 1.5 KB
Line 
1# - Find SDDS Libraries
2# This module finds SDDS libraries if they exist, and sets the following
3# variables:
4#
5#  SDDS_FOUND         - SDDS successfully found, including all libraries it depends on
6#  SDDS_LIBRARIES     - SDDS libraries
7#  SDDS_SEARCH_DIRS   - Additional directories to search in (these are prepended to the list)
8
9message(STATUS "Looking for SDDS libraries")
10set(SDDS_FOUND TRUE)
11# set(SDDS_LIBRARIES )
12set(SDDS_INCLUDE_DIR "")
13# libraries needed to be found:
14set(_SDDS_LIBS SDDS1c  SDDS1 rpnlib mdbmth mdblib gsl)
15
16# directories to search in:
17set(_dirs ${SDDS_SEARCH_DIRS} 
18          /usr/lib/ 
19          /usr/lib64/ 
20          /usr/local/lib/ 
21          /usr/local/lib64)
22
23foreach(_lib ${_SDDS_LIBS})
24    find_library(SDDS_${_lib}_LIB NAMES ${_lib} 
25      PATHS ${_dirs}
26      NO_DEFAULT_PATH
27    )
28    if(NOT SDDS_${_lib}_LIB)
29        message(STATUS "Did not find lib${_lib}")
30        set(SDDS_FOUND FALSE)
31    else()
32        set(SDDS_LIBRARIES ${SDDS_LIBRARIES} ${SDDS_${_lib}_LIB})
33    endif()
34    mark_as_advanced(SDDS_${_lib}_LIB)
35endforeach()
36
37if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
38    # we trust the linker to find this library..
39    set(SDDS_LIBRARIES ${SDDS_LIBRARIES} imf)
40endif()
41
42if(SDDS_FOUND)
43    message(STATUS "Looking for SDDS libraries - found.")
44else()
45    if(SDDS_FIND_REQUIRED)
46        message(FATAL_ERROR "Looking for SDDS libraries - not found.")
47    else()
48        message(STATUS "Looking for SDDS libraries - not found.")
49    endif()
50endif()
51   
Note: See TracBrowser for help on using the repository browser.