| 9 |
|
# Redistribution and use is allowed according to the terms of the BSD license. |
| 10 |
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. |
| 11 |
|
|
| 12 |
– |
include (MacroEnsureVersion) |
| 13 |
– |
|
| 12 |
|
if (OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL2_VERSION_MET) |
| 13 |
|
# in cache already |
| 14 |
|
set(OPENBABEL2_FOUND TRUE) |
| 15 |
|
|
| 16 |
|
else (OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL2_VERSION_MET) |
| 19 |
– |
if(EMBED_OPENBABEL) |
| 20 |
– |
# Building a super-package, rely on the embedded paths |
| 21 |
– |
set(OPENBABEL2_VERSION_MET TRUE) |
| 22 |
– |
set(OPENBABEL2_INCLUDE_DIR ${super_SOURCE_DIR}/openbabel/include ${super_BINARY_DIR}/openbabel/include) |
| 23 |
– |
# This is a kludge -- need to ask Marcus how to handle it better |
| 24 |
– |
find_library(OPENBABEL2_LIBRARIES NAMES openbabel openbabel-2 |
| 25 |
– |
PATHS |
| 26 |
– |
${_obLinkDir} |
| 27 |
– |
${GNUWIN32_DIR}/lib |
| 28 |
– |
$ENV{OPENBABEL2_LIBRARIES} |
| 29 |
– |
) |
| 30 |
– |
else(EMBED_OPENBABEL) |
| 31 |
– |
# Typical case -- find an installed OpenBabel |
| 17 |
|
if(NOT WIN32) |
| 18 |
|
|
| 19 |
|
# Use the newer PkgConfig stuff |
| 20 |
|
find_package(PkgConfig REQUIRED) |
| 21 |
< |
pkg_check_modules(OPENBABEL2 openbabel-2.0>=2.2.2) |
| 21 |
> |
pkg_check_modules(OPENBABEL2 openbabel-2.0>=2.2.0) |
| 22 |
|
|
| 23 |
|
# Maintain backwards compatibility with previous version of module |
| 24 |
|
if(OPENBABEL2_FOUND STREQUAL "1") |
| 32 |
|
|
| 33 |
|
if(OPENBABEL2_VERSION_MET) |
| 34 |
|
|
| 35 |
+ |
# find_path(OPENBABEL2_INCLUDE_DIR openbabel/obconversion.h |
| 36 |
+ |
# PATHS |
| 37 |
+ |
# ${_obIncDir} |
| 38 |
+ |
# ${GNUWIN32_DIR}/include |
| 39 |
+ |
# $ENV{OPENBABEL2_INCLUDE_DIR} |
| 40 |
+ |
# ) |
| 41 |
+ |
|
| 42 |
|
if(WIN32) |
| 43 |
|
if(NOT OPENBABEL2_INCLUDE_DIR) |
| 44 |
|
find_path(OPENBABEL2_INCLUDE_DIR openbabel-2.0/openbabel/obconversion.h |
| 60 |
|
$ENV{OPENBABEL2_LIBRARIES} |
| 61 |
|
) |
| 62 |
|
endif(OPENBABEL2_VERSION_MET) |
| 71 |
– |
endif(EMBED_OPENBABEL) |
| 63 |
|
|
| 64 |
|
if(OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL2_VERSION_MET) |
| 65 |
|
set(OPENBABEL2_FOUND TRUE) |
| 88 |
|
else(OPENBABEL2_EXECUTABLE) |
| 89 |
|
find_program(OPENBABEL2_EXECUTABLE NAMES babel |
| 90 |
|
PATHS |
| 91 |
< |
[HKEY_CURRENT_USER\\SOFTWARE\\OpenBabel\ 2.2.2] |
| 91 |
> |
[HKEY_CURRENT_USER\\SOFTWARE\\OpenBabel\ 2.2.0] |
| 92 |
|
$ENV{OPENBABEL2_EXECUTABLE} |
| 93 |
|
) |
| 94 |
|
|
| 102 |
|
|
| 103 |
|
endif(OPENBABEL2_EXECUTABLE) |
| 104 |
|
|
| 114 |
– |
# Test if we are using trunk |
| 115 |
– |
if(NOT OPENBABEL_IS_NEWER_THAN_2_2_99) |
| 116 |
– |
macro_ensure_version("2.2.99" "${OPENBABEL2_VERSION}" OPENBABEL_IS_NEWER_THAN_2_2_99) |
| 117 |
– |
endif(NOT OPENBABEL_IS_NEWER_THAN_2_2_99) |
| 118 |
– |
if (OPENBABEL_IS_NEWER_THAN_2_2_99) |
| 119 |
– |
add_definitions(-DOPENBABEL_IS_NEWER_THAN_2_2_99) |
| 120 |
– |
endif(OPENBABEL_IS_NEWER_THAN_2_2_99) |