###########################################
#                                         #
#  Improvements and feedback are welcome  #
#                                         #
#  This file is released under GPL >= 3   #
#                                         #
###########################################

# required stuff
find_package( TQt )

tde_setup_compiler_flags( )

include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

tde_setup_largefiles( )


##### check for gcc visibility support

if( WITH_GCC_VISIBILITY )
  tde_setup_gcc_visibility( )
endif( WITH_GCC_VISIBILITY )


##### Look for tqt3 plugins location

execute_process(
    COMMAND ${PKG_CONFIG_EXECUTABLE} tqt-mt --variable=pluginsdir
    OUTPUT_VARIABLE _pluginsdir
    RESULT_VARIABLE _result
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
set( TQT_PLUGINS_DIR ${_pluginsdir} )
message( STATUS "TQT plugins directory: ${TQT_PLUGINS_DIR}" )


##### Look for tqt3 translations location

execute_process(
    COMMAND ${PKG_CONFIG_EXECUTABLE} tqt-mt --variable=translationsdir
    OUTPUT_VARIABLE _translationsdir
    RESULT_VARIABLE _result
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
set( TQT_TRANSLATIONS_DIR ${_translationsdir} )
message( STATUS "TQT translation directory: ${TQT_TRANSLATIONS_DIR}" )


##### Look for tqt3 includes location

execute_process(
    COMMAND ${PKG_CONFIG_EXECUTABLE} tqt-mt --variable=includedir
    OUTPUT_VARIABLE _includedir
    RESULT_VARIABLE _result
    OUTPUT_STRIP_TRAILING_WHITESPACE
)
set( TQT_INCLUDES_DIR ${_includedir} )
message( STATUS "TQT include directory: ${TQT_INCLUDES_DIR}" )
