summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake134
1 files changed, 134 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
new file mode 100644
index 0000000..d587bf1
--- /dev/null
+++ b/ConfigureChecks.cmake
@@ -0,0 +1,134 @@
+###########################################
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 3 #
+# #
+###########################################
+
+
+# required stuff
+find_package( TQt )
+find_package( TDE )
+
+tde_setup_architecture_flags( )
+
+include(TestBigEndian)
+test_big_endian(WORDS_BIGENDIAN)
+
+tde_setup_largefiles( )
+
+set( ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}:${LIB_INSTALL_DIR}/pkgconfig" )
+
+
+##### check for gcc visibility support
+
+if( WITH_GCC_VISIBILITY )
+ tde_setup_gcc_visibility( )
+endif( WITH_GCC_VISIBILITY )
+
+
+##### check for libexiv2
+
+pkg_search_module( EXIV2 exiv2 )
+if( NOT EXIV2_FOUND )
+ tde_message_fatal( "exiv2 is required, but was not found on your system" )
+endif( NOT EXIV2_FOUND )
+
+check_include_file_cxx( "exiv2/exiv2.hpp" HAVE_EXIV2_EXIV2_HPP )
+
+
+##### check for libjpeg
+
+find_package( JPEG )
+if( NOT JPEG_FOUND )
+ tde_message_fatal( "jpeg library is required, but was not found on your system" )
+endif()
+
+
+##### checks for libkipi
+
+if( WITH_KIPI )
+ pkg_search_module( LIBKIPI libkipi )
+ if( NOT LIBKIPI_FOUND )
+ tde_message_fatal( "libkipi was requested but not found on your system." )
+ endif( )
+ set( GV_HAVE_KIPI 1 )
+endif( )
+
+
+##### checks for libmng
+
+if( WITH_MNG )
+ find_file( HAVE_LIBMNG_H "libmng.h" )
+ if( NOT HAVE_LIBMNG_H )
+ tde_message_fatal( "libmng was requested but not found on your system." )
+ endif( )
+ set( MNG_LIBRARY mng )
+ set( HAVE_LIBMNG 1 )
+endif( )
+
+
+##### check for libpng
+
+find_package( PNG )
+if( NOT PNG_FOUND )
+ tde_message_fatal( "png library is required, but was not found on your system" )
+endif()
+
+
+##### check for libxcursor
+if( WITH_XCURSOR )
+ pkg_search_module( XCURSOR xcursor )
+ if( XCURSOR_FOUND )
+ set( GV_HAVE_XCURSOR 1 )
+ else( )
+ tde_message_fatal( "xcursor library is required, but was not found on your system" )
+ endif( )
+endif()
+
+
+##### check for lround function
+
+tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "m" )
+check_symbol_exists ( lround "math.h" HAVE_LROUND )
+tde_restore( CMAKE_REQUIRED_LIBRARIES )
+if( NOT HAVE_LROUND )
+ set( HAVE_LROUND 0 )
+endif( NOT HAVE_LROUND )
+
+
+##### check architecture
+
+if( NOT CMAKE_ARCHITECTURE )
+ execute_process(
+ COMMAND ${CMAKE_C_COMPILER} -dumpmachine
+ OUTPUT_VARIABLE CMAKE_ARCHITECTURE
+ ERROR_VARIABLE CMAKE_ARCHITECTURE
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE )
+ set( CMAKE_ARCHITECTURE "${CMAKE_ARCHITECTURE}" CACHE INTERNAL "" FORCE )
+ message( STATUS "Detected ${CMAKE_ARCHITECTURE} target architecture" )
+endif( )
+
+
+##### check specific architecture dependant support
+
+if( ${CMAKE_ARCHITECTURE} MATCHES "i.86" )
+
+ # MMX support
+ message( STATUS "Performing MMX support test" )
+ check_c_source_compiles( "
+ int main() {
+ #if defined(__GNUC__)
+ __asm__(\"pxor %mm0, %mm0\");
+ #else
+ #error Not gcc on x86/x86_64
+ #endif
+ return 0;
+ }"
+ HAVE_X86_MMX
+ )
+
+endif( )
+