Browse Source

Use cache for TQt executables paths.

This allows these values to be pre-defined
- for example, to optimize cross-build.

This resolves issue #28.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
master
Slávek Banko 1 month ago
parent
commit
74654feb3b
Signed by: Slávek Banko <slavek.banko@axis.cz> GPG Key ID: 608F5293A04BE668
1 changed files with 15 additions and 3 deletions
  1. 15
    3
      modules/FindTQt.cmake

+ 15
- 3
modules/FindTQt.cmake View File

@@ -19,10 +19,18 @@ if( NOT TQT_FOUND )
19 19
   tde_message_fatal( "Unable to find tqt!\n Try adding the directory in which the tqt.pc file is located\nto the PKG_CONFIG_PATH variable." )
20 20
 endif( )
21 21
 
22
+mark_as_advanced(
23
+    TMOC_EXECUTABLE
24
+    MOC_EXECUTABLE
25
+    UIC_EXECUTABLE
26
+)
27
+
22 28
 # tmoc_executable
23 29
 tde_execute_process(
24 30
   COMMAND pkg-config tqt --variable=tmoc_executable
25
-  OUTPUT_VARIABLE TMOC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE )
31
+  OUTPUT_VARIABLE TMOC_EXECUTABLE
32
+  CACHE FILEPATH "TQt tmoc executable path"
33
+  OUTPUT_STRIP_TRAILING_WHITESPACE )
26 34
 
27 35
 if( NOT EXISTS ${TMOC_EXECUTABLE} )
28 36
   tde_message_fatal( "tmoc is not found!\n tqt is correctly installed?" )
@@ -34,7 +42,9 @@ tqt_message( "  tmoc path: ${TMOC_EXECUTABLE}" )
34 42
 # moc_executable
35 43
 tde_execute_process(
36 44
   COMMAND pkg-config tqt --variable=moc_executable
37
-  OUTPUT_VARIABLE MOC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE )
45
+  OUTPUT_VARIABLE MOC_EXECUTABLE
46
+  CACHE FILEPATH "TQt moc executable path"
47
+  OUTPUT_STRIP_TRAILING_WHITESPACE )
38 48
 
39 49
 if( NOT EXISTS ${MOC_EXECUTABLE} )
40 50
   tde_message_fatal( "Path to moc is not set.\n tqt is correctly installed?" )
@@ -46,7 +56,9 @@ tqt_message( "  moc path: ${MOC_EXECUTABLE}" )
46 56
 # uic_executable
47 57
 tde_execute_process(
48 58
   COMMAND pkg-config tqt --variable=uic_executable
49
-  OUTPUT_VARIABLE UIC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE )
59
+  OUTPUT_VARIABLE UIC_EXECUTABLE
60
+  CACHE FILEPATH "TQt uic executable path"
61
+  OUTPUT_STRIP_TRAILING_WHITESPACE )
50 62
 
51 63
 if( NOT EXISTS ${UIC_EXECUTABLE} )
52 64
   tde_message_fatal( "uic not found!\n tqt is correctly installed?" )

Loading…
Cancel
Save