Rev | Line | |
---|
[430] | 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 | |
---|
| 9 | message(STATUS "Looking for SDDS libraries") |
---|
| 10 | set(SDDS_FOUND TRUE) |
---|
| 11 | # set(SDDS_LIBRARIES ) |
---|
| 12 | set(SDDS_INCLUDE_DIR "") |
---|
| 13 | # libraries needed to be found: |
---|
| 14 | set(_SDDS_LIBS SDDS1c SDDS1 rpnlib mdbmth mdblib gsl) |
---|
| 15 | |
---|
| 16 | # directories to search in: |
---|
| 17 | set(_dirs ${SDDS_SEARCH_DIRS} |
---|
| 18 | /usr/lib/ |
---|
| 19 | /usr/lib64/ |
---|
| 20 | /usr/local/lib/ |
---|
| 21 | /usr/local/lib64) |
---|
| 22 | |
---|
| 23 | foreach(_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) |
---|
| 35 | endforeach() |
---|
| 36 | |
---|
| 37 | if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel") |
---|
| 38 | # we trust the linker to find this library.. |
---|
| 39 | set(SDDS_LIBRARIES ${SDDS_LIBRARIES} imf) |
---|
| 40 | endif() |
---|
| 41 | |
---|
| 42 | if(SDDS_FOUND) |
---|
| 43 | message(STATUS "Looking for SDDS libraries - found.") |
---|
| 44 | else() |
---|
| 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() |
---|
| 50 | endif() |
---|
| 51 | |
---|
Note: See
TracBrowser
for help on using the repository browser.