summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <cordlandwehr@kde.org>2015-10-01 18:09:21 (GMT)
committerAndreas Cord-Landwehr <cordlandwehr@kde.org>2015-10-01 18:09:21 (GMT)
commit7ba7f72f14304887ab3f2700275a52af7e5a4ca1 (patch)
tree155cff3100252497ef9cc265653ca713d457199d
parent98edb9981f67a3f289e03bf903953c9f56cfea31 (diff)
Merge KalziumConfigureChecks with main CMake configuration.
Fixes the problem of searching different versions of Avogadro. Makes CMake code much easier to read, since now all checks are at one place.
-rw-r--r--CMakeLists.txt22
-rw-r--r--KalziumConfigureChecks.cmake35
2 files changed, 18 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e30b2e4..eff6fe5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,12 +10,29 @@ include(KDECMakeSettings)
include(FeatureSummary)
include(ECMInstallIcons)
include(ECMMarkNonGuiExecutable)
+include(CheckIncludeFiles)
-find_package(OpenBabel2 REQUIRED)
find_package(Gettext REQUIRED)
find_package(PythonInterp REQUIRED)
+find_package(PkgConfig)
+find_package(OpenBabel2)
find_package(AvogadroLibs)
find_package(Eigen3)
+find_package(OCaml)
+find_package(Libfacile)
+
+pkg_check_modules(CHEMICAL_MIME_DATA chemical-mime-data)
+check_include_files(ieeefp.h HAVE_IEEEFP_H)
+
+# create configuration file
+set(HAVE_FACILE ${LIBFACILE_FOUND})
+set(HAVE_OPENBABEL2 ${OPENBABEL2_FOUND})
+set(HAVE_EIGEN ${EIGEN3_FOUND})
+set(HAVE_AVOGADRO ${AvogadroLibs_FOUND})
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/config-kalzium.h.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/config-kalzium.h
+)
include_directories(${AvogadroLibs_INCLUDE_DIRS})
@@ -70,9 +87,6 @@ if(MSVC)
add_definitions(-DUSING_DYNAMIC_LIBS)
endif(MSVC)
-
-include(KalziumConfigureChecks.cmake)
-
if (OPENBABEL2_FOUND AND AvogadroLibs_FOUND AND EIGEN3_FOUND)
# avoid compilerwarnings about redefinitions
# todo: use check_function_exits() ?
diff --git a/KalziumConfigureChecks.cmake b/KalziumConfigureChecks.cmake
deleted file mode 100644
index 65ba760..0000000
--- a/KalziumConfigureChecks.cmake
+++ /dev/null
@@ -1,35 +0,0 @@
-include(CheckIncludeFiles)
-include(CheckFunctionExists)
-
-find_package(OCaml)
-find_package(Libfacile)
-find_package(OpenBabel2)
-find_package(Eigen3)
-find_package(Avogadro 1.0.0 NO_MODULE)
-
-find_package(PkgConfig)
-pkg_check_modules(CHEMICAL_MIME_DATA chemical-mime-data)
-include(CheckIncludeFiles)
-check_include_files(ieeefp.h HAVE_IEEEFP_H)
-set(HAVE_FACILE ${LIBFACILE_FOUND})
-set(HAVE_OPENBABEL2 ${OPENBABEL2_FOUND})
-set(HAVE_EIGEN ${EIGEN3_FOUND})
-set(HAVE_AVOGADRO ${Avogadro_FOUND})
-#macro_bool_to_01(LIBFACILE_FOUND HAVE_FACILE)
-#macro_bool_to_01(OPENBABEL2_FOUND HAVE_OPENBABEL2)
-#macro_bool_to_01(EIGEN3_FOUND HAVE_EIGEN)
-#macro_bool_to_01(Avogadro_FOUND HAVE_AVOGADRO)
-
-# at the end, output the configuration
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/config-kalzium.h.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/config-kalzium.h
-)
-
-#set_package_properties(OCAML_FOUND "OCaml" "http://caml.inria.fr/" FALSE "OCaml is needed by Kalzium for the Equation Solver")
-#(OCAML_FOUND "OCaml" "OCaml is needed by Kalzium for the Equation Solver" "http://caml.inria.fr/" FALSE "" "")
-#set_package_properties(LIBFACILE_FOUND "LibFacile" "libfacile is needed by Kalzium for the Equation Solver." "http://www.recherche.enac.fr/log/facile/" FALSE "" "")
-#set_package_properties(OPENBABEL2_FOUND "OpenBabel2" "OpenBabel is needed by Kalzium for the 3D-molecule viewer" "http://openbabel.sourceforge.net/" FALSE "2.2" "")
-#set_package_properties(EIGEN3_FOUND "Eigen3" "A generic C++ template library for dense and sparse matrices" "http://eigen.tuxfamily.org" FALSE "3.0.0" "")
-#set_package_properties(Avogadro_FOUND "Avogadro" "Advanced molecular editor" "http://avogadro.openmolecules.net" FALSE "1.0" "")
-#set_package_properties(CHEMICAL_MIME_DATA_FOUND "Chemical mime data" "Needed to open CML molecules from the file manager" "http://chemical-mime.sourceforge.net/" FALSE "" "") \ No newline at end of file