1 |
project(QSAMPLER) |
project(QSAMPLER) |
2 |
|
|
3 |
cmake_minimum_required(VERSION 2.6) |
cmake_minimum_required(VERSION 3.1) |
4 |
|
|
5 |
set (VERSION "0.5.7") |
set (VERSION "0.5.7") |
6 |
|
|
7 |
|
set (CONFIG_VERSION ${VERSION}) |
8 |
execute_process ( |
execute_process ( |
9 |
COMMAND git describe --tags --dirty --abbrev=6 |
COMMAND git describe --tags --dirty --abbrev=6 |
10 |
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT |
OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT |
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 |
endif () |
endif () |
28 |
|
|
29 |
set (PACKAGE_NAME "Qsampler") |
set (PACKAGE_NAME "Qsampler") |
35 |
set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}") |
set (CONFIG_BUILD_VERSION "${PACKAGE_VERSION}") |
36 |
|
|
37 |
if (CMAKE_BUILD_TYPE) |
if (CMAKE_BUILD_TYPE) |
38 |
set (CONFIG_BUILD_TYPE CMAKE_BUILD_TYPE) |
set (CONFIG_BUILD_TYPE ${CMAKE_BUILD_TYPE}) |
39 |
else () |
else () |
40 |
set (CONFIG_BUILD_TYPE "release") |
set (CONFIG_BUILD_TYPE "release") |
41 |
endif () |
endif () |
42 |
|
|
43 |
set (CONFIG_DEBUG) |
set (CONFIG_DEBUG 0) |
44 |
if (CONFIG_BUILD_TYPE MATCHES "debug") |
if (CONFIG_BUILD_TYPE MATCHES "debug") |
45 |
set(CONFIG_DEBUG 1) |
set (CONFIG_DEBUG 1) |
46 |
endif () |
endif () |
47 |
|
|
48 |
set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}") |
set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}") |
49 |
|
|
50 |
|
include (GNUInstallDirs) |
51 |
|
set (CONFIG_BINDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_BINDIR}") |
52 |
|
set (CONFIG_LIBDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_LIBDIR}") |
53 |
|
set (CONFIG_DATADIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_DATADIR}") |
54 |
|
set (CONFIG_MANDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_MANDIR}") |
55 |
|
|
56 |
|
|
57 |
# Enable libgig availability. |
# Enable libgig availability. |
58 |
option (CONFIG_LIBGIG "Enable libgig interface (default=yes)" 1) |
option (CONFIG_LIBGIG "Enable libgig interface (default=yes)" 1) |
63 |
# Enable debugger stack-trace option (assumes --enable-debug). |
# Enable debugger stack-trace option (assumes --enable-debug). |
64 |
option (CONFIG_STACKTRACE "Enable debugger stack-trace (default=no)" 0) |
option (CONFIG_STACKTRACE "Enable debugger stack-trace (default=no)" 0) |
65 |
|
|
66 |
|
|
67 |
# Fix for new CMAKE_REQUIRED_LIBRARIES policy. |
# Fix for new CMAKE_REQUIRED_LIBRARIES policy. |
68 |
if (POLICY CMP0075) |
if (POLICY CMP0075) |
69 |
cmake_policy (SET CMP0075 NEW) |
cmake_policy (SET CMP0075 NEW) |
78 |
|
|
79 |
find_package (Qt5LinguistTools) |
find_package (Qt5LinguistTools) |
80 |
|
|
|
include (GNUInstallDirs) |
|
81 |
include (CheckIncludeFile) |
include (CheckIncludeFile) |
82 |
include (CheckIncludeFiles) |
include (CheckIncludeFiles) |
83 |
include (CheckIncludeFileCXX) |
include (CheckIncludeFileCXX) |
113 |
if (CONFIG_LIBLSCP) |
if (CONFIG_LIBLSCP) |
114 |
include_directories (${LSCP_INCLUDE_DIRS}) |
include_directories (${LSCP_INCLUDE_DIRS}) |
115 |
link_directories (${LSCP_LIBRARY_DIRS}) |
link_directories (${LSCP_LIBRARY_DIRS}) |
116 |
|
# link_libraries (${LSCP_LIBRARIES}) |
117 |
set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}") |
set (CMAKE_REQUIRED_LIBRARIES "${LSCP_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}") |
118 |
# Check for for instrument_name in lscp_channel_info_t. |
# Check for for instrument_name in lscp_channel_info_t. |
119 |
check_include_file (lscp/client.h CONFIG_INSTRUMENT_NAME) |
check_include_file (lscp/client.h CONFIG_INSTRUMENT_NAME) |
182 |
# Configuration status |
# Configuration status |
183 |
macro (SHOW_OPTION text value) |
macro (SHOW_OPTION text value) |
184 |
if (${value}) |
if (${value}) |
185 |
message("${text}: yes") |
message ("${text}: yes") |
186 |
else () |
else () |
187 |
message("${text}: no") |
message ("${text}: no") |
188 |
endif () |
endif () |
189 |
endmacro () |
endmacro () |
190 |
|
|