diff options
author | Frank Lichtenheld | 2023-07-03 17:39:25 +0200 |
---|---|---|
committer | Gert Doering | 2023-07-04 13:44:52 +0200 |
commit | 0652ae84f4528daa57da344eee28b7385a6659a1 (patch) | |
tree | fa70c48478fa768a461fa1dc5de33d21a9e8cb21 /CMakeLists.txt | |
parent | eb3cd5ea36f9bf235da7b8a51fd6ce29780f0e39 (diff) | |
download | openvpn-0652ae84f4528daa57da344eee28b7385a6659a1.zip openvpn-0652ae84f4528daa57da344eee28b7385a6659a1.tar.gz |
CMake: Throw a clear error when config.h in top-level source directory
This causes weird, difficult to debug compilation errors. Usually
caused by trying to run CMake against a source that had an
in-tree autoconfig build.
Note that you're able to do out-of-tree autoconfig builds and
they can obviously mix with out-of-tree cmake builds.
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20230703153925.48990-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26809.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index acebbb7..597dc90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,10 @@ if (NOT WIN32 AND NOT ${UNSUPPORTED_BUILDS}) message(FATAL_ERROR "Note: on Unix platform the official and supported build method is using autoconfig. CMake based build should be only used for Windows and internal testing/development.") endif() +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/config.h") + message(FATAL_ERROR "The top level source directory has a config.h file. Note that you can't mix in-tree autoconfig builds with out-of-tree cmake builds.") +endif () + option(MBED "BUILD with mbed" OFF) option(WOLFSSL "BUILD with wolfSSL" OFF) option(ENABLE_LZ4 "BUILD with lz4" ON) |