From efcdd889254fc98314dd48854d50e90aa21e53c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 26 Mar 2017 15:58:46 +0200 Subject: Initial cmake conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko (cherry picked from commit 8b12682035e2ae92a29a9ce12abc5fbcf38b1192) --- kscd/libwm/ConfigureChecks.cmake | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 kscd/libwm/ConfigureChecks.cmake (limited to 'kscd/libwm/ConfigureChecks.cmake') diff --git a/kscd/libwm/ConfigureChecks.cmake b/kscd/libwm/ConfigureChecks.cmake new file mode 100644 index 00000000..31ce9815 --- /dev/null +++ b/kscd/libwm/ConfigureChecks.cmake @@ -0,0 +1,69 @@ +################################################# +# +# (C) 2017 Slávek Banko +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( WITH_KSCD_CDDA AND NOT BUILD_CDDA ) + + if( "${CMAKE_SYSTEM_NAME}" MATCHES "Linux" ) + + check_include_file( pthread.h HAVE_PTHREAD_H ) + check_c_source_compiles( " +#ifndef __GNUC__ +#define __GNUC__ 1 +#endif +/* needed for vanilla kernel headers, which do provide __u64 only + for ansi */ +#undef __STRICT_ANSI__ +/* needed for non-ansi kernel headers */ +#define asm __asm__ +#define inline __inline__ +#include +#include +#undef asm +#undef inline + +int main() { + #if defined(__linux__) + ioctl(1, CDROMREADAUDIO, 0); + #else + #error platform? + #endif +}" + BUILD_CDDA ) + if( NOT BUILD_CDDA ) + tde_message_fatal( "cdda support is requested, but not avaiable on your system" ) + endif( NOT BUILD_CDDA ) + + elseif( ${CMAKE_SYSTEM_NAME} MATCHES "SunOS" ) + + check_include_file( pthread.h HAVE_PTHREAD_H ) + check_c_source_compiles( " +#include +#include + +int main() { + #if defined(__sun) || defined(sun) + ioctl(1, CDROMCDDA, 0); + #else + #error platform? + #endif +}" + BUILD_CDDA ) + if( NOT BUILD_CDDA ) + tde_message_fatal( "cdda support is requested, but not avaiable on your system" ) + endif( NOT BUILD_CDDA ) + + else( ) + + message( STATUS "Checking cdda support - not available on this system type" ) + + endif( ) + +endif( WITH_KSCD_CDDA AND NOT BUILD_CDDA ) -- cgit v1.2.1