Browse code

CMake: various small non-functional improvements

These are based on review comments for the 2.6 backport.
But since they apply to the original master implementation
as well, I address them in this separate patch.

- Add documentation to contrib/cmake/*.py
- Fix grammar in README.cmake.md
- Update a TODO in CMakeLists.txt to better reflect
the status quo
- Fix indentation in unit_tests' Makefile.am

Change-Id: I4e16767ee221e1aefdd18d13b3411c27d8dd844a
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Lev Stipakov <lstipakov@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/342
Message-Id: <20230919155635.708557-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27043.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Frank Lichtenheld authored on 2023/09/20 00:56:35
Showing 5 changed files
... ...
@@ -292,7 +292,7 @@ set(HAVE_CONFIG_VERSION_H YES)
292 292
 
293 293
 configure_file(config.h.cmake.in config.h)
294 294
 configure_file(include/openvpn-plugin.h.in openvpn-plugin.h)
295
-# TODO remove later when msvc-config.h is removed and we can always include config.h
295
+# TODO we should remove the need for this, and always include config.h
296 296
 add_definitions(-DHAVE_CONFIG_H)
297 297
 
298 298
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
... ...
@@ -24,7 +24,7 @@ MSVC builds
24 24
 -----------
25 25
 
26 26
 The following tools are expected to be present on the system, you
27
-can them install with a package manager of your choice (e.g.
27
+can install them with a package manager of your choice (e.g.
28 28
 chocolatey, winget) or manually:
29 29
 
30 30
 * CMake
... ...
@@ -22,6 +22,14 @@
22 22
 #  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 23
 #
24 24
 
25
+# Usage: ./git-version.py [directory]
26
+# Find a good textual representation of the git commit currently checked out.
27
+# Make that representation available as CONFIGURE_GIT_REVISION in
28
+# <directory>/config-version.h.
29
+# It will prefer a tag name if it is checked out exactly, otherwise will use
30
+# the branch name. 'none' if no branch is checked out (detached HEAD).
31
+# This is used to enhance the output of openvpn --version with Git information.
32
+
25 33
 import os
26 34
 import sys
27 35
 import subprocess
... ...
@@ -22,6 +22,12 @@
22 22
 #  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 23
 #
24 24
 
25
+# Usage: ./parse-version.m4.py m4file [directory]
26
+# Read <m4file>, extract all lines looking like M4 define(), and translate
27
+# them into CMake style set(). Those are then written out to file
28
+# <directory>/version.cmake.
29
+# Intended to be used on top-level version.m4 file.
30
+
25 31
 import os
26 32
 import re
27 33
 import sys
... ...
@@ -110,7 +110,7 @@ tls_crypt_testdriver_LDFLAGS = @TEST_LDFLAGS@ \
110 110
 	-Wl,--wrap=parse_line \
111 111
 	-Wl,--wrap=rand_bytes
112 112
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c mock_msg.h \
113
-    mock_win32_execve.c \
113
+	mock_win32_execve.c \
114 114
 	$(top_srcdir)/src/openvpn/argv.c \
115 115
 	$(top_srcdir)/src/openvpn/base64.c \
116 116
 	$(top_srcdir)/src/openvpn/buffer.c \