cmake_minimum_required(VERSION 3.2) project (ices) #Need to use our own FindThreads module to rely on a pthreads implementation for WIN32 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/") include (CheckSymbolExists) include (CheckIncludeFile) include (CheckTypeSize) include (TestBigEndian) #option (ICES_THREADSAFE "Thread safe" ON) #option (ICES_TLS "TLS" ON) set (ICES_MAJOR 2) set (ICES_MINOR 0) set (ICES_MICRO 2) set (PACKAGE "ices") set (PACKAGE_BUGREPORT "Bognor") #The address where bug reports for this package should be sent. set (PACKAGE_NAME "ices") #The full name of this package. set (PACKAGE_VERSION "${ICES_MAJOR}.${ICES_MINOR}.${ICES_MICRO}") #The version of this package. set (PACKAGE_STRING "ices-${ICES_MAJOR}.${ICES_MINOR}.${ICES_MICRO}") #The full name and version of this package. set (PACKAGE_TARNAME "ices") #The one symbol short name of this package. set (PACKAGE_URL "http://bugger.bognor.com") #The home page of this package. find_package (iconv CONFIG REQUIRED) find_package (libxml CONFIG REQUIRED) find_package (ogg CONFIG REQUIRED) find_package (vorbis CONFIG REQUIRED) find_package (libshout CONFIG REQUIRED) find_package (Threads REQUIRED) #Use the FindThreads module in ${CMAKE_SOURCE_DIR}/cmake/Modules set (HAVE_OGG 1) set (HAVE_PTHREAD 1) set (HAVE_PTHREAD_SPIN_LOCK 1) unset (HAVE_OSS) #No OSS support unset (HAVE_ROARAUDIO) #No ROAR support unset (HAVE_SUN_AUDIO) #No Sun audio support test_big_endian (WORDS_BIGENDIAN) check_include_file ("alsa/asoundlib.h" HAVE_ALSA) check_include_file ("dlfcn.h" HAVE_DLFCN_H) check_symbol_exists ("ftime" "sys/timedb.h" HAVE_FTIME) check_symbol_exists ("gettimeofday" "sys/time.h" HAVE_GETTIMEOFDAY) check_symbol_exists ("SIGHUP" "signal.h" HAVE_SIGHUP) check_symbol_exists ("SIGINT" "signal.h" HAVE_SIGINT) check_symbol_exists ("SIGUSR1" "signal.h" HAVE_SIGUSR1) check_symbol_exists ("SIGPIPE" "signal.h" HAVE_SIGPIPE) check_include_file ("inttypes.h" HAVE_INTTYPES_H) check_include_file ("memory.h" HAVE_MEMORY_H) check_include_file ("stdint.h" HAVE_STDINT_H) check_include_file ("stdlib.h" HAVE_STDLIB_H) check_include_file ("strings.h" HAVE_STRINGS_H) check_include_file ("string.h" HAVE_STRING_H) check_include_file ("stropts.h" HAVE_STROPTS_H) check_include_file ("sys/select.h" HAVE_SYS_SELECT_H) check_include_file ("sys/stat.h" HAVE_SYS_STAT_H) check_include_file ("sys/timeb.h" HAVE_SYS_TIMEB_H) check_include_file ("sys/types.h" HAVE_SYS_TYPES_H) check_include_file ("unistd.h" HAVE_UNISTD_H) configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h ) add_executable (ices "") target_sources (ices PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/config.h src/audio.c src/audio.h src/cfgparse.c src/cfgparse.h src/encode.c src/encode.h src/event.h src/ices.c src/im_playlist.c src/im_playlist.h src/im_stdinpcm.c src/im_stdinpcm.h src/input.c src/input.h src/inputmodule.h src/logging.h src/metadata.c src/metadata.h src/playlist_basic.c src/playlist_basic.h src/reencode.c src/reencode.h src/resample.c src/resample.h src/signals.c src/signals.h src/stream.c src/stream.h src/stream_shared.c src/stream_shared.h src/avl/avl.c src/avl/avl.h src/log/log.c src/log/log.h src/thread/thread.c src/thread/thread.h src/timing/timing.c src/timing/timing.h ) #Scripting relies on piping from another program if (UNIX) target_sources (ices PRIVATE src/playlist_script.c) endif() if(HAVE_OSS) target_sources (ices PRIVATE src/im_oss.c src/im_oss.h) endif() if(HAVE_ROARAUDIO) target_sources (ices PRIVATE src/im_roar.c src/im_roar.h) endif() if (HAVE_SUN_AUDIO) target_sources (ices PRIVATE src/im_sun.c src/im_sun.h) endif() if (HAVE_ALSA) target_sources (ices PRIVATE src/im_alsa.c src/im_alsa.h) endif() target_link_libraries (ices PRIVATE ogg libshout Threads::Threads libxml2::libxml2) target_include_directories (ices PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src) target_compile_definitions (ices PRIVATE HAVE_CONFIG_H) if (MSVC) target_compile_definitions (ices PRIVATE _CRT_SECURE_NO_WARNINGS) endif (MSVC) install (TARGETS ices RUNTIME DESTINATION bin)