1 |
cmake_minimum_required(VERSION 3.10) |
cmake_minimum_required(VERSION 3.13) |
2 |
|
|
3 |
project(qsampler |
project(qsampler |
4 |
VERSION 0.9.3 |
VERSION 0.9.4 |
5 |
DESCRIPTION "A LinuxSampler Qt GUI Interface" |
DESCRIPTION "A LinuxSampler Qt GUI Interface" |
6 |
LANGUAGES C CXX) |
LANGUAGES C CXX) |
7 |
|
|
15 |
if (GIT_DESCRIBE_RESULT EQUAL 0) |
if (GIT_DESCRIBE_RESULT EQUAL 0) |
16 |
set (VERSION "${GIT_DESCRIBE_OUTPUT}") |
set (VERSION "${GIT_DESCRIBE_OUTPUT}") |
17 |
string (REGEX REPLACE "^[^0-9]+" "" VERSION "${VERSION}") |
string (REGEX REPLACE "^[^0-9]+" "" VERSION "${VERSION}") |
18 |
|
string (REGEX REPLACE "^1_" "" VERSION "${VERSION}") |
19 |
|
string (REGEX REPLACE "^[_vV]+" "" VERSION "${VERSION}") |
20 |
string (REGEX REPLACE "-g" "git." VERSION "${VERSION}") |
string (REGEX REPLACE "-g" "git." VERSION "${VERSION}") |
21 |
string (REGEX REPLACE "[_|-]+" "." VERSION "${VERSION}") |
string (REGEX REPLACE "[_|-]" "." VERSION "${VERSION}") |
22 |
execute_process ( |
execute_process ( |
23 |
COMMAND git rev-parse --abbrev-ref HEAD |
COMMAND git rev-parse --abbrev-ref HEAD |
24 |
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} |
43 |
|
|
44 |
set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}") |
set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}") |
45 |
|
|
46 |
if (CMAKE_BUILD_TYPE) |
if (CONFIG_DEBUG) |
47 |
set (CONFIG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) |
set (CMAKE_BUILD_TYPE "Debug") |
|
else () |
|
|
set (CONFIG_BUILD_TYPE "release") |
|
48 |
endif () |
endif () |
49 |
|
if (CMAKE_BUILD_TYPE MATCHES "Debug") |
|
set (CONFIG_DEBUG 0) |
|
|
if (CONFIG_BUILD_TYPE MATCHES "debug") |
|
50 |
set (CONFIG_DEBUG 1) |
set (CONFIG_DEBUG 1) |
51 |
endif () |
endif () |
52 |
|
if (CONFIG_DEBUG) |
53 |
|
set (CONFIG_BUILD_TYPE "debug") |
54 |
|
else () |
55 |
|
set (CONFIG_BUILD_TYPE "release") |
56 |
|
endif () |
57 |
|
|
58 |
set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}") |
set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}") |
59 |
|
|
75 |
|
|
76 |
|
|
77 |
# Enable Qt6 build preference. |
# Enable Qt6 build preference. |
78 |
option (CONFIG_QT6 "Enable Qt6 build (default=no)" 0) |
option (CONFIG_QT6 "Enable Qt6 build (default=yes)" 1) |
79 |
|
|
80 |
|
|
81 |
# Fix for new CMAKE_REQUIRED_LIBRARIES policy. |
# Fix for new CMAKE_REQUIRED_LIBRARIES policy. |
137 |
# Check for LSCP libraries. |
# Check for LSCP libraries. |
138 |
pkg_check_modules (LSCP REQUIRED IMPORTED_TARGET lscp) |
pkg_check_modules (LSCP REQUIRED IMPORTED_TARGET lscp) |
139 |
if (LSCP_FOUND) |
if (LSCP_FOUND) |
140 |
|
find_library(LSCP_LIBRARY NAMES ${LSCP_LIBRARIES} HINTS ${LSCP_LIBDIR}) |
141 |
|
endif () |
142 |
|
if (LSCP_LIBRARY) |
143 |
set (CONFIG_LIBLSCP 1) |
set (CONFIG_LIBLSCP 1) |
144 |
include_directories (${LSCP_INCLUDE_DIRS}) |
set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARY};${CMAKE_REQUIRED_LIBRARIES}") |
|
link_directories (${LSCP_LIBRARY_DIRS}) |
|
|
# link_libraries (${LSCP_LIBRARIES}) |
|
|
set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}") |
|
145 |
# Check for for instrument_name in lscp_channel_info_t. |
# Check for for instrument_name in lscp_channel_info_t. |
146 |
check_include_file (lscp/client.h HAVE_LSCP_CLIENT_H) |
check_include_file (lscp/client.h HAVE_LSCP_CLIENT_H) |
147 |
if (NOT HAVE_LSCP_CLIENT_H) |
if (NOT HAVE_LSCP_CLIENT_H) |
211 |
if (CONFIG_LIBGIG) |
if (CONFIG_LIBGIG) |
212 |
pkg_check_modules (GIG IMPORTED_TARGET gig>=3.3.0) |
pkg_check_modules (GIG IMPORTED_TARGET gig>=3.3.0) |
213 |
if (GIG_FOUND) |
if (GIG_FOUND) |
214 |
include_directories (${GIG_INCLUDE_DIRS}) |
find_library(GIG_LIBRARY NAMES ${GIG_LIBRARIES} HINTS ${GIG_LIBDIR}) |
215 |
link_directories (${GIG_LIBRARY_DIRS}) |
endif () |
216 |
link_libraries (${GIG_LIBRARIES}) |
if (GIG_LIBRARY) |
217 |
# set (CMAKE_REQUIRED_LIBRARIES "${GIG_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}") |
set (CONFIG_LIBGIG 1) |
218 |
|
#set (CMAKE_REQUIRED_LIBRARIES "${GIG_LIBRARY};${CMAKE_REQUIRED_LIBRARIES}") |
219 |
# liggig supports fast information retrieval. |
# liggig supports fast information retrieval. |
220 |
set (CONFIG_LIBGIG_SETAUTOLOAD 1) |
set (CONFIG_LIBGIG_SETAUTOLOAD 1) |
221 |
# Check if libgig/SF.h is available. |
# Check if libgig/SF.h is available. |
271 |
message ("") |
message ("") |
272 |
show_option (" Unique/Single instance support . . . . . . . . . ." CONFIG_XUNIQUE) |
show_option (" Unique/Single instance support . . . . . . . . . ." CONFIG_XUNIQUE) |
273 |
show_option (" Debugger stack-trace (gdb) . . . . . . . . . . . ." CONFIG_STACKTRACE) |
show_option (" Debugger stack-trace (gdb) . . . . . . . . . . . ." CONFIG_STACKTRACE) |
274 |
message ("\n Install prefix . . . . . . . . . . . . . . . . . .: ${CMAKE_INSTALL_PREFIX}") |
message ("\n Install prefix . . . . . . . . . . . . . . . . . .: ${CONFIG_PREFIX}") |
275 |
message ("\nNow type 'make', followed by 'make install' as root.\n") |
message ("\nNow type 'make', followed by 'make install' as root.\n") |