summarylogtreecommitdiffstats
path: root/0007-cmake-install-tags.py-properly.patch
blob: 9c7ea1f35861c6f73965f46164e9f275bc7cde9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 30c905970e06caf9bb4b8211d759d6107f863ca0 Mon Sep 17 00:00:00 2001
From: Xiretza <xiretza@xiretza.xyz>
Date: Sat, 4 Jun 2022 19:35:34 +0200
Subject: [PATCH 7/7] cmake: install tags.py properly

---
 src/CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 63502e5..8d3564f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -76,13 +76,15 @@ antlr_target(FasmParser antlr/FasmParser.g4 PARSER VISITOR
 # line 1: Skip lines starting in #define
 #      2: Extract TAGS(...) from dependencies
 #      3: Convert from TAGS('c', long_name) -> long_name = b'c, write to file
-add_custom_target(tags.py ALL
+add_custom_command(OUTPUT tags.py
   COMMAND grep -ve ^\#define ${CMAKE_CURRENT_SOURCE_DIR}/ParseFasm.cpp |
           grep -hoe TAG\([^\)]*\) |
-          sed -e s/TAG\(\\\(.*\\\),\ \\\(.*\\\)\)/\\2\ =\ b\\1/ > tags.py
+          sed -e s/TAG\(\\\(.*\\\),\ \\\(.*\\\)\)/\\2\ =\ b\\1/ > ${CMAKE_CURRENT_BINARY_DIR}/tags.py
   DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ParseFasm.cpp
   VERBATIM
   )
+add_custom_target(tags_py ALL DEPENDS tags.py)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tags.py DESTINATION ${CMAKE_INSTALL_LIBDIR})
 
 # Include generated files in project environment
 include_directories(${ANTLR_FasmLexer_OUTPUT_DIR})
@@ -120,5 +122,3 @@ include(CTest)
 add_test(NAME parse_fasm_tests
          COMMAND parse_fasm_tests)
 enable_testing()
-
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tags.py DESTINATION .)
-- 
2.36.1