diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-12 17:06:05 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-06-12 17:06:05 -0500 |
commit | ce9e1ce4299a2e5b5fa2e354c9a02c1c2dd42c19 (patch) | |
tree | de5b2cd28ee6a3db22db4c0bc7878e6dd2feeb5d /modules | |
parent | e47cc63e66a12ca6b740500b76f385336ee40dbc (diff) | |
download | tde-cmake-ce9e1ce4299a2e5b5fa2e354c9a02c1c2dd42c19.tar.gz tde-cmake-ce9e1ce4299a2e5b5fa2e354c9a02c1c2dd42c19.zip |
Add FindTQtQUI
Diffstat (limited to 'modules')
-rw-r--r-- | modules/FindTQtQUI.cmake | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/FindTQtQUI.cmake b/modules/FindTQtQUI.cmake new file mode 100644 index 0000000..79e38b9 --- /dev/null +++ b/modules/FindTQtQUI.cmake @@ -0,0 +1,57 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +macro( tqtqui_message ) + message( STATUS "${ARGN}" ) +endmacro( ) + +pkg_search_module( TQTQUI tqtqui ) + +if( NOT TQTQUI_FOUND ) + tde_message_fatal( "Unable to find tqtqui!\n Try adding the directory in which the tqtqui.pc file is located\nto the PKG_CONFIG_PATH variable." ) +endif( ) + +# tmoc_executable +tde_execute_process( + COMMAND pkg-config tqtqui --variable=tmoc_executable + OUTPUT_VARIABLE TMOC_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE ) + +if( NOT EXISTS ${TMOC_EXECUTABLE} ) + tde_message_fatal( "tmoc is not found!\n tqtqui is correctly installed?" ) +endif( ) + +tqtqui_message( " tmoc path: ${TMOC_EXECUTABLE}" ) + + +# check if tqtqui is usable +tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) +set( CMAKE_REQUIRED_INCLUDES ${TQTQUI_INCLUDE_DIRS} ) +foreach( _dirs ${TQTQUI_LIBRARY_DIRS} ) + list( APPEND CMAKE_REQUIRED_LIBRARIES "-L${_dirs}" ) +endforeach() +list( APPEND CMAKE_REQUIRED_LIBRARIES ${TQTQUI_LIBRARIES} ) + +check_cxx_source_compiles(" + #include <tqapplication.h> + int main(int argc, char **argv) { TQApplication app(argc, argv); return 0; } " + HAVE_USABLE_TQTQUI ) + +if( NOT HAVE_USABLE_TQTQUI ) + tde_message_fatal( "Unable to build a simple tqtqui test." ) +endif( ) + +tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) + + +# TQTQUI_CXX_FLAGS +foreach( _flag ${TQTQUI_CFLAGS_OTHER} ) + set( TQTQUI_CXX_FLAGS "${TQTQUI_CXX_FLAGS} ${_flag}" ) +endforeach() |