--- qsampler/trunk/CMakeLists.txt 2019/08/25 14:17:00 3568 +++ qsampler/trunk/CMakeLists.txt 2019/12/26 14:51:26 3675 @@ -1,9 +1,10 @@ project(QSAMPLER) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.1) -set (VERSION "0.5.7") +set (VERSION "0.6.2") +set (CONFIG_VERSION ${VERSION}) execute_process ( COMMAND git describe --tags --dirty --abbrev=6 OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT @@ -11,7 +12,7 @@ OUTPUT_STRIP_TRAILING_WHITESPACE) if (GIT_DESCRIBE_RESULT EQUAL 0) set (VERSION "${GIT_DESCRIBE_OUTPUT}") - string (REGEX REPLACE "^[^_vV]+" "" VERSION "${VERSION}") + string (REGEX REPLACE "^[^_]+" "" VERSION "${VERSION}") string (REGEX REPLACE "^[_vV]+" "" VERSION "${VERSION}") string (REGEX REPLACE "-g" "git." VERSION "${VERSION}") string (REGEX REPLACE "[_|-]+" "." VERSION "${VERSION}") @@ -22,7 +23,7 @@ OUTPUT_STRIP_TRAILING_WHITESPACE) if (GIT_REVPARSE_RESULT EQUAL 0 AND NOT GIT_REVPARSE_OUTPUT STREQUAL "master") set (VERSION "${VERSION} [${GIT_REVPARSE_OUTPUT}]") - endif () + endif () endif () set (PACKAGE_NAME "Qsampler") @@ -34,17 +35,24 @@ set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}") if (CMAKE_BUILD_TYPE) - set (CONFIG_BUILD_TYPE CMAKE_BUILD_TYPE) + set (CONFIG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) else () set (CONFIG_BUILD_TYPE "release") endif () -set (CONFIG_DEBUG) +set (CONFIG_DEBUG 0) if (CONFIG_BUILD_TYPE MATCHES "debug") - set(CONFIG_DEBUG 1) + set (CONFIG_DEBUG 1) endif () + set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}") +include (GNUInstallDirs) +set (CONFIG_BINDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_BINDIR}") +set (CONFIG_LIBDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +set (CONFIG_DATADIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_DATADIR}") +set (CONFIG_MANDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_MANDIR}") + # Enable libgig availability. option (CONFIG_LIBGIG "Enable libgig interface (default=yes)" 1) @@ -55,16 +63,21 @@ # Enable debugger stack-trace option (assumes --enable-debug). option (CONFIG_STACKTRACE "Enable debugger stack-trace (default=no)" 0) + # Fix for new CMAKE_REQUIRED_LIBRARIES policy. if (POLICY CMP0075) cmake_policy (SET CMP0075 NEW) endif () # Check for Qt -find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core Gui Widgets Network) +find_package (Qt5 REQUIRED COMPONENTS Core Gui Widgets) + +if (CONFIG_XUNIQUE) + find_package (Qt5 REQUIRED COMPONENTS Network) +endif () + find_package (Qt5LinguistTools) -include (GNUInstallDirs) include (CheckIncludeFile) include (CheckIncludeFiles) include (CheckIncludeFileCXX) @@ -96,15 +109,25 @@ # Check for LSCP libraries. pkg_check_modules (LSCP REQUIRED lscp) -set (CONFIG_LIBLSCP ${LSCP_FOUND}) -if (CONFIG_LIBLSCP) +if (LSCP_FOUND) + set (CONFIG_LIBLSCP 1) include_directories (${LSCP_INCLUDE_DIRS}) link_directories (${LSCP_LIBRARY_DIRS}) +# link_libraries (${LSCP_LIBRARIES}) set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}") # Check for for instrument_name in lscp_channel_info_t. - check_include_file (lscp/client.h CONFIG_INSTRUMENT_NAME) + check_include_file (lscp/client.h HAVE_LSCP_CLIENT_H) + if (NOT HAVE_LSCP_CLIENT_H) + set (CONFIG_INSTRUMENT_NAME 0) + else () + set (CONFIG_INSTRUMENT_NAME 1) + endif () # Check for mute/solo in lscp_channel_info_t. - check_include_file (lscp/client.h CONFIG_MUTE_SOLO) + if (NOT HAVE_LSCP_CLIENT_H) + set (CONFIG_MUTE_SOLO 0) + else () + set (CONFIG_MUTE_SOLO 1) + endif () if (CONFIG_MUTE_SOLO) check_function_exists (lscp_set_channel_mute CONFIG_MUTE_SOLO) endif () @@ -117,33 +140,50 @@ check_function_exists (lscp_create_fxsend CONFIG_FXSEND) # Check for FX send level in lscp_fxsend_info_t if (CONFIG_FXSEND) - check_include_file (lscp/client.h CONFIG_FXSEND_LEVEL) + if (NOT HAVE_LSCP_CLIENT_H) + set (CONFIG_FXSEND_LEVEL 0) + else () + set (CONFIG_FXSEND_LEVEL 1) + endif () endif () # Check if FX send rename is available. if (CONFIG_FXSEND) check_function_exists (lscp_set_fxsend_name CONFIG_FXSEND_RENAME) endif () # Check for audio_routing array type - check_include_file (lscp/client.h CONFIG_AUDIO_ROUTING) + if (NOT HAVE_LSCP_CLIENT_H) + set (CONFIG_AUDIO_ROUTING 0) + else () + set (CONFIG_AUDIO_ROUTING 1) + endif () # Check if global volume is available. check_function_exists (lscp_set_volume CONFIG_VOLUME) # Check if instrument editing is available. check_function_exists (lscp_edit_channel_instrument CONFIG_EDIT_INSTRUMENT) # Check for CHANNEL_MIDI LSCP event support in liblscp], - check_include_file (lscp/event.h CONFIG_EVENT_CHANNEL_MIDI) + check_include_file (lscp/event.h HAVE_LSCP_EVENT_H) + if (NOT HAVE_LSCP_EVENT_H) + set (CONFIG_EVENT_CHANNEL_MIDI 0) + else () + set (CONFIG_EVENT_CHANNEL_MIDI 1) + endif () # Check for DEVICE_MIDI LSCP event support in liblscp], - check_include_file (lscp/event.h CONFIG_EVENT_DEVICE_MIDI) + if (NOT HAVE_LSCP_EVENT_H) + set (CONFIG_EVENT_DEVICE_MIDI 0) + else () + set (CONFIG_EVENT_DEVICE_MIDI 1) + endif () # Check if max. voices / streams is available. check_function_exists (lscp_get_voices CONFIG_MAX_VOICES) else () message (FATAL_ERROR "*** LSCP library not found.") + set (CONFIG_LIBLSCP 0) endif () # Check for GIG libraries. if (CONFIG_LIBGIG) pkg_check_modules (GIG gig>=3.3.0) - set (CONFIG_LIBGIG ${GIG_FOUND}) - if (CONFIG_LIBGIG) + if (GIG_FOUND) include_directories (${GIG_INCLUDE_DIRS}) link_directories (${GIG_LIBRARY_DIRS}) link_libraries (${GIG_LIBRARIES}) @@ -151,9 +191,15 @@ # liggig supports fast information retrieval. set (CONFIG_LIBGIG_SETAUTOLOAD 1) # Check if libgig/SF.h is available. - check_include_file_cxx (libgig/SF.h CONFIG_LIBGIG_SF2) + check_include_file_cxx (libgig/SF.h HAVE_LIBGIG_SF_H) + if (NOT HAVE_LIBGIG_SF_H) + set (CONFIG_LIBGIG_SF2 0) + else () + set (CONFIG_LIBGIG_SF2 1) + endif () else () message (WARNING "*** GIG library not found.") + set (CONFIG_LIBGIG 0) endif () endif () @@ -168,14 +214,15 @@ # Configuration status macro (SHOW_OPTION text value) if (${value}) - message("${text}: yes") + message ("${text}: yes") else () - message("${text}: no") + message ("${text}: no") endif () endmacro () -message (" ${PACKAGE_NAME} ${PACKAGE_VERSION}\n") -message (" Build target . . . . . . . . . . . . . . . . . . .: ${CONFIG_BUILD_TYPE}\n") + +message ("\n ${PACKAGE_NAME} ${PACKAGE_VERSION}") +message ("\n Build target . . . . . . . . . . . . . . . . . . .: ${CONFIG_BUILD_TYPE}\n") show_option (" LSCP instrument name support . . . . . . . . . . ." CONFIG_INSTRUMENT_NAME) show_option (" LSCP mute/solo support . . . . . . . . . . . . . ." CONFIG_MUTE_SOLO) show_option (" LSCP MIDI instrument support . . . . . . . . . . ." CONFIG_MIDI_INSTRUMENT) @@ -193,9 +240,8 @@ show_option (" LSCP channel MIDI event support . . . . . . . . ." CONFIG_EVENT_CHANNEL_MIDI) show_option (" LSCP device MIDI event support . . . . . . . . . ." CONFIG_EVENT_DEVICE_MIDI) show_option (" LSCP runtime max. voices / disk streams support ." CONFIG_MAX_VOICES) -message ("") +message ("") show_option (" Unique/Single instance support . . . . . . . . . ." CONFIG_XUNIQUE) show_option (" Debugger stack-trace (gdb) . . . . . . . . . . . ." CONFIG_STACKTRACE) -message ("") -message (" Install prefix . . . . . . . . . . . . . . . . . .: ${CMAKE_INSTALL_PREFIX}\n") -message ("Now type 'make', followed by 'make install' as root.\n") +message ("\n Install prefix . . . . . . . . . . . . . . . . . .: ${CMAKE_INSTALL_PREFIX}") +message ("\nNow type 'make', followed by 'make install' as root.\n")