From d2696b8300eae97f946c09d5bd592c77763e7edb Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Sat, 29 Mar 2008 18:04:43 +0100 Subject: [PATCH] Adding the cmake subdir --- cmake/modules/COPYING-CMAKE-SCRIPTS | 22 ++++++ cmake/modules/FindBoostPython.cmake | 134 ++++++++++++++++++++++++++++++++++++ cmake/modules/FindCFitsio.cmake | 53 ++++++++++++++ cmake/modules/FindLibfacile.cmake | 49 +++++++++++++ cmake/modules/FindNova.cmake | 43 ++++++++++++ cmake/modules/FindOCaml.cmake | 61 ++++++++++++++++ cmake/modules/FindOpenBabel2.cmake | 107 ++++++++++++++++++++++++++++ cmake/modules/FindReadline.cmake | 15 ++++ cmake/modules/FindSBIG.cmake | 32 +++++++++ 9 files changed, 516 insertions(+) create mode 100644 cmake/modules/COPYING-CMAKE-SCRIPTS create mode 100644 cmake/modules/FindBoostPython.cmake create mode 100644 cmake/modules/FindCFitsio.cmake create mode 100644 cmake/modules/FindLibfacile.cmake create mode 100644 cmake/modules/FindNova.cmake create mode 100644 cmake/modules/FindOCaml.cmake create mode 100644 cmake/modules/FindOpenBabel2.cmake create mode 100644 cmake/modules/FindReadline.cmake create mode 100644 cmake/modules/FindSBIG.cmake diff --git a/cmake/modules/COPYING-CMAKE-SCRIPTS b/cmake/modules/COPYING-CMAKE-SCRIPTS new file mode 100644 index 0000000..4b41776 --- /dev/null +++ b/cmake/modules/COPYING-CMAKE-SCRIPTS @@ -0,0 +1,22 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cmake/modules/FindBoostPython.cmake b/cmake/modules/FindBoostPython.cmake new file mode 100644 index 0000000..97696bd --- /dev/null +++ b/cmake/modules/FindBoostPython.cmake @@ -0,0 +1,134 @@ +# - Try to find the a valid boost+python combination +# Once done this will define +# +# BOOST_PYTHON_FOUND - system has a valid boost+python combination +# BOOST_PYTHON_INCLUDES - the include directory for boost+python +# BOOST_PYTHON_LIBS - the needed libs for boost+python + +# Copyright (c) 2006, Pino Toscano, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(BOOST_PYTHON_INCLUDES AND BOOST_PYTHON_LIBS) + # Already in cache, be silent + set(BOOST_PYTHON_FIND_QUIETLY TRUE) +endif(BOOST_PYTHON_INCLUDES AND BOOST_PYTHON_LIBS) + +# some needed includes +include(CheckCXXSourceCompiles) +include(CheckIncludeFileCXX) +include(CheckLibraryExists) + +# reset vars +set(BOOST_PYTHON_INCLUDES) +set(BOOST_PYTHON_LIBS) + +# handy arrays +set(PYTHON_VERSIONS "python;python2.5;python2.4;python2.3;python2.2") +set(PYTHON_INCLUDE_DIRS "/usr/include/$pyver;/usr/local/include/$pyver;/usr/$pyver/include;/usr/local/$pyver/include;$prefix/include/$pyver;$prefix/$pyver/include") +set(PYTHON_LIBRARY_DIRS "/usr/lib${LIB_SUFFIX};/usr/local/lib${LIB_SUFFIX};/usr/lib${LIB_SUFFIX}/$pyver/config") +set(PYTHON_LIBS "boost_python-gcc-mt;boost_python-mt;boost_python-gcc-mt-1_33;boost_python-gcc-mt-1_33_1;boost_python;boost_python-gcc-mt-1_32;boost_python") + +# 1st: check for boost/shared_ptr.hpp +check_include_file_cxx(boost/shared_ptr.hpp HAVE_BOOST_SHARED_PTR_HPP) + +if(HAVE_BOOST_SHARED_PTR_HPP) + + set(_found FALSE) + + # save the old flags and setting the new ones + set(_save_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}") + + foreach(_pyver ${PYTHON_VERSIONS}) + if(NOT _found) + foreach(_pydir ${PYTHON_INCLUDE_DIRS}) + + if(NOT _found) + string(REPLACE "$pyver" "${_pyver}" _pydir ${_pydir}) + string(REPLACE "$prefix" "${CMAKE_INSTALL_PREFIX}" _pydir ${_pydir}) + + if(EXISTS ${_pydir}) + if(EXISTS ${_pydir}/Python.h) + + foreach(_pylibdir ${PYTHON_LIBRARY_DIRS}) + + if(NOT _found) + string(REPLACE "$pyver" ${_pyver} _pylibdir ${_pylibdir}) + + foreach(_pblib ${PYTHON_LIBS}) + + if(NOT _found) + + set(CMAKE_REQUIRED_FLAGS "-L${_pylibdir}") + set(CMAKE_REQUIRED_INCLUDES ${_pydir}) + set(CMAKE_REQUIRED_LIBRARIES ${_pblib} ${_pyver}) + + check_cxx_source_compiles(" +#include +const char* greet() { return \"Hello world!\"; } +BOOST_PYTHON_MODULE(hello) { boost::python::def(\"greet\", greet); } + +int main() { return 0; } + +// some vars, in case of the compilation fail... +// python include dir: ${_pydir} +// python lib dir: ${_pylibdir} +// boost python lib: ${_pblib} + +" boost_python_${_pylibdir}_${_pydir}_${_pblib}_compile ) + + set(CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + + if(boost_python_${_pylibdir}_${_pydir}_${_pblib}_compile) + + set(_found TRUE) + + set(BOOST_PYTHON_INCLUDES ${_pydir}) + set(BOOST_PYTHON_LIBS "-l${_pyver} -L${_pylibdir} -l${_pblib}") + + endif(boost_python_${_pylibdir}_${_pydir}_${_pblib}_compile) + + endif(NOT _found) + + endforeach(_pblib ${PYTHON_LIBS}) + + endif(NOT _found) + + endforeach(_pylibdir ${PYTHON_LIBRARY_DIRS}) + + endif(EXISTS ${_pydir}/Python.h) + endif(EXISTS ${_pydir}) + + endif(NOT _found) + + endforeach(_pydir ${PYTHON_INCLUDE_DIRS}) + + endif(NOT _found) + + endforeach(_pyver ${PYTHON_VERSIONS}) + + set(CMAKE_CXX_FLAGS ${_save_CMAKE_CXX_FLAGS}) + +endif(HAVE_BOOST_SHARED_PTR_HPP) + +if(BOOST_PYTHON_INCLUDES AND BOOST_PYTHON_LIBS) + set(BOOST_PYTHON_FOUND TRUE) +endif(BOOST_PYTHON_INCLUDES AND BOOST_PYTHON_LIBS) + +if(BOOST_PYTHON_FOUND) + if(NOT BoostPython_FIND_QUIETLY) + message(STATUS "Found Boost+Python: ${BOOST_PYTHON_LIBS}") + endif(NOT BoostPython_FIND_QUIETLY) + set(KIG_ENABLE_PYTHON_SCRIPTING 1) +else (BOOST_PYTHON_FOUND) + if (BoostPython_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find Boost+Python") + endif(BoostPython_FIND_REQUIRED) + set(KIG_ENABLE_PYTHON_SCRIPTING 0) +endif(BOOST_PYTHON_FOUND) + +mark_as_advanced(BOOST_PYTHON_INCLUDES BOOST_PYTHON_LIBS) diff --git a/cmake/modules/FindCFitsio.cmake b/cmake/modules/FindCFitsio.cmake new file mode 100644 index 0000000..d305225 --- /dev/null +++ b/cmake/modules/FindCFitsio.cmake @@ -0,0 +1,53 @@ +# - Try to find CFITSIO +# Once done this will define +# +# CFITSIO_FOUND - system has CFITSIO +# CFITSIO_INCLUDE_DIR - the CFITSIO include directory +# CFITSIO_LIBRARIES - Link these to use CFITSIO + +# Copyright (c) 2006, Jasem Mutlaq +# Based on FindLibfacile by Carsten Niehaus, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) + + # in cache already + set(CFITSIO_FOUND TRUE) + message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}") + + +else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) + + find_path(CFITSIO_INCLUDE_DIR fitsio.h + ${_obIncDir} + ${GNUWIN32_DIR}/include + ) + + find_library(CFITSIO_LIBRARIES NAMES cfitsio + PATHS + ${_obLinkDir} + ${GNUWIN32_DIR}/lib + ) + + if(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) + set(CFITSIO_FOUND TRUE) + else (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) + set(CFITSIO_FOUND FALSE) + endif(CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) + + + if (CFITSIO_FOUND) + if (NOT CFitsio_FIND_QUIETLY) + message(STATUS "Found CFITSIO: ${CFITSIO_LIBRARIES}") + endif (NOT CFitsio_FIND_QUIETLY) + else (CFITSIO_FOUND) + if (CFitsio_FIND_REQUIRED) + message(FATAL_ERROR "CFITSIO not found. KStars will compile CFITSIO.") + endif (CFitsio_FIND_REQUIRED) + endif (CFITSIO_FOUND) + + mark_as_advanced(CFITSIO_INCLUDE_DIR CFITSIO_LIBRARIES) + +endif (CFITSIO_INCLUDE_DIR AND CFITSIO_LIBRARIES) diff --git a/cmake/modules/FindLibfacile.cmake b/cmake/modules/FindLibfacile.cmake new file mode 100644 index 0000000..bef726e --- /dev/null +++ b/cmake/modules/FindLibfacile.cmake @@ -0,0 +1,49 @@ +# - Try to find Libfacile +# Once done this will define +# +# LIBFACILE_FOUND - system has Libfacile +# LIBFACILE_INCLUDE_DIR - the Libfacile include directory +# LIBFACILE_LIBRARIES - Link these to use Libfacile +# LIBFACILE_DEFINITIONS - Compiler switches required for using Libfacile +# +# Copyright (c) 2006, Carsten Niehaus, +# Copyright (c) 2006, Montel Laurent, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + + +find_package(OCaml) + +set(LIBFACILE_FOUND FALSE) + +if( OCAML_FOUND ) + find_file(LIBFACILE_LIBRARIES NAMES facile.a + PATHS + ${OCAMLC_DIR}/facile/ + ) + #message(STATUS "LIBFACILE_LIBRARIES :<${LIBFACILE_LIBRARIES}>") + find_path(LIBFACILE_INCLUDE_DIR NAMES facile.a + PATHS + ${OCAMLC_DIR}/ + PATH_SUFFIXES facile + ) + #message(STATUS "LIBFACILE_INCLUDE_DIR <${LIBFACILE_INCLUDE_DIR}>") + if(LIBFACILE_INCLUDE_DIR AND LIBFACILE_LIBRARIES) + set(LIBFACILE_FOUND TRUE) + endif(LIBFACILE_INCLUDE_DIR AND LIBFACILE_LIBRARIES) +endif(OCAML_FOUND) + + +if(LIBFACILE_FOUND) + if(NOT Libfacile_FIND_QUIETLY) + message(STATUS "Found Libfacile: ${LIBFACILE_LIBRARIES}") + endif(NOT Libfacile_FIND_QUIETLY) +else(LIBFACILE_FOUND) + if(Libfacile_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Libfacile") + endif(Libfacile_FIND_REQUIRED) +endif(LIBFACILE_FOUND) + +# show the LIBFACILE_INCLUDE_DIR and LIBFACILE_LIBRARIES variables only in the advanced view +mark_as_advanced(LIBFACILE_INCLUDE_DIR LIBFACILE_LIBRARIES ) + diff --git a/cmake/modules/FindNova.cmake b/cmake/modules/FindNova.cmake new file mode 100644 index 0000000..9717a85 --- /dev/null +++ b/cmake/modules/FindNova.cmake @@ -0,0 +1,43 @@ +# - Try to find NOVA +# Once done this will define +# +# NOVA_FOUND - system has NOVA +# NOVA_INCLUDE_DIR - the NOVA include directory +# NOVA_LIBRARIES - Link these to use NOVA + +# Copyright (c) 2006, Jasem Mutlaq +# Based on FindLibfacile by Carsten Niehaus, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) + + # in cache already + set(NOVA_FOUND TRUE) + message(STATUS "Found libnova: ${NOVA_LIBRARIES}") + +else (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES) + + find_path(NOVA_INCLUDE_DIR libnova.h + PATH_SUFFIXES libnova + ${_obIncDir} + ${GNUWIN32_DIR}/include + ) + + find_library(NOVA_LIBRARIES NAMES nova + PATHS + ${_obLinkDir} + ${GNUWIN32_DIR}/lib + ) + + set(CMAKE_REQUIRED_INCLUDES ${NOVA_INCLUDE_DIR}) + set(CMAKE_REQUIRED_LIBRARIES ${NOVA_LIBRARIES}) + check_cxx_source_compiles("#include + int main() { ln_get_date_from_tm(NULL, NULL); return 0; }" NOVA_FUNCTION_COMPILE) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Nova DEFAULT_MSG NOVA_LIBRARIES NOVA_INCLUDE_DIR NOVA_FUNCTION_COMPILE) + mark_as_advanced(NOVA_INCLUDE_DIR NOVA_LIBRARIES) + +endif (NOVA_INCLUDE_DIR AND NOVA_LIBRARIES AND NOVA_FUNCTION_COMPILE) diff --git a/cmake/modules/FindOCaml.cmake b/cmake/modules/FindOCaml.cmake new file mode 100644 index 0000000..09b8bdc --- /dev/null +++ b/cmake/modules/FindOCaml.cmake @@ -0,0 +1,61 @@ +# - Try to find OCaml +# Once done this will define +# +# OCAML_FOUND - system has OCaml +# OCAML_OCAMLC_EXECUTABLE - the Libfacile include directory +# OCAML_OCAMLDEP_EXECUTABLE - Link these to use Libfacile +# OCAML_OCAMLOPT_EXECUTABLE - Compiler switches required for using Libfacile +# OCAMLC_DIR +# +# Copyright (c) 2006, Carsten Niehaus, +# Copyright (c) 2006, Montel Laurent, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if ( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE) + + # in cache already + set(OCAML_FOUND TRUE) + +else ( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE) + +FIND_PROGRAM(OCAML_OCAMLC_EXECUTABLE NAMES ocamlc) +FIND_PROGRAM(OCAML_OCAMLDEP_EXECUTABLE NAMES ocamldep) +FIND_PROGRAM(OCAML_OCAMLOPT_EXECUTABLE NAMES ocamlopt) + +if( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${OCAML_OCAMLC_EXECUTABLE} -where OUTPUT_VARIABLE OCAMLC_DIR) + STRING(REPLACE "\n" "" OCAMLC_DIR "${OCAMLC_DIR}") + #MESSAGE(STATUS "ocamlc directory <${OCAMLC_DIR}>") + + # show the LIBFACILE_INCLUDE_DIR and LIBFACILE_LIBRARIES variables only in the advanced view + MARK_AS_ADVANCED(LIBFACILE_INCLUDE_DIR LIBFACILE_LIBRARIES ) + + set(OCAML_FOUND TRUE) +else( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE) + + if(NOT OCAML_OCAMLC_EXECUTABLE) + message(STATUS "ocamlc not found.") + endif(NOT OCAML_OCAMLC_EXECUTABLE) + if(NOT OCAML_OCAMLDEP_EXECUTABLE) + message(STATUS "ocamldep not found.") + endif(NOT OCAML_OCAMLDEP_EXECUTABLE) + if(NOT OCAML_OCAMLOPT_EXECUTABLE) + message(STATUS "ocamlopt not found.") + endif(NOT OCAML_OCAMLOPT_EXECUTABLE) + set(OCAML_FOUND FALSE) +endif( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE) + + +IF(OCAML_FOUND) + IF(NOT OCaml_FIND_QUIETLY) + MESSAGE(STATUS "Found OCaml: ${OCAML_OCAMLC_EXECUTABLE}") + ENDIF(NOT OCaml_FIND_QUIETLY) +ELSE(OCAML_FOUND) + IF(OCaml_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find OCaml") + ENDIF(OCaml_FIND_REQUIRED) +ENDIF(OCAML_FOUND) + +endif ( OCAML_OCAMLC_EXECUTABLE AND OCAML_OCAMLDEP_EXECUTABLE AND OCAML_OCAMLOPT_EXECUTABLE) + diff --git a/cmake/modules/FindOpenBabel2.cmake b/cmake/modules/FindOpenBabel2.cmake new file mode 100644 index 0000000..c44605d --- /dev/null +++ b/cmake/modules/FindOpenBabel2.cmake @@ -0,0 +1,107 @@ +# - Try to find OpenBabel2 +# Once done this will define +# +# OPENBABEL2_FOUND - system has OpenBabel2 +# OPENBABEL2_INCLUDE_DIR - the OpenBabel2 include directory +# OPENBABEL2_LIBRARIES - Link these to use OpenBabel2 +# Copyright (c) 2006, 2007 Carsten Niehaus, +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL_MINI_FOUND) + + # in cache already + set(OPENBABEL2_FOUND TRUE) + +else (OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL_MINI_FOUND) +if(NOT WIN32) + include(UsePkgConfig) + + pkgconfig(openbabel-2.0 _obIncDir _obLinkDir _obLinkFlags _obCflags) + + # query pkg-config asking for a openbabel >= 2.2.0 + exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=2.1.0 openbabel-2.0 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) + if(_return_VALUE STREQUAL "0") + set(OPENBABEL_MINI_FOUND TRUE) + endif(_return_VALUE STREQUAL "0") + + exec_program(${PKGCONFIG_EXECUTABLE} ARGS --variable=pkgincludedir openbabel-2.0 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _obPkgIncDir ) + if (_obPkgIncDir) + set(_obIncDir "${_obPkgIncDir}") + endif (_obPkgIncDir) +else(NOT WIN32) + set(OPENBABEL_MINI_FOUND TRUE) +endif(NOT WIN32) + + if(OPENBABEL_MINI_FOUND) + + find_path(OPENBABEL2_INCLUDE_DIR openbabel/obconversion.h + PATHS + ${_obIncDir} + ${GNUWIN32_DIR}/include + $ENV{OPENBABEL2_INCLUDE_DIR} + ) + + if(WIN32) + if(NOT OPENBABEL2_INCLUDE_DIR) + find_path(OPENBABEL2_INCLUDE_DIR openbabel-2.0/openbabel/obconversion.h + PATHS + ${_obIncDir} + ${GNUWIN32_DIR}/include + $ENV{OPENBABEL2_INCLUDE_DIR} + ) + if(OPENBABEL2_INCLUDE_DIR) + set(OPENBABEL2_INCLUDE_DIR ${OPENBABEL2_INCLUDE_DIR}/openbabel-2.0) + endif(OPENBABEL2_INCLUDE_DIR) + endif(NOT OPENBABEL2_INCLUDE_DIR) + endif(WIN32) + + find_library(OPENBABEL2_LIBRARIES NAMES openbabel + PATHS + ${_obLinkDir} + ${GNUWIN32_DIR}/lib + $ENV{OPENBABEL2_LIBRARIES} + ) + endif(OPENBABEL_MINI_FOUND) + + if(OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL_MINI_FOUND) + set(OPENBABEL2_FOUND TRUE) + endif(OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL_MINI_FOUND) + + if (OPENBABEL2_FOUND) + if (NOT OpenBabel2_FIND_QUIETLY) + message(STATUS "Found OpenBabel 2.2 or later: ${OPENBABEL2_LIBRARIES}") + endif (NOT OpenBabel2_FIND_QUIETLY) + else (OPENBABEL2_FOUND) + if (OpenBabel2_FIND_REQUIRED) + message(FATAL_ERROR "Could NOT find OpenBabel 2.2 or later ") + endif (OpenBabel2_FIND_REQUIRED) + endif (OPENBABEL2_FOUND) + + mark_as_advanced(OPENBABEL2_INCLUDE_DIR OPENBABEL2_LIBRARIES) + +endif (OPENBABEL2_INCLUDE_DIR AND OPENBABEL2_LIBRARIES AND OPENBABEL_MINI_FOUND) + +# Search for Open Babel2 executable +if(OPENBABEL2_EXECUTABLE) + + # in cache already + set(OPENBABEL2_EXECUTABLE_FOUND TRUE) + +else(OPENBABEL2_EXECUTABLE) + find_program(OPENBABEL2_EXECUTABLE NAMES babel + PATHS + [HKEY_CURRENT_USER\\SOFTWARE\\OpenBabel\ 2.2.0] + $ENV{OPENBABEL2_EXECUTABLE} + ) + + if(OPENBABEL2_EXECUTABLE) + set(OPENBABEL2_EXECUTABLE_FOUND TRUE) + endif(OPENBABEL2_EXECUTABLE) + + if(OPENBABEL2_EXECUTABLE_FOUND) + message(STATUS "Found OpenBabel2 executable: ${OPENBABEL2_EXECUTABLE}") + endif(OPENBABEL2_EXECUTABLE_FOUND) + +endif(OPENBABEL2_EXECUTABLE) + diff --git a/cmake/modules/FindReadline.cmake b/cmake/modules/FindReadline.cmake new file mode 100644 index 0000000..5bed2dc --- /dev/null +++ b/cmake/modules/FindReadline.cmake @@ -0,0 +1,15 @@ +# GNU Readline library finder +if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY) + set(READLINE_FOUND TRUE) +else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY) + FIND_PATH(READLINE_INCLUDE_DIR readline/readline.h + /usr/include/readline + ) + + FIND_LIBRARY(READLINE_LIBRARY NAMES readline) + FIND_LIBRARY(NCURSES_LIBRARY NAMES ncurses ) + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG NCURSES_LIBRARY READLINE_INCLUDE_DIR READLINE_LIBRARY ) + + MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY) +endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND NCURSES_LIBRARY) diff --git a/cmake/modules/FindSBIG.cmake b/cmake/modules/FindSBIG.cmake new file mode 100644 index 0000000..98ad1c3 --- /dev/null +++ b/cmake/modules/FindSBIG.cmake @@ -0,0 +1,32 @@ +# - Try to find SBIG +# Once done this will define +# +# SBIG_FOUND - system has SBIG +# SBIG_LIBRARIES - Link these to use SBIG + +# Copyright (c) 2006, Jasem Mutlaq +# Based on FindSBIG by Carsten Niehaus, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if (SBIG_LIBRARIES) + + # in cache already + set(SBIG_FOUND TRUE) + message(STATUS "Found SBIG: ${SBIG_LIBRARIES}") + +else (SBIG_LIBRARIES) + + find_library(SBIG_LIBRARIES NAMES sbigudrv + PATHS + ${_obLinkDir} + ${GNUWIN32_DIR}/lib + ) + + include(FindPackageHandleStandardArgs) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(SBIG DEFAULT_MSG SBIG_LIBRARIES ) + + mark_as_advanced(SBIG_LIBRARIES) + +endif (SBIG_LIBRARIES) -- 2.11.4.GIT