Branch: master

e39b3d2d 2014-09-15 14:46:19 Slávek Banko
Fix FTBFS due to late includes in CMake
M CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 47215ec..4c73f48 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 )
@@ -56,8 +65,6 @@
 
 ##### 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 )
@@ -74,8 +81,6 @@
 
 ##### check for system libraries ################
 
-include( CheckLibraryExists )
-
 set( DL_LIBRARIES dl )
 check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
 if( NOT HAVE_LIBDL )
@@ -88,9 +93,8 @@
 
 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} )
@@ -104,11 +108,6 @@
 check_function_exists( bcopy HAVE_BCOPY )
 set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
 unset( bak_CMAKE_REQUIRED_LIBRARIES )
-
-
-##### check for modules #########################
-
-include( FindPkgConfig )
 
 
 ##### check for audiofile #######################
@@ -232,8 +231,6 @@
 
 
 ##### check for TQt #############################
-
-include( CheckCXXSourceCompiles )
 
 find_package( TQt )