-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
150 lines (137 loc) · 3.93 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
cmake_minimum_required(VERSION 3.15)
project(apc_mini_controller)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Set compiler flags based on compiler ID
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(STATUS "Using Clang compiler.")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-gnu-anonymous-struct -Wno-padded -Wno-c++98-compat-pedantic")
else()
message(STATUS "Using other compiler. (not clang)")
endif()
# Add RtMidi using FetchContent
include(FetchContent)
FetchContent_Declare(
rtmidi
GIT_REPOSITORY https://github.com/thestk/rtmidi.git
GIT_TAG 5.0.0
)
FetchContent_MakeAvailable(rtmidi)
# Find required system packages for RtMidi on MacOS
if(APPLE)
find_library(COREMIDI_LIBRARY CoreMIDI)
find_library(COREAUDIO_LIBRARY CoreAudio)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
endif()
# Create the executable
add_executable(apc_mini_controller
src/main.cpp
src/apc_mini_controller.cpp
src/light_pattern_controller.cpp
)
# Include directories
target_include_directories(apc_mini_controller PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# Link against RtMidi and system libraries
target_link_libraries(apc_mini_controller PRIVATE rtmidi)
if(APPLE)
target_link_libraries(apc_mini_controller PRIVATE
${COREMIDI_LIBRARY}
${COREAUDIO_LIBRARY}
${COREFOUNDATION_LIBRARY}
)
endif()
# cmake_minimum_required(VERSION 3.15)
# project(apc_mini_controller)
#
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#
# # Specify Clang as the compiler
# set(CMAKE_C_COMPILER clang)
# set(CMAKE_CXX_COMPILER clang++)
#
# # Add RtMidi using FetchContent
# include(FetchContent)
# FetchContent_Declare(
# rtmidi
# GIT_REPOSITORY https://github.com/thestk/rtmidi.git
# GIT_TAG 6.0.0
# )
# FetchContent_MakeAvailable(rtmidi)
#
# # Find required system packages for RtMidi on MacOS
# find_library(COREMIDI_LIBRARY CoreMIDI)
# find_library(COREAUDIO_LIBRARY CoreAudio)
# find_library(COREFOUNDATION_LIBRARY CoreFoundation)
#
# # Create the executable
# add_executable(apc_mini_controller
# src/main.cpp
# src/apc_mini_controller.cpp
# )
#
# # Include directories
# target_include_directories(apc_mini_controller PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/include
# )
#
# # Link against RtMidi and system libraries
# target_link_libraries(apc_mini_controller PRIVATE
# rtmidi
# ${COREMIDI_LIBRARY}
# ${COREAUDIO_LIBRARY}
# ${COREFOUNDATION_LIBRARY}
# )
# cmake_minimum_required(VERSION 3.15)
# project(apc_mini_controller)
#
# set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
#
# # Specify Clang as the compiler
# set(CMAKE_C_COMPILER clang)
# set(CMAKE_CXX_COMPILER clang++)
#
# # Add RtMidi dependency through FetchContent
# include(FetchContent)
# FetchContent_Declare(
# rtmidi
# GIT_REPOSITORY https://github.com/thestk/rtmidi.git
# GIT_TAG 5.0.0
# )
# FetchContent_MakeAvailable(rtmidi)
#
# # Find required system packages for RtMidi
# if(APPLE)
# find_library(COREMIDI_LIBRARY CoreMIDI)
# find_library(COREAUDIO_LIBRARY CoreAudio)
# find_library(COREFOUNDATION_LIBRARY CoreFoundation)
# elseif(UNIX)
# find_package(ALSA REQUIRED)
# endif()
#
# # Create the executable
# add_executable(apc_mini_controller src/main.cpp src/apc_mini_controller.cpp)
#
# # Link against RtMidi and system libraries
# target_link_libraries(apc_mini_controller PRIVATE rtmidi)
#
# if(APPLE)
# target_link_libraries(apc_mini_controller PRIVATE
# ${COREMIDI_LIBRARY}
# ${COREAUDIO_LIBRARY}
# ${COREFOUNDATION_LIBRARY}
# )
# elseif(UNIX)
# target_link_libraries(apc_mini_controller PRIVATE ALSA::ALSA)
# endif()
#
# # Include directories
# target_include_directories(apc_mini_controller PRIVATE
# ${CMAKE_CURRENT_SOURCE_DIR}/include
# )