From 115831b7bf5bdfae90c3949dcb89a1f55da5260e Mon Sep 17 00:00:00 2001 From: Sina Ackermann <sina.ackermann@iws.uni-stuttgart.de> Date: Thu, 2 Mar 2017 15:29:45 +0100 Subject: [PATCH] Merge branch 'cmake/findPVPython' into 'master' [cmake] Add module to find pvpython, which can be used to run postprocessing scripts See merge request !393 --- cmake/modules/CMakeLists.txt | 3 +++ cmake/modules/DumuxMacros.cmake | 6 ++--- cmake/modules/FindPVPython.cmake | 45 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 cmake/modules/FindPVPython.cmake diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt index 5927abb75b..4c2a8184d8 100644 --- a/cmake/modules/CMakeLists.txt +++ b/cmake/modules/CMakeLists.txt @@ -4,7 +4,10 @@ set(modules DumuxDoxygen.cmake DumuxMacros.cmake DumuxTestMacros.cmake + FindGLPK.cmake FindGstat.cmake + FindNLOPT.cmake + FindPVPython.cmake FindValgrind.cmake) include(GNUInstallDirs) install(FILES ${modules} DESTINATION ${DUNE_INSTALL_MODULEDIR}) diff --git a/cmake/modules/DumuxMacros.cmake b/cmake/modules/DumuxMacros.cmake index 97ea267aa2..d89484b592 100644 --- a/cmake/modules/DumuxMacros.cmake +++ b/cmake/modules/DumuxMacros.cmake @@ -5,10 +5,10 @@ include(DumuxDoxygen) include(DumuxTestMacros) find_package(GLPK) -find_package(Gstat) find_package(Gnuplot) set(HAVE_GNUPLOT ${GNUPLOT_FOUND}) - +find_package(Gstat) find_package(NLOPT) -find_package(Valgrind) find_package(PTScotch) +find_package(PVPython) +find_package(Valgrind) diff --git a/cmake/modules/FindPVPython.cmake b/cmake/modules/FindPVPython.cmake new file mode 100644 index 0000000000..0419008b4e --- /dev/null +++ b/cmake/modules/FindPVPython.cmake @@ -0,0 +1,45 @@ +# .. cmake_module:: +# +# Find the pvpython library +# +# You may set the following variables to modify the +# behaviour of this module: +# +# :ref:`PVPYTHON_ROOT` +# Path list to search for pvpython. +# +# Sets the following variables: +# +# :code:`PVPYTHON_FOUND` +# True if the pvpython library was found. +# +# :code:`PVPYTHON_EXECUTABLE` +# Path to pvpython executable +# +# .. cmake_variable:: PVPYTHON_ROOT +# +# You may set this variable to have :ref:`FindPVPython" look +# for the pvpython library in the given path before inspecting +# system paths. +# + +# look for header files, only at positions given by the user +find_program(PVPYTHON_EXECUTABLE + NAMES pvpython + PATHS "${PVPYTHON_ROOT}/" + "${CMAKE_SOURCE_DIR}/../" + "/usr/bin/" + PATH_SUFFIXES "pvpython" + NO_DEFAULT_PATH +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + "PVPython" + DEFAULT_MSG + PVPYTHON_EXECUTABLE +) + +# set macros for config.h +set(HAVE_PVPYTHON ${PVPYTHON_FOUND}) +set(PVPYTHON_EXECUTABLE ${PVPYTHON_EXECUTABLE}) -- GitLab