File: FindOpenMM.cmake

package info (click to toggle)
openstructure 2.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,240 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (43 lines) | stat: -rw-r--r-- 1,434 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Try to find OpenMM
#
# Once done this will define
# - Find OpenMM
# Find the native OpenMM includes and library
# 
#  OPEN_MM_INCLUDE_DIR  - OpenMM include dirs.
#  OPEN_MM_LIBRARIES    - List of libraries when using OpenMM.
#  OPEN_MM_FOUND        - True if OpenMM found.
#  OPEN_MM_PLUGIN_DIR   - Default for ressource plugins

if (OPEN_MM_INCLUDE_DIR)
  set(OPEN_MM_FOUND TRUE)
else (OPEN_MM_INCLUDE_DIR)
  find_path (OPEN_MM_INCLUDE_DIR OpenMM.h)
endif (OPEN_MM_INCLUDE_DIR)

if (OPEN_MM_LIBRARY)
  set(OPEN_MM_FOUND TRUE)
else (OPEN_MM_LIBRARY)
  find_library (OPEN_MM_LIBRARY NAMES OpenMM)
endif(OPEN_MM_LIBRARY)

set(OPEN_MM_LIBRARIES ${OPEN_MM_LIBRARY})
set(OPEN_MM_INCLUDE_DIRS ${OPEN_MM_INCLUDE_DIR})

# handle the QUIETLY and REQUIRED arguments and set OpenMM_FOUND to TRUE if 
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (OpenMM DEFAULT_MSG OPEN_MM_LIBRARY OPEN_MM_INCLUDE_DIR)

if (OPEN_MM_LIBRARY)
  set(OPEN_MM_FOUND TRUE)
  if (NOT OPEN_MM_PLUGIN_DIR)
    set(OPEN_MM_PLUGIN_DIR "/usr/local/openmm/lib/plugins")
  endif (NOT OPEN_MM_PLUGIN_DIR)
  if (NOT EXISTS "${OPEN_MM_PLUGIN_DIR}")
    message(FATAL_ERROR "OpenMM plugin directory does not exist: '${OPEN_MM_PLUGIN_DIR}'")
  endif (NOT EXISTS "${OPEN_MM_PLUGIN_DIR}")
endif (OPEN_MM_LIBRARY)

mark_as_advanced (OPEN_MM_LIBRARY OPEN_MM_INCLUDE_DIR OPEN_MM_FOUND
                  OPEN_MM_PLUGIN_DIR)