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

Contents of /liblscp/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4055 - (show annotations) (download)
Thu Mar 23 10:02:34 2023 UTC (12 months, 3 weeks ago) by capela
File MIME type: text/plain
File size: 4282 byte(s)
* An Early-Spring'23 Release (v0.9.9)
1 cmake_minimum_required (VERSION 3.13)
2
3 project (liblscp
4 VERSION 0.9.9
5 DESCRIPTION "LinuxSampler Control Protocol API library"
6 LANGUAGES C)
7
8 set (CONFIG_VERSION ${PROJECT_VERSION})
9 execute_process (
10 COMMAND git describe --tags --dirty --abbrev=6
11 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
12 OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT
13 RESULT_VARIABLE GIT_DESCRIBE_RESULT
14 OUTPUT_STRIP_TRAILING_WHITESPACE)
15 if (GIT_DESCRIBE_RESULT EQUAL 0)
16 set (VERSION "${GIT_DESCRIBE_OUTPUT}")
17 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}")
21 string (REGEX REPLACE "[_|-]" "." VERSION "${VERSION}")
22 execute_process (
23 COMMAND git rev-parse --abbrev-ref HEAD
24 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
25 OUTPUT_VARIABLE GIT_REVPARSE_OUTPUT
26 RESULT_VARIABLE GIT_REVPARSE_RESULT
27 OUTPUT_STRIP_TRAILING_WHITESPACE)
28 if (GIT_REVPARSE_RESULT EQUAL 0 AND NOT GIT_REVPARSE_OUTPUT STREQUAL "master")
29 set (VERSION "${VERSION} [${GIT_REVPARSE_OUTPUT}]")
30 endif ()
31 else ()
32 set (VERSION "${PROJECT_VERSION}")
33 endif ()
34
35 set (PACKAGE_NAME "liblscp")
36 set (PACKAGE_VERSION "${VERSION}")
37 set (PACKAGE_BUGREPORT "rncbc@rncbc.org")
38 set (PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
39 set (PACKAGE_TARNAME "liblscp")
40
41 set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
42
43 include (GNUInstallDirs)
44 set (CONFIG_LIBDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
45 set (CONFIG_INCLUDEDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
46
47
48 #------------------------------------------------------------------------------------
49 # Rules for library version information:
50 #
51 # 1. Start with version information of `0:0:0' for each libtool library.
52 # 2. Update the version information only immediately before a public release of
53 # your software. More frequent updates are unnecessary, and only guarantee
54 # that the current interface number gets larger faster.
55 # 3. If the library source code has changed at all since the last update, then
56 # increment revision (`c:r:a' becomes `c:r+1:a').
57 # 4. If any interfaces have been added, removed, or changed since the last update,
58 # increment current, and set revision to 0.
59 # 5. If any interfaces have been added since the last public release, then increment
60 # age.
61 # 6. If any interfaces have been removed since the last public release, then set age
62 # to 0.
63 #
64 #set (BUILD_SHARED_LIBS ON)
65
66 set (SHARED_VERSION_CURRENT 6)
67 set (SHARED_VERSION_AGE 0)
68 set (SHARED_VERSION_REVISION 6)
69 set (SHARED_VERSION_INFO "${SHARED_VERSION_CURRENT}.${SHARED_VERSION_AGE}.${SHARED_VERSION_REVISION}")
70
71 if (CMAKE_BUILD_TYPE MATCHES "Debug")
72 set (CONFIG_DEBUG 1)
73 set (CONFIG_BUILD_TYPE "debug")
74 else ()
75 set (CONFIG_DEBUG 0)
76 set (CONFIG_BUILD_TYPE "release")
77 set (CMAKE_BUILD_TYPE "Release")
78 endif ()
79
80 set (CONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
81
82 include (GNUInstallDirs)
83 set (CONFIG_BINDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_BINDIR}")
84 set (CONFIG_LIBDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
85 set (CONFIG_DATADIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_DATADIR}")
86 set (CONFIG_INCLUDEDIR "${CONFIG_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
87
88 #
89 # No special build options...
90 #
91
92 # Fix for new CMAKE_REQUIRED_LIBRARIES policy.
93 if (POLICY CMP0075)
94 cmake_policy (SET CMP0075 NEW)
95 endif ()
96
97 include (CheckIncludeFiles)
98 include (CheckFunctionExists)
99
100 # Checks for standard header files.
101 if (UNIX AND NOT APPLE)
102 check_include_files ("stdlib.h;string.h;netdb.h;arpa/inet.h;netinet/tcp.h;netinet/in.h;sys/socket.h;unistd.h" HAVE_HEADERS_H)
103 if (NOT HAVE_HEADERS_H)
104 message (FATAL_ERROR "*** Standard headers not found.")
105 endif ()
106 endif ()
107
108 # Checks for standard functions.
109 if (UNIX AND NOT APPLE)
110 set (FUNCS "strdup;strtok_r;memset;memmove;socket;connect;bind;listen;setsockopt;getsockopt;getsockname;gethostbyname")
111 foreach (FUNC ${FUNCS})
112 check_function_exists (${FUNC} HAVE_${FUNC}_C)
113 if (NOT HAVE_${FUNC}_C)
114 message (FATAL_ERROR "*** Standard functions not found.")
115 endif ()
116 endforeach ()
117 endif ()
118
119 #
120 # No additional packages or libraries...
121 #
122
123 add_subdirectory (src)
124 add_subdirectory (doc)
125 add_subdirectory (examples)
126

  ViewVC Help
Powered by ViewVC