################################################# # # (C) 2010-2011 Serghei Amelian # serghei (DOT) amelian (AT) gmail.com # # Improvements and feedback are welcome # # This file is released under GPL >= 2 # ################################################# macro( tqt_message ) message( STATUS "${ARGN}" ) endmacro( ) if( NOT TQT_FOUND ) pkg_search_module( TQT tqt ) 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( UIC_EXECUTABLE ) # tqmoc_executable pkg_get_variable( TQT_PREFIX tqt-mt prefix ) find_program( TQMOC_EXECUTABLE NAMES tqmoc HINTS "${TQT_PREFIX}/bin" ) if( NOT TQMOC_EXECUTABLE ) tde_message_fatal( "tqmoc was NOT found.\n Please make sure TQt is correctly installed." ) endif( ) tqt_message( " tqmoc path: ${TQMOC_EXECUTABLE}" ) # uic_executable tde_execute_process( COMMAND pkg-config tqt --variable=uic_executable 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?" ) endif( ) tqt_message( " uic path: ${UIC_EXECUTABLE}" ) # check if tqt is usable tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) set( CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIRS} ) foreach( _dirs ${TQT_LIBRARY_DIRS} ) list( APPEND CMAKE_REQUIRED_LIBRARIES "-L${_dirs}" ) endforeach() list( APPEND CMAKE_REQUIRED_LIBRARIES ${TQT_LIBRARIES} ) check_cxx_source_compiles(" #include int main(int argc, char **argv) { TQApplication app(argc, argv); return 0; } " HAVE_USABLE_TQT ) if( NOT HAVE_USABLE_TQT ) tde_message_fatal( "Unable to build a simple tqt test." ) endif( ) tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) # TQT_CMAKE_DIR if( NOT DEFINED TQT_CMAKE_DIR ) set( TQT_CMAKE_DIR "${TQT_LIBDIR}/cmake" CACHE FILEPATH "Path for shared TQt CMake targets" ) endif() # TQT_CXX_FLAGS foreach( _flag ${TQT_CFLAGS} ${TQT_CFLAGS_OTHER} ) set( TQT_CXX_FLAGS "${TQT_CXX_FLAGS} ${_flag}" ) endforeach() set( TQT_CXX_FLAGS "${TQT_CXX_FLAGS}" CACHE INTERNAL "" ) endif( NOT TQT_FOUND ) # Set compiler flags according to build type set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG" ) set( CMAKE_C_FLAGS_RELWITHDEBINFO "-DNDEBUG" ) # Set the required minimum C++ standard set( TDE_CXX_FEATURES cxx_nullptr )