Shared cmake folder
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3KB

  1. #################################################
  2. #
  3. # (C) 2010-2011 Serghei Amelian
  4. # serghei (DOT) amelian (AT) gmail.com
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. macro( tqtqui_message )
  12. message( STATUS "${ARGN}" )
  13. endmacro( )
  14. pkg_search_module( TQTQUI tqtqui )
  15. if( NOT TQTQUI_FOUND )
  16. 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." )
  17. endif( )
  18. # check if tqtqui is usable
  19. tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  20. set( CMAKE_REQUIRED_INCLUDES ${TQTQUI_INCLUDE_DIRS} )
  21. foreach( _dirs ${TQTQUI_LIBRARY_DIRS} )
  22. list( APPEND CMAKE_REQUIRED_LIBRARIES "-L${_dirs}" )
  23. endforeach()
  24. list( APPEND CMAKE_REQUIRED_LIBRARIES ${TQTQUI_LIBRARIES} )
  25. check_cxx_source_compiles("
  26. #include <tqapplication.h>
  27. int main(int argc, char **argv) { TQApplication app(argc, argv); return 0; } "
  28. HAVE_USABLE_TQTQUI )
  29. if( NOT HAVE_USABLE_TQTQUI )
  30. tde_message_fatal( "Unable to build a simple tqtqui test." )
  31. endif( )
  32. tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  33. # TQTQUI_CXX_FLAGS
  34. foreach( _flag ${TQTQUI_CFLAGS_OTHER} )
  35. set( TQTQUI_CXX_FLAGS "${TQTQUI_CXX_FLAGS} ${_flag}" )
  36. endforeach()