From 8b12682035e2ae92a29a9ce12abc5fbcf38b1192 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 --- kscd/CMakeLists.txt | 66 ++++++++++++++++++++++++++++++++++++++ kscd/ConfigureChecks.cmake | 55 ++++++++++++++++++++++++++++++++ kscd/libwm/CMakeLists.txt | 38 ++++++++++++++++++++++ kscd/libwm/ConfigureChecks.cmake | 69 ++++++++++++++++++++++++++++++++++++++++ kscd/libwm/audio/CMakeLists.txt | 32 +++++++++++++++++++ 5 files changed, 260 insertions(+) create mode 100644 kscd/CMakeLists.txt create mode 100644 kscd/ConfigureChecks.cmake create mode 100644 kscd/libwm/CMakeLists.txt create mode 100644 kscd/libwm/ConfigureChecks.cmake create mode 100644 kscd/libwm/audio/CMakeLists.txt (limited to 'kscd') diff --git a/kscd/CMakeLists.txt b/kscd/CMakeLists.txt new file mode 100644 index 00000000..d6f74be7 --- /dev/null +++ b/kscd/CMakeLists.txt @@ -0,0 +1,66 @@ +################################################# +# +# (C) 2017 Slávek Banko +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include( ConfigureChecks.cmake ) + +add_subdirectory( libwm ) +tde_install_icons( cdsmall DESTINATION ${DATA_INSTALL_DIR}/kscd/icons ) +tde_install_icons( kscd ) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/libkcddb + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${ARTSC_LIBRARY_DIRS} +) + + +##### kcompactdisc (library) #################### + +tde_add_library( kcompactdisc STATIC_PIC AUTOMOC + SOURCES kcompactdisc.cpp +) + + +##### kscd (executable) ######################### + +tde_add_executable( kscd AUTOMOC + SOURCES + panel.ui kscd.cpp kscd.skel ledlamp.cpp + docking.cpp bwlednum.cpp + configWidget.cpp configWidgetUI.ui prefs.kcfgc cddbdlg.cpp + LINK + DCOP-shared tdecore-shared tdeui-shared tdefx-shared + tdeio-shared tdeutils-shared tdetexteditor-shared + kcddb-shared kcompactdisc-static workman-static + ${CDROM_LIBRARIRES} ${CDAUDIO_LIBRARIES} ${FPE_LIBRARIES} + ${ALSA_LIBRARIES} + DESTINATION ${BIN_INSTALL_DIR} +) + + +##### other data ################################ + +install( PROGRAMS workman2cddb.pl DESTINATION ${BIN_INSTALL_DIR} ) + +install( FILES kscd.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) +install( FILES xmcd.desktop DESTINATION ${MIME_INSTALL_DIR}/text ) +install( FILES kscd.kcfg DESTINATION ${KCFG_INSTALL_DIR} ) +install( FILES kscd.profile.xml DESTINATION ${DATA_INSTALL_DIR}/profiles ) +install( FILES audiocd_play.desktop DESTINATION ${DATA_INSTALL_DIR}/konqueror/servicemenus ) diff --git a/kscd/ConfigureChecks.cmake b/kscd/ConfigureChecks.cmake new file mode 100644 index 00000000..8047bed7 --- /dev/null +++ b/kscd/ConfigureChecks.cmake @@ -0,0 +1,55 @@ +################################################# +# +# (C) 2017 Slávek Banko +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( "${CMAKE_SYSTEM_NAME}" MATCHES "IRIX" ) + # IRIX cdaudio + if( NOT CDAUDIO ) + message( STATUS "Checking for cdaudio library" ) + find_library( CDAUDIO cdaudio ) + if( CDAUDIO ) + message( STATUS "Checking for cdaudio library - found" ) + set( CDAUDIO_LIBRARIES "cdaudio;mediad;ds" ) + else( ) + message( STATUS "Checking for cdaudio library - not found" ) + endif( ) + endif( NOT CDAUDIO ) + + # Irix CDDA + if( NOT FPE ) + message( STATUS "Checking for fpe library" ) + find_library( FPE fpe ) + if( FPE ) + message( STATUS "Checking for fpe library - found" ) + set( FPE_LIBRARIES "fpe" ) + else( ) + message( STATUS "Checking for fpe library - not found" ) + endif( ) + endif( NOT FPE ) +endif( "${CMAKE_SYSTEM_NAME}" MATCHES "IRIX" ) + +# FreeBSD +if( "${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD" ) + if( NOT CDROM ) + message( STATUS "Checking for cdrom library" ) + find_library( CDROM cdrom ) + if( CDROM ) + message( STATUS "Checking for cdrom library - found" ) + set( CDROM_LIBRARIES "cdrom" ) + else( ) + message( STATUS "Checking for cdrom library - not found" ) + endif( CDROM ) + endif( NOT CDROM ) +endif( "${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD" ) + +# aRts +if( ARTS_FOUND ) + set( USE_ARTS 1 CACHE INTERNAL "" FORCE ) +endif( ARTS_FOUND ) diff --git a/kscd/libwm/CMakeLists.txt b/kscd/libwm/CMakeLists.txt new file mode 100644 index 00000000..e40ac76e --- /dev/null +++ b/kscd/libwm/CMakeLists.txt @@ -0,0 +1,38 @@ +################################################# +# +# (C) 2017 Slávek Banko +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include( ConfigureChecks.cmake ) + +add_subdirectory( audio ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} +) + + +##### workman (library) ######################### + +tde_add_library( workman STATIC_PIC + SOURCES + cddb.c cdinfo.c cdrom.c wm_helpers.c cdtext.c + database.c index.c scsi.c cdda.c plat_linux_cdda.c plat_sun_cdda.c + plat_aix.c plat_bsd386.c plat_freebsd.c plat_hpux.c plat_irix.c + plat_linux.c plat_svr4.c plat_ultrix.c plat_news.c plat_openbsd.c + plat_osf1.c plat_sun.c plat_scor5.c + drv_sony.c drv_toshiba.c + EMBED + workmanaudio-static + LINK + pthread +) 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 ) diff --git a/kscd/libwm/audio/CMakeLists.txt b/kscd/libwm/audio/CMakeLists.txt new file mode 100644 index 00000000..1fa51fab --- /dev/null +++ b/kscd/libwm/audio/CMakeLists.txt @@ -0,0 +1,32 @@ +################################################# +# +# (C) 2017 Slávek Banko +# slavek (DOT) banko (AT) axis.cz +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_BINARY_DIR} + ${ARTSC_INCLUDE_DIRS} + ${TQT_INCLUDE_DIRS} + ${TDE_INCLUDE_DIR} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${ARTSC_LIBRARY_DIRS} +) + + +##### workmanaudio (library) #################### + +tde_add_library( workmanaudio STATIC_PIC + SOURCES + audio.c audio_alsa.c audio_arts.c audio_sun.c + LINK + ${ARTSC_LIBRARIES} +) -- cgit v1.2.1