[Dune] CMAKE_GUARD for Dune modules

Markus Blatt markus at dr-blatt.de
Sun Aug 28 12:18:43 CEST 2016


Hi,

On Tue, Aug 23, 2016 at 12:38:20PM +0200, Oliver Sander wrote:
> Dear masters of CMake,
> 
> I want a unit test to only build and run when dune-functions is present.  Please, what is the
> appropriate CMAKE_GUARD clause for this?
>

The dune module are searched for with
find_package(<case-sensitive-module-name>), which sets
<case-sensitive-module-name>_FOUND on success to true. The following
should do the trick:

if(dune-functions_FOUND)
  ... # add_executable()
  ... # add_test()
endif()

Markus


-- 
Dr. Markus Blatt - HPC-Simulation-Software & Services http://www.dr-blatt.de
Hans-Bunte-Str. 8-10, 69123 Heidelberg, Germany
Tel.: +49 (0) 160 97590858
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20160828/6ac92a03/attachment.sig>


More information about the Dune mailing list