Subject: [bug#69554] [PATCH v2] build-system: cmake: Build tests depending on `#:tests?`.

From: Hartmut Goebel <[email-masked]>
Date: Tue, 16 Jul 2024 17:36:49 +0200

Am 15.07.24 um 11:40 schrieb Ludovic Courtès:
> My understanding is that ‘BUILD_TESTING’ is not standard, as the last
> sentence above suggests.  Thus I’m reluctant to passing this flag
> unconditionally, as I guess it would fail for ‘CMakeLists.txt’ that do
> not implement it, right?

I just tested it, and all you get is a warning:

$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(doo)
$ cmake -DBUILD_TESTING=OFF .
…
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTING

-- Build files have been written to: /tmp/xxx

-- 

Regards
Hartmut Goebel

| Hartmut Goebel          [email-masked]                |
|www.crazy-compilers.com  | compilers which you thought are impossible |