Warning, /education/kalzium/cmake/modules/FindOpenBabel2.cmake is written in an unsupported language. File is not indexed.

0001 # - Try to find OpenBabel2
0002 # Once done this will define
0003 #
0004 #  OPENBABEL2_FOUND - system has OpenBabel2
0005 #  OPENBABEL2_INCLUDE_DIR - the OpenBabel2 include directory
0006 #  OPENBABEL2_LIBRARIES - Link these to use OpenBabel2
0007 # SPDX-FileCopyrightText: 2006, 2009 Pino Toscano <pino@kde.org>
0008 # SPDX-FileCopyrightText: 2006, 2007 Carsten Niehaus <cniehaus@gmx.de>
0009 # SPDX-FileCopyrightText: 2008 Marcus D. Hanwell <marcus@cryos.org>
0010 # SPDX-License-Identifier: BSD-3-Clause
0011 
0012 if (OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL2_VERSION_MET)
0013   # in cache already
0014   set(OPENBABEL2_FOUND TRUE)
0015 
0016 else ()
0017   if(NOT WIN32)
0018 
0019     # Use the newer PkgConfig stuff
0020     find_package(PkgConfig REQUIRED)
0021     pkg_check_modules(PC_OPENBABEL2 openbabel-2.0>=2.2.0)
0022 
0023     if(PC_OPENBABEL2_FOUND)
0024       set(OPENBABEL2_VERSION_MET TRUE)
0025     endif()
0026 
0027   else()
0028     set(OPENBABEL2_VERSION_MET TRUE)
0029   endif()
0030 
0031   if(OPENBABEL2_VERSION_MET)
0032 
0033     find_path(OPENBABEL2_INCLUDE_DIR openbabel/obconversion.h
0034       PATHS
0035       ${PC_OPENBABEL2_INCLUDEDIR}
0036       ${PC_OPENBABEL2_INCLUDE_DIRS}
0037       ${GNUWIN32_DIR}/include
0038       $ENV{OPENBABEL2_INCLUDE_DIR}
0039       PATH_SUFFIXES openbabel-2.0
0040     )
0041 
0042     find_library(OPENBABEL2_LIBRARIES NAMES openbabel openbabel-2
0043       PATHS
0044       ${PC_OPENBABEL2_LIBDIR}
0045       ${PC_OPENBABEL2_LIBRARY_DIRS}
0046       ${GNUWIN32_DIR}/lib
0047       $ENV{OPENBABEL2_LIBRARIES}
0048     )
0049   endif()
0050 
0051   if(OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL2_VERSION_MET)
0052     set(OPENBABEL2_FOUND TRUE)
0053   endif()
0054 
0055   if (OPENBABEL2_FOUND)
0056     if (NOT OpenBabel2_FIND_QUIETLY)
0057       message(STATUS "Found OpenBabel 2.2 or later: ${OPENBABEL2_LIBRARIES}")
0058     endif ()
0059   else ()
0060     if (OpenBabel2_FIND_REQUIRED)
0061       message(FATAL_ERROR "Could NOT find OpenBabel 2.2 or later ")
0062     endif ()
0063   endif ()
0064 
0065   mark_as_advanced(OPENBABEL2_INCLUDE_DIR OPENBABEL2_LIBRARIES)
0066 
0067 endif ()
0068 
0069 # Search for Open Babel2 executable
0070 if(OPENBABEL2_EXECUTABLE)
0071 
0072   # in cache already
0073   set(OPENBABEL2_EXECUTABLE_FOUND TRUE)
0074 
0075 else()
0076   find_program(OPENBABEL2_EXECUTABLE NAMES babel
0077     PATHS
0078     [HKEY_CURRENT_USER\\SOFTWARE\\OpenBabel\ 2.2.0]
0079     $ENV{OPENBABEL2_EXECUTABLE}
0080   )
0081 
0082   if(OPENBABEL2_EXECUTABLE)
0083     set(OPENBABEL2_EXECUTABLE_FOUND TRUE)
0084   endif()
0085 
0086   if(OPENBABEL2_EXECUTABLE_FOUND)
0087     message(STATUS "Found OpenBabel2 executable: ${OPENBABEL2_EXECUTABLE}")
0088   endif()
0089 
0090 endif()
0091