-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (56 loc) · 2.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# This was modified from the 4.3.0 to build libgig on all our platforms - baconpaul
cmake_policy(SET CMP0063 NEW)
cmake_minimum_required(VERSION 3.20)
project(libgig)
#get version from configure.ac
#have to make a slight detour since I cannot get the cmake regex subgroup to work with file
file(STRINGS configure.ac VERSION_STRINGS REGEX "^m4_define\\(libgig_release.*\\)$")
string(REGEX MATCH "libgig_release_major, ([^)]*)\\)" TEMP ${VERSION_STRINGS})
set(VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "libgig_release_minor, ([^)]*)\\)" TEMP ${VERSION_STRINGS})
set(VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "libgig_release_build, ([^)]*)\\)" TEMP ${VERSION_STRINGS})
set(VERSION_BUILD ${CMAKE_MATCH_1})
set(PACKAGE_NAME "libgig")
set(LIBGIG_HEADERS
src/DLS.h
src/gig.h
src/RIFF.h
src/SF.h
src/Korg.h
src/Serialization.h)
#libgig core library
add_library(libgig STATIC
src/DLS.cpp
src/gig.cpp
src/helper.cpp
src/Korg.cpp
src/RIFF.cpp
src/Serialization.cpp
src/SF.cpp
src/typeinfo.cpp)
set_target_properties(libgig PROPERTIES PUBLIC_HEADER "${LIBGIG_HEADERS}")
target_include_directories(libgig PUBLIC src)
target_compile_definitions(libgig PRIVATE PACKAGE="${PACKAGE_NAME}" VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}")
target_include_directories(libgig PUBLIC $<INSTALL_INTERFACE:include>)
#libakai library
add_library(libakai STATIC src/Akai.cpp)
set_target_properties(libakai PROPERTIES PUBLIC_HEADER src/Akai.h)
target_include_directories(libakai PUBLIC $<INSTALL_INTERFACE:include>)
target_include_directories(libakai PUBLIC src)
target_compile_definitions(libakai PRIVATE PACKAGE="${PACKAGE_NAME}" VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}")
if (WIN32)
target_compile_definitions(libgig PUBLIC NOMINMAX WIN32)
target_compile_definitions(libakai PUBLIC NOMINMAX WIN32)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
target_compile_definitions(libgig PUBLIC WINDOWS_CLANG_SCXT)
target_compile_definitions(libakai PUBLIC WINDOWS_CLANG_SCXT)
else()
target_compile_definitions(libgig PUBLIC WINDOWS_MSVC_SCXT)
target_compile_definitions(libakai PUBLIC WINDOWS_MSVC_SCXT)
endif()
endif()
set_target_properties(libgig PROPERTIES UNITY_BUILD FALSE)
set_target_properties(libakai PROPERTIES UNITY_BUILD FALSE)
add_executable(sf2dump src/tools/sf2dump.cpp)
target_link_libraries(sf2dump libgig)