/[svn]/qsampler/trunk/CMakeLists.txt
ViewVC logotype

Diff of /qsampler/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3567 by capela, Sat Aug 24 21:37:32 2019 UTC revision 3867 by capela, Sat Mar 27 12:27:37 2021 UTC
# Line 1  Line 1 
1  project(QSAMPLER)  cmake_minimum_required(VERSION 3.10)
2    
3  cmake_minimum_required(VERSION 2.6)  project(qsampler
4      VERSION 0.9.3
5  set (VERSION "0.5.7")    DESCRIPTION "A LinuxSampler Qt GUI Interface"
6      LANGUAGES C CXX)
7    
8    set (CONFIG_VERSION ${PROJECT_VERSION})
9  execute_process (  execute_process (
10    COMMAND git describe --tags --dirty --abbrev=6    COMMAND git describe --tags --dirty --abbrev=6
11    OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT    OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
# Line 11  execute_process ( Line 13  execute_process (
13    OUTPUT_STRIP_TRAILING_WHITESPACE)    OUTPUT_STRIP_TRAILING_WHITESPACE)
14  if (GIT_DESCRIBE_RESULT EQUAL 0)  if (GIT_DESCRIBE_RESULT EQUAL 0)
15    set (VERSION "${GIT_DESCRIBE_OUTPUT}")    set (VERSION "${GIT_DESCRIBE_OUTPUT}")
16    string (REGEX REPLACE "^[^_vV]+" "" VERSION "${VERSION}")    string (REGEX REPLACE "^[^0-9]+" "" VERSION "${VERSION}")
   string (REGEX REPLACE "^[_vV]+"  "" VERSION "${VERSION}")  
17    string (REGEX REPLACE "-g"   "git." VERSION "${VERSION}")    string (REGEX REPLACE "-g"   "git." VERSION "${VERSION}")
18    string (REGEX REPLACE "[_|-]+"  "." VERSION "${VERSION}")    string (REGEX REPLACE "[_|-]+"  "." VERSION "${VERSION}")
19    execute_process (    execute_process (
# Line 22  if (GIT_DESCRIBE_RESULT EQUAL 0) Line 23  if (GIT_DESCRIBE_RESULT EQUAL 0)
23      OUTPUT_STRIP_TRAILING_WHITESPACE)      OUTPUT_STRIP_TRAILING_WHITESPACE)
24    if (GIT_REVPARSE_RESULT EQUAL 0 AND NOT GIT_REVPARSE_OUTPUT STREQUAL "master")    if (GIT_REVPARSE_RESULT EQUAL 0 AND NOT GIT_REVPARSE_OUTPUT STREQUAL "master")
25      set (VERSION "${VERSION} [${GIT_REVPARSE_OUTPUT}]")      set (VERSION "${VERSION} [${GIT_REVPARSE_OUTPUT}]")
26    endif ()      endif ()
27    else ()
28      set (VERSION "${PROJECT_VERSION}")
29  endif ()  endif ()
30    
31  set (PACKAGE_NAME "Qsampler")  set (PACKAGE_NAME "Qsampler")
# Line 31  set (PACKAGE_BUGREPORT "rncbc@rncbc.org" Line 34  set (PACKAGE_BUGREPORT "rncbc@rncbc.org"
34  set (PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")  set (PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
35  set (PACKAGE_TARNAME "qsampler")  set (PACKAGE_TARNAME "qsampler")
36    
37    set (ac_version "${PROJECT_VERSION}")
38    set (ac_prefix "${CMAKE_INSTALL_PREFIX}")
39    
40  set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}")  set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}")
41    
42  if (CMAKE_BUILD_TYPE)  if (CMAKE_BUILD_TYPE)
43    set (CONFIG_BUILD_TYPE CMAKE_BUILD_TYPE)    set (CONFIG_BUILD_TYPE ${CMAKE_BUILD_TYPE})
44  else ()  else ()
45    set (CONFIG_BUILD_TYPE "release")    set (CONFIG_BUILD_TYPE "release")
46  endif ()  endif ()
47    
48  set (CONFIG_DEBUG)  set (CONFIG_DEBUG 0)
49  if (CONFIG_BUILD_TYPE MATCHES "debug")  if (CONFIG_BUILD_TYPE MATCHES "debug")
50    set(CONFIG_DEBUG 1)    set (CONFIG_DEBUG 1)
51  endif ()  endif ()
52    
53  set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")  set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
54    
55    include (GNUInstallDirs)
56    set (CONFIG_BINDIR  "${CONFIG_PREFIX}/${CMAKE_INSTALL_BINDIR}")
57    set (CONFIG_LIBDIR  "${CONFIG_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
58    set (CONFIG_DATADIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_DATADIR}")
59    set (CONFIG_MANDIR  "${CONFIG_PREFIX}/${CMAKE_INSTALL_MANDIR}")
60    
61    
62  # Enable libgig availability.  # Enable libgig availability.
63  option (CONFIG_LIBGIG "Enable libgig interface (default=yes)" 1)  option (CONFIG_LIBGIG "Enable libgig interface (default=yes)" 1)
# Line 55  option (CONFIG_XUNIQUE "Enable unique/si Line 68  option (CONFIG_XUNIQUE "Enable unique/si
68  # Enable debugger stack-trace option (assumes --enable-debug).  # Enable debugger stack-trace option (assumes --enable-debug).
69  option (CONFIG_STACKTRACE "Enable debugger stack-trace (default=no)" 0)  option (CONFIG_STACKTRACE "Enable debugger stack-trace (default=no)" 0)
70    
71    
72  # Fix for new CMAKE_REQUIRED_LIBRARIES policy.  # Fix for new CMAKE_REQUIRED_LIBRARIES policy.
73  if (POLICY CMP0075)  if (POLICY CMP0075)
74    cmake_policy (SET CMP0075 NEW)    cmake_policy (SET CMP0075 NEW)
75  endif ()  endif ()
76    
77  # Check for Qt  # Check for Qt
78  find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core Gui Widgets Network)  find_package (QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
79  find_package (Qt5LinguistTools)  find_package (Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets)
80    
81    if (CONFIG_XUNIQUE)
82      find_package (Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Network)
83    endif ()
84    
85    find_package (Qt${QT_VERSION_MAJOR}LinguistTools)
86    
 include (GNUInstallDirs)  
87  include (CheckIncludeFile)  include (CheckIncludeFile)
88  include (CheckIncludeFiles)  include (CheckIncludeFiles)
89  include (CheckIncludeFileCXX)  include (CheckIncludeFileCXX)
# Line 95  endif () Line 114  endif ()
114  find_package (PkgConfig REQUIRED)  find_package (PkgConfig REQUIRED)
115    
116  # Check for LSCP libraries.  # Check for LSCP libraries.
117  pkg_check_modules (LSCP REQUIRED lscp)  pkg_check_modules (LSCP REQUIRED IMPORTED_TARGET lscp)
118  set (CONFIG_LIBLSCP ${LSCP_FOUND})  if (LSCP_FOUND)
119  if (CONFIG_LIBLSCP)    set (CONFIG_LIBLSCP 1)
120    include_directories (${LSCP_INCLUDE_DIRS})    include_directories (${LSCP_INCLUDE_DIRS})
121    link_directories (${LSCP_LIBRARY_DIRS})    link_directories (${LSCP_LIBRARY_DIRS})
122    # link_libraries (${LSCP_LIBRARIES})
123    set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}")    set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}")
124    # Check for for instrument_name in lscp_channel_info_t.    # Check for for instrument_name in lscp_channel_info_t.
125    check_include_file (lscp/client.h CONFIG_INSTRUMENT_NAME)    check_include_file (lscp/client.h HAVE_LSCP_CLIENT_H)
126      if (NOT HAVE_LSCP_CLIENT_H)
127        set (CONFIG_INSTRUMENT_NAME 0)
128      else ()
129        set (CONFIG_INSTRUMENT_NAME 1)    
130      endif ()
131    # Check for mute/solo in lscp_channel_info_t.    # Check for mute/solo in lscp_channel_info_t.
132    check_include_file (lscp/client.h CONFIG_MUTE_SOLO)    if (NOT HAVE_LSCP_CLIENT_H)
133        set (CONFIG_MUTE_SOLO 0)
134      else ()
135        set (CONFIG_MUTE_SOLO 1)    
136      endif ()
137    if (CONFIG_MUTE_SOLO)    if (CONFIG_MUTE_SOLO)
138      check_function_exists (lscp_set_channel_mute CONFIG_MUTE_SOLO)      check_function_exists (lscp_set_channel_mute CONFIG_MUTE_SOLO)
139    endif ()    endif ()
# Line 117  if (CONFIG_LIBLSCP) Line 146  if (CONFIG_LIBLSCP)
146    check_function_exists (lscp_create_fxsend CONFIG_FXSEND)    check_function_exists (lscp_create_fxsend CONFIG_FXSEND)
147    # Check for FX send level in lscp_fxsend_info_t    # Check for FX send level in lscp_fxsend_info_t
148    if (CONFIG_FXSEND)    if (CONFIG_FXSEND)
149      check_include_file (lscp/client.h CONFIG_FXSEND_LEVEL)      if (NOT HAVE_LSCP_CLIENT_H)
150          set (CONFIG_FXSEND_LEVEL 0)
151        else ()
152          set (CONFIG_FXSEND_LEVEL 1)    
153        endif ()
154    endif ()    endif ()
155    # Check if FX send rename is available.    # Check if FX send rename is available.
156    if (CONFIG_FXSEND)    if (CONFIG_FXSEND)
157      check_function_exists (lscp_set_fxsend_name CONFIG_FXSEND_RENAME)      check_function_exists (lscp_set_fxsend_name CONFIG_FXSEND_RENAME)
158    endif ()    endif ()
159    # Check for audio_routing array type    # Check for audio_routing array type
160    check_include_file (lscp/client.h CONFIG_AUDIO_ROUTING)    if (NOT HAVE_LSCP_CLIENT_H)
161        set (CONFIG_AUDIO_ROUTING 0)
162      else ()
163        set (CONFIG_AUDIO_ROUTING 1)    
164      endif ()
165    # Check if global volume is available.    # Check if global volume is available.
166    check_function_exists (lscp_set_volume CONFIG_VOLUME)    check_function_exists (lscp_set_volume CONFIG_VOLUME)
167    # Check if instrument editing is available.    # Check if instrument editing is available.
168    check_function_exists (lscp_edit_channel_instrument CONFIG_EDIT_INSTRUMENT)    check_function_exists (lscp_edit_channel_instrument CONFIG_EDIT_INSTRUMENT)
169    # Check for CHANNEL_MIDI LSCP event support in liblscp],    # Check for CHANNEL_MIDI LSCP event support in liblscp],
170    check_include_file (lscp/event.h CONFIG_EVENT_CHANNEL_MIDI)    check_include_file (lscp/event.h HAVE_LSCP_EVENT_H)
171      if (NOT HAVE_LSCP_EVENT_H)
172        set (CONFIG_EVENT_CHANNEL_MIDI 0)
173      else ()
174        set (CONFIG_EVENT_CHANNEL_MIDI 1)    
175      endif ()
176    # Check for DEVICE_MIDI LSCP event support in liblscp],    # Check for DEVICE_MIDI LSCP event support in liblscp],
177    check_include_file (lscp/event.h CONFIG_EVENT_DEVICE_MIDI)    if (NOT HAVE_LSCP_EVENT_H)
178        set (CONFIG_EVENT_DEVICE_MIDI 0)
179      else ()
180        set (CONFIG_EVENT_DEVICE_MIDI 1)    
181      endif ()
182    # Check if max. voices / streams is available.    # Check if max. voices / streams is available.
183    check_function_exists (lscp_get_voices CONFIG_MAX_VOICES)    check_function_exists (lscp_get_voices CONFIG_MAX_VOICES)
184  else ()  else ()
185    message (FATAL_ERROR "*** LSCP library not found.")    message (FATAL_ERROR "*** LSCP library not found.")
186      set (CONFIG_LIBLSCP 0)
187  endif ()  endif ()
188    
189  # Check for GIG libraries.  # Check for GIG libraries.
190  if (CONFIG_LIBGIG)  if (CONFIG_LIBGIG)
191    pkg_check_modules (GIG gig>=3.3.0)    pkg_check_modules (GIG IMPORTED_TARGET gig>=3.3.0)
192    set (CONFIG_LIBGIG ${GIG_FOUND})    if (GIG_FOUND)
   if (CONFIG_LIBGIG)  
193      include_directories (${GIG_INCLUDE_DIRS})      include_directories (${GIG_INCLUDE_DIRS})
194      link_directories (${GIG_LIBRARY_DIRS})      link_directories (${GIG_LIBRARY_DIRS})
195      link_libraries (${GIG_LIBRARIES})      link_libraries (${GIG_LIBRARIES})
# Line 151  if (CONFIG_LIBGIG) Line 197  if (CONFIG_LIBGIG)
197      # liggig supports fast information retrieval.      # liggig supports fast information retrieval.
198      set (CONFIG_LIBGIG_SETAUTOLOAD 1)      set (CONFIG_LIBGIG_SETAUTOLOAD 1)
199      # Check if libgig/SF.h is available.      # Check if libgig/SF.h is available.
200      check_include_file_cxx (libgig/SF.h CONFIG_LIBGIG_SF2)      check_include_file_cxx (libgig/SF.h HAVE_LIBGIG_SF_H)
201        if (NOT HAVE_LIBGIG_SF_H)
202          set (CONFIG_LIBGIG_SF2 0)
203        else ()
204          set (CONFIG_LIBGIG_SF2 1)    
205        endif ()
206    else ()    else ()
207      message (WARNING "*** GIG library not found.")      message (WARNING "*** GIG library not found.")
208        set (CONFIG_LIBGIG 0)
209    endif ()    endif ()
210  endif ()  endif ()
211    
# Line 168  install (FILES qsampler.fr.1 DESTINATION Line 220  install (FILES qsampler.fr.1 DESTINATION
220  # Configuration status  # Configuration status
221  macro (SHOW_OPTION text value)  macro (SHOW_OPTION text value)
222    if (${value})    if (${value})
223      message( "${text}: yes" )      message ("${text}: yes")
224    else ()    else ()
225      message( "${text}: no" )      message ("${text}: no")
226    endif ()    endif ()
227  endmacro ()  endmacro ()
228    
229  message (  "\n  ${PACKAGE_NAME} ${PACKAGE_VERSION}")  
230  message (  "\n  Build target . . . . . . . . . . . . . . . . . . .: ${CONFIG_BUILD_TYPE}\n")  message   ("\n  ${PACKAGE_NAME} ${PACKAGE_VERSION}")
231    message   ("\n  Build target . . . . . . . . . . . . . . . . . . .: ${CONFIG_BUILD_TYPE}\n")
232  show_option ("  LSCP instrument name support . . . . . . . . . . ." CONFIG_INSTRUMENT_NAME)  show_option ("  LSCP instrument name support . . . . . . . . . . ." CONFIG_INSTRUMENT_NAME)
233  show_option ("  LSCP mute/solo support . . . . . . . . . . . . . ." CONFIG_MUTE_SOLO)  show_option ("  LSCP mute/solo support . . . . . . . . . . . . . ." CONFIG_MUTE_SOLO)
234  show_option ("  LSCP MIDI instrument support . . . . . . . . . . ." CONFIG_MIDI_INSTRUMENT)  show_option ("  LSCP MIDI instrument support . . . . . . . . . . ." CONFIG_MIDI_INSTRUMENT)
# Line 193  endif () Line 246  endif ()
246  show_option ("  LSCP channel MIDI event support  . . . . . . . . ." CONFIG_EVENT_CHANNEL_MIDI)  show_option ("  LSCP channel MIDI event support  . . . . . . . . ." CONFIG_EVENT_CHANNEL_MIDI)
247  show_option ("  LSCP device MIDI event support . . . . . . . . . ." CONFIG_EVENT_DEVICE_MIDI)  show_option ("  LSCP device MIDI event support . . . . . . . . . ." CONFIG_EVENT_DEVICE_MIDI)
248  show_option ("  LSCP runtime max. voices / disk streams support  ." CONFIG_MAX_VOICES)  show_option ("  LSCP runtime max. voices / disk streams support  ." CONFIG_MAX_VOICES)
249  message ("")  message     ("")
250  show_option ("  Unique/Single instance support . . . . . . . . . ." CONFIG_XUNIQUE)  show_option ("  Unique/Single instance support . . . . . . . . . ." CONFIG_XUNIQUE)
251  show_option ("  Debugger stack-trace (gdb) . . . . . . . . . . . ." CONFIG_STACKTRACE)  show_option ("  Debugger stack-trace (gdb) . . . . . . . . . . . ." CONFIG_STACKTRACE)
252  message (  "\n  Install prefix . . . . . . . . . . . . . . . . . . ${CMAKE_INSTALL_PREFIX}")  message   ("\n  Install prefix . . . . . . . . . . . . . . . . . .: ${CMAKE_INSTALL_PREFIX}")
253  message (  "\nNow type 'make', followed by 'make install' as root.\n")  message   ("\nNow type 'make', followed by 'make install' as root.\n")

Legend:
Removed from v.3567  
changed lines
  Added in v.3867

  ViewVC Help
Powered by ViewVC