/[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 3640 by capela, Wed Nov 13 19:46:13 2019 UTC revision 3861 by capela, Mon Mar 1 15:38:42 2021 UTC
# Line 1  Line 1 
1  project(QSAMPLER)  cmake_minimum_required(VERSION 3.10)
2    
3  cmake_minimum_required(VERSION 3.1)  project(qsampler
4      VERSION 0.9.2
5      DESCRIPTION "A LinuxSampler Qt GUI Interface"
6      LANGUAGES C CXX)
7    
8  set (VERSION "0.6.1")  set (CONFIG_VERSION ${PROJECT_VERSION})
   
 set (CONFIG_VERSION ${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 12  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 "^[^_]+"   "" 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 24  if (GIT_DESCRIBE_RESULT EQUAL 0) Line 24  if (GIT_DESCRIBE_RESULT EQUAL 0)
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 70  if (POLICY CMP0075) Line 72  if (POLICY CMP0075)
72  endif ()  endif ()
73    
74  # Check for Qt  # Check for Qt
75  find_package (Qt5 REQUIRED COMPONENTS Core Gui Widgets)  find_package (QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
76    find_package (Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui Widgets)
77    
78  if (CONFIG_XUNIQUE)  if (CONFIG_XUNIQUE)
79    find_package (Qt5 REQUIRED COMPONENTS Network)    find_package (Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Network)
80  endif ()  endif ()
81    
82  find_package (Qt5LinguistTools)  find_package (Qt${QT_VERSION_MAJOR}LinguistTools)
83    
84  include (CheckIncludeFile)  include (CheckIncludeFile)
85  include (CheckIncludeFiles)  include (CheckIncludeFiles)
# Line 108  endif () Line 111  endif ()
111  find_package (PkgConfig REQUIRED)  find_package (PkgConfig REQUIRED)
112    
113  # Check for LSCP libraries.  # Check for LSCP libraries.
114  pkg_check_modules (LSCP REQUIRED lscp)  pkg_check_modules (LSCP REQUIRED IMPORTED_TARGET lscp)
115  set (CONFIG_LIBLSCP ${LSCP_FOUND})  if (LSCP_FOUND)
116  if (CONFIG_LIBLSCP)    set (CONFIG_LIBLSCP 1)
117    include_directories (${LSCP_INCLUDE_DIRS})    include_directories (${LSCP_INCLUDE_DIRS})
118    link_directories (${LSCP_LIBRARY_DIRS})    link_directories (${LSCP_LIBRARY_DIRS})
119  # link_libraries (${LSCP_LIBRARIES})  # link_libraries (${LSCP_LIBRARIES})
# Line 177  if (CONFIG_LIBLSCP) Line 180  if (CONFIG_LIBLSCP)
180    check_function_exists (lscp_get_voices CONFIG_MAX_VOICES)    check_function_exists (lscp_get_voices CONFIG_MAX_VOICES)
181  else ()  else ()
182    message (FATAL_ERROR "*** LSCP library not found.")    message (FATAL_ERROR "*** LSCP library not found.")
183      set (CONFIG_LIBLSCP 0)
184  endif ()  endif ()
185    
186  # Check for GIG libraries.  # Check for GIG libraries.
187  if (CONFIG_LIBGIG)  if (CONFIG_LIBGIG)
188    pkg_check_modules (GIG gig>=3.3.0)    pkg_check_modules (GIG IMPORTED_TARGET gig>=3.3.0)
189    set (CONFIG_LIBGIG ${GIG_FOUND})    if (GIG_FOUND)
   if (CONFIG_LIBGIG)  
190      include_directories (${GIG_INCLUDE_DIRS})      include_directories (${GIG_INCLUDE_DIRS})
191      link_directories (${GIG_LIBRARY_DIRS})      link_directories (${GIG_LIBRARY_DIRS})
192      link_libraries (${GIG_LIBRARIES})      link_libraries (${GIG_LIBRARIES})
# Line 199  if (CONFIG_LIBGIG) Line 202  if (CONFIG_LIBGIG)
202      endif ()      endif ()
203    else ()    else ()
204      message (WARNING "*** GIG library not found.")      message (WARNING "*** GIG library not found.")
205        set (CONFIG_LIBGIG 0)
206    endif ()    endif ()
207  endif ()  endif ()
208    

Legend:
Removed from v.3640  
changed lines
  Added in v.3861

  ViewVC Help
Powered by ViewVC