File: OpenBabel2

package info (click to toggle)
mpqc3 0.0~git20170114-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 148,788 kB
  • ctags: 40,140
  • sloc: cpp: 545,687; ansic: 13,220; perl: 5,065; fortran: 1,990; lisp: 1,269; python: 717; yacc: 392; sh: 304; f90: 238; lex: 184; xml: 182; makefile: 106
file content (40 lines) | stat: -rw-r--r-- 1,392 bytes parent folder | download | duplicates (2)
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
# -*- mode: cmake -*-

# find and setup openbabel
find_package(OpenBabel2)

if (OPENBABEL2_FOUND)

    set(CMAKE_REQUIRED_INCLUDES_BACKUP ${CMAKE_REQUIRED_INCLUDES})
    set(CMAKE_REQUIRED_LIBRARIES_BACKUP ${CMAKE_REQUIRED_LIBRARIES})
    list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENBABEL2_INCLUDE_DIR})
    list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENBABEL2_LIBRARIES})

    # sanity check: try compiling a simple program
    CHECK_CXX_SOURCE_COMPILES(
      "
      #include <openbabel/mol.h>
      #include <openbabel/obconversion.h>
      int main(int argc, char* argv[]) {
        OpenBabel::OBConversion conv;
        return 0;
      }
      "  OPENBABEL2_COMPILES)
    
    if (OPENBABEL2_COMPILES)
      set(HAVE_OPENBABEL2 TRUE)
      message(STATUS "Found OpenBabel2:")
      message(STATUS "\tOPENBABEL2_LIBRARIES: ${OPENBABEL2_LIBRARIES}")
      message(STATUS "\tOPENBABEL2_INCLUDE_DIR: ${OPENBABEL2_INCLUDE_DIR}")
      include_directories(${OPENBABEL2_INCLUDE_DIR})
    else(OPENBABEL2_COMPILES)
      set(HAVE_OPENBABEL2 FALSE)
      unset(OPENBABEL2_INCLUDE_DIR CACHE)
      unset(OPENBABEL2_LIBRARIES CACHE)
      message("**Could not compile OpenBabel2 test program.\n**See CMakeFiles/CMakeError.log for details")
    endif()
    
    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_BACKUP})
    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_BACKUP})

endif()