From c914ecc9273eaea817d410c642ea8a565be0dd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Mon, 15 Sep 2014 21:46:19 +0200 Subject: [PATCH] Fix FTBFS due to late includes in CMake (cherry picked from commit e39b3d2d65688df0e8fa4a16945158d2da85522e) --- CMakeLists.txt | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1eeab0b..59ffa48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,15 @@ cmake_minimum_required( VERSION 2.8 ) +##### include essential cmake modules ########### + +include( CheckCXXSourceCompiles ) +include( CheckFunctionExists ) +include( CheckIncludeFile ) +include( CheckLibraryExists ) +include( FindPkgConfig ) + + ##### include our cmake modules ################# set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) include( TDEMacros ) @@ -55,8 +64,6 @@ tde_setup_architecture_flags( ) ##### check for include files ################### -include( CheckIncludeFile ) - check_include_file( "sys/time.h" HAVE_SYS_TIME_H ) check_include_file( "time.h" TIME_WITH_SYS_TIME ) check_include_file( "stdio.h" HAVE_STDIO_H ) @@ -73,8 +80,6 @@ check_include_file( "pthread.h" HAVE_LIBPTHREAD ) ##### check for system libraries ################ -include( CheckLibraryExists ) - set( DL_LIBRARIES dl ) check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL ) if( NOT HAVE_LIBDL ) @@ -87,9 +92,8 @@ endif( NOT HAVE_LIBDL ) find_package( Threads ) -##### check for functions ####################### -include( CheckFunctionExists ) +##### check for functions ####################### set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) set( CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES} ) @@ -105,11 +109,6 @@ set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} ) unset( bak_CMAKE_REQUIRED_LIBRARIES ) -##### check for modules ######################### - -include( FindPkgConfig ) - - ##### check for audiofile ####################### set( HAVE_LIBAUDIOFILE 0 ) @@ -232,8 +231,6 @@ endif( ) ##### check for TQt ############################# -include( CheckCXXSourceCompiles ) - find_package( TQt )