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>
pull/29/head
Slávek Banko 6 months 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 )
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." )
endif( )

mark_as_advanced(
TMOC_EXECUTABLE
MOC_EXECUTABLE
UIC_EXECUTABLE
)

# tmoc_executable
tde_execute_process(
COMMAND pkg-config tqt --variable=tmoc_executable
OUTPUT_VARIABLE TMOC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE )
OUTPUT_VARIABLE TMOC_EXECUTABLE
CACHE FILEPATH "TQt tmoc executable path"
OUTPUT_STRIP_TRAILING_WHITESPACE )

if( NOT EXISTS ${TMOC_EXECUTABLE} )
tde_message_fatal( "tmoc is not found!\n tqt is correctly installed?" )
@@ -34,7 +42,9 @@ tqt_message( " tmoc path: ${TMOC_EXECUTABLE}" )
# moc_executable
tde_execute_process(
COMMAND pkg-config tqt --variable=moc_executable
OUTPUT_VARIABLE MOC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE )
OUTPUT_VARIABLE MOC_EXECUTABLE
CACHE FILEPATH "TQt moc executable path"
OUTPUT_STRIP_TRAILING_WHITESPACE )

if( NOT EXISTS ${MOC_EXECUTABLE} )
tde_message_fatal( "Path to moc is not set.\n tqt is correctly installed?" )
@@ -46,7 +56,9 @@ tqt_message( " moc path: ${MOC_EXECUTABLE}" )
# uic_executable
tde_execute_process(
COMMAND pkg-config tqt --variable=uic_executable
OUTPUT_VARIABLE UIC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE )
OUTPUT_VARIABLE UIC_EXECUTABLE
CACHE FILEPATH "TQt uic executable path"
OUTPUT_STRIP_TRAILING_WHITESPACE )

if( NOT EXISTS ${UIC_EXECUTABLE} )
tde_message_fatal( "uic not found!\n tqt is correctly installed?" )

Loading…
Cancel
Save