-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
542 lines (427 loc) · 19.4 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
# root CMakeLists.txt for mlvg examples.
# for example:
# mkdir build
# cd build
# cmake -GXcode ..
#
# Windows:
# cmake -G"Visual Studio 14 2015 Win64" ..
# for windows validator debug:
# debugging / command: C:\Users\Randy\dev\mlvg\build\bin\Debug\validator.exe
# debugging / command arguments: C:\Users\Randy\dev\mlvg\build\VST3\Debug\aaltoverb.vst3\Contents\x86_64-win\aaltoverb.vst3
#--------------------------------------------------------------------
# set min version and deployment target -- before project
#--------------------------------------------------------------------
cmake_minimum_required (VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
IF(APPLE)
SET(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "Build architectures for Mac OS X" FORCE)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version")
ENDIF(APPLE)
#--------------------------------------------------------------------
# project and version
#--------------------------------------------------------------------
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
project(mlvg)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "1")
set(VERSION_PATCH "0")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
option(BUILD_SDL2_APP "Build SDL2 example app" ON)
option(BUILD_TESTS "Build the tests" ON)
#--------------------------------------------------------------------
# Compiler flags
#--------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN OFF)
if(APPLE)
# For now, explicitly disable C++17 alignment feature
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-new")
elseif(WIN32)
# no unknown pragma warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:alignedNew-")
endif()
if(MSVC)
# arcane thing about setting runtime library flags
cmake_policy(SET CMP0091 NEW)
add_compile_options(
$<$<CONFIG:>:/MT>
$<$<CONFIG:Debug>:/MTd>
$<$<CONFIG:Release>:/MT>
)
endif()
#--------------------------------------------------------------------
# Choose library output name
#--------------------------------------------------------------------
# creates the library mlvg-debug in debug configuration
set(mlvg_NAME mlvg$<$<CONFIG:Debug>:-debug>)
#--------------------------------------------------------------------
# find madronalib
# MacOS: /usr/local/include/madronalib
# Windows: C:/Program Files/madronalib/include
#--------------------------------------------------------------------
if(APPLE)
include(GNUInstallDirs)
set (MADRONALIB_INCLUDE_DIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}/madronalib")
set (MADRONALIB_LIBRARY_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
elseif(WIN32)
if(EXISTS "C:/Program Files/madronalib/lib/madrona.lib")
set (MADRONALIB_INCLUDE_DIR "C:/Program Files/madronalib/include")
set (MADRONALIB_LIBRARY_DIR "C:/Program Files/madronalib/lib")
else()
set (MADRONALIB_INCLUDE_DIR "C:/Program Files (x86)/madronalib/include")
set (MADRONALIB_LIBRARY_DIR "C:/Program Files (x86)/madronalib/lib")
endif()
else()
endif()
# add -debug suffix to link debug madronalib for debug builds
set(madronalib_NAME madrona$<$<CONFIG:Debug>:-debug>)
message("madronalib headers should be in: " ${MADRONALIB_INCLUDE_DIR} )
message("madronalib library should be in: " ${MADRONALIB_LIBRARY_DIR}/${madronalib_NAME} )
#--------------------------------------------------------------------
# find mlvg sources including our juce-core subset
#--------------------------------------------------------------------
set (MLVG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/source")
#--------------------------------------------------------------------
# compile binary resources
#--------------------------------------------------------------------
# Creates C resources file from files in given directory
function(create_resources dir outputdir)
# Collect input files
file(GLOB bins ${dir}/*)
# Create empty main include file
set(includefile "${outputdir}/resources.c")
file(WRITE "${includefile}" "")
# Iterate through input files
foreach(bin ${bins})
# Get short filename
string(REGEX MATCH "([^/]+)$" filename ${bin})
# Replace filename spaces & extension separator for C compatibility
string(REGEX REPLACE "\\.| |-" "_" filename ${filename})
# Read hex data from file
file(READ ${bin} filedata HEX)
# Convert hex data for C compatibility
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," filedata ${filedata})
# Create empty output file
set(outputfile "${outputdir}/${filename}.c")
file(WRITE "${outputfile}" "namespace resources \n{\n")
# Append data to output file
file(APPEND "${outputfile}" "const unsigned char ${filename}[] = {${filedata}};\nconst unsigned ${filename}_size = sizeof(${filename});\n")
file(APPEND "${outputfile}" "\n}")
# Append filename to main include file
file(APPEND "${includefile}" "#include \"${filename}.c\"\n")
endforeach()
endfunction()
#--------------------------------------------------------------------
# gather nanovg and nanosvg sources
#--------------------------------------------------------------------
if(APPLE)
set(NANOVG_SOURCES
${MLVG_SOURCE_DIR}/external/nanovg/src/nanovg.c
${MLVG_SOURCE_DIR}/external/nanovg/src/nanovg.h
${MLVG_SOURCE_DIR}/external/nanosvg/src/nanosvg.h
${MLVG_SOURCE_DIR}/external/MetalNanoVG/src/nanovg_mtl.h
${MLVG_SOURCE_DIR}/external/MetalNanoVG/src/nanovg_mtl.m
)
set(NANOVG_INCLUDE_DIRS
${MLVG_SOURCE_DIR}/external/nanovg/src
${MLVG_SOURCE_DIR}/external/nanosvg/src
${MLVG_SOURCE_DIR}/external/MetalNanoVG/src
)
elseif(WIN32)
set(NANOVG_SOURCES
${MLVG_SOURCE_DIR}/external/nanovg/src/nanovg.c
${MLVG_SOURCE_DIR}/external/nanovg/src/nanovg.h
${MLVG_SOURCE_DIR}/external/nanosvg/src/nanosvg.h
${MLVG_SOURCE_DIR}/external/nanovg/src/nanovg_gl.h
${MLVG_SOURCE_DIR}/external/nanovg/src/nanovg_gl_utils.h
${MLVG_SOURCE_DIR}/external/glad/glad.c
${MLVG_SOURCE_DIR}/external/glad/glad.h
${MLVG_SOURCE_DIR}/external/glad/khrplatform.h
)
set(NANOVG_INCLUDE_DIRS
${MLVG_SOURCE_DIR}/external/nanovg/src
${MLVG_SOURCE_DIR}/external/nanosvg/src
${MLVG_SOURCE_DIR}/external/glad
)
if (MSVC)
set_source_files_properties(source/external/glad/glad.c
PROPERTIES COMPILE_FLAGS /wd4055)
endif()
endif()
#--------------------------------------------------------------------
# gather osdialog sources
#--------------------------------------------------------------------
set(osdialog_sources
${MLVG_SOURCE_DIR}/external/osdialog/osdialog.c
)
if(WIN32)
set(osdialog_sources_native
${MLVG_SOURCE_DIR}/external/osdialog/osdialog_win.c
)
elseif(APPLE)
set(osdialog_sources_native
${MLVG_SOURCE_DIR}/external/osdialog/osdialog_mac.m
)
elseif(UNIX AND NOT APPLE)
set(osdialog_sources_native
${MLVG_SOURCE_DIR}/external/osdialog/osdialog_gtk3.c
)
endif()
list(APPEND osdialog_sources ${osdialog_sources_native} )
#--------------------------------------------------------------------
# gather cJSON sources
#--------------------------------------------------------------------
set(cjson_sources
${MLVG_SOURCE_DIR}/external/cJSON/cJSON.c
${MLVG_SOURCE_DIR}/external/cJSON/cJSON.h)
set(cjson_include_dirs ${MLVG_SOURCE_DIR}/external/cJSON)
#--------------------------------------------------------------------
# gather miniz sources
#--------------------------------------------------------------------
set(miniz_sources ${MLVG_SOURCE_DIR}/external/miniz/miniz.c)
#--------------------------------------------------------------------
# add filesystem library
#--------------------------------------------------------------------
add_subdirectory(${MLVG_SOURCE_DIR}/external/filesystem)
#--------------------------------------------------------------------
# add native sources
#--------------------------------------------------------------------
if(APPLE)
set(MLVG_SOURCES_NATIVE
${MLVG_SOURCE_DIR}/native/MLFilesMac.mm
${MLVG_SOURCE_DIR}/native/NanoVGViewMacGL.mm
${MLVG_SOURCE_DIR}/native/NanoVGViewMacMetal.mm
)
elseif(WIN32)
set(MLVG_SOURCES_NATIVE
${MLVG_SOURCE_DIR}/native/MLFilesWin.cpp
${MLVG_SOURCE_DIR}/native/NanoVGViewWindowsGL.cpp
)
endif()
#--------------------------------------------------------------------
# gather mlvg sources
#--------------------------------------------------------------------
file(GLOB MLVG_SOURCES_COMMON "${MLVG_SOURCE_DIR}/common/*.cpp")
file(GLOB MLVG_HEADERS_COMMON "${MLVG_SOURCE_DIR}/common/*.h")
file(GLOB MLVG_SOURCES_WIDGETS "${MLVG_SOURCE_DIR}/widgets/*.cpp")
file(GLOB MLVG_HEADERS_WIDGETS "${MLVG_SOURCE_DIR}/widgets/*.h")
set(MLVG_INCLUDE_DIRS
source
${MLVG_SOURCE_DIR}
${MLVG_SOURCE_DIR}/external
)
list(APPEND mlvg_sources ${MLVG_SOURCES_COMMON} )
list(APPEND mlvg_sources ${MLVG_HEADERS_COMMON} )
list(APPEND mlvg_sources ${MLVG_SOURCES_WIDGETS} )
list(APPEND mlvg_sources ${MLVG_HEADERS_WIDGETS} )
list(APPEND mlvg_sources ${NANOVG_SOURCES} )
list(APPEND mlvg_sources ${MLVG_SOURCES_NATIVE} )
list(APPEND MLVG_INCLUDE_DIRS "${MLVG_SOURCE_DIR}/common")
list(APPEND MLVG_INCLUDE_DIRS "${MLVG_SOURCE_DIR}/widgets")
list(APPEND MLVG_INCLUDE_DIRS "${NANOVG_INCLUDE_DIRS}")
list(APPEND MLVG_INCLUDE_DIRS "${MLVG_SOURCE_DIR}/include")
list(APPEND MLVG_INCLUDE_DIRS "${MADRONALIB_SOURCE_DIR}")
list(APPEND MLVG_INCLUDE_DIRS "${MADRONALIB_INCLUDE_DIR}")
list(APPEND MLVG_INCLUDE_DIRS "${MADRONALIB_INCLUDE_DIR}/madronalib")
list(APPEND MLVG_INCLUDE_DIRS "${cjson_include_dirs}")
#--------------------------------------------------------------------
# make and install mlvg library and headers
#--------------------------------------------------------------------
set(target mlvg)
# Define the library
add_library(${target} STATIC ${mlvg_sources} ${osdialog_sources} ${cjson_sources} ${miniz_sources})
set_target_properties(${target} PROPERTIES
OUTPUT_NAME "${mlvg_NAME}"
VERSION ${VERSION}
SOVERSION ${VERSION_MAJOR}
POSITION_INDEPENDENT_CODE ON
FOLDER "mlvg")
target_include_directories(${target} PRIVATE ${MLVG_INCLUDE_DIRS})
if(APPLE)
target_compile_options(${target} PRIVATE "-fobjc-arc")
elseif(WIN32)
endif()
target_link_libraries(${target} ghc_filesystem)
include(GNUInstallDirs)
if(WIN32)
set(CMAKE_INSTALL_LIBDIR "C:/Program Files/mlvg/lib")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "C:/Program Files/mlvg" CACHE PATH "..." FORCE)
endif()
endif()
install(
TARGETS ${target}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
message("mlvg destination: " ${CMAKE_INSTALL_LIBDIR} )
file(GLOB COMMON_HEADERS "source/common/*.h")
file(GLOB WIDGETS_HEADERS "source/widgets/*.h")
# TODO clean this up! should not be externally visible
file(GLOB NATIVE_HEADERS "source/native/*.h")
file(GLOB NATIVE_HEADERS_HACK "source/external/MetalNanoVG/src/*.h")
file(GLOB NATIVE_HEADERS_HACK2 "source/external/nanovg/src/*.h")
file(GLOB NATIVE_HEADERS_HACK3 "source/external/nanosvg/src/*.h")
file(GLOB NATIVE_HEADERS_HACK4 "source/external/miniz/*.h")
file(GLOB NATIVE_HEADERS_HACK5 "source/external/osdialog/*.h")
file(GLOB NATIVE_HEADERS_HACK6 "source/external/glad/*.h")
if(APPLE)
set(INCLUDES_INSTALL_DIR "include/mlvg")
elseif(WIN32)
set(INCLUDES_INSTALL_DIR "include")
endif()
install(FILES
source/include/mlvg.h
${COMMON_HEADERS}
${WIDGETS_HEADERS}
${NATIVE_HEADERS}
${NATIVE_HEADERS_HACK}
${NATIVE_HEADERS_HACK2}
${NATIVE_HEADERS_HACK3}
${NATIVE_HEADERS_HACK4}
${NATIVE_HEADERS_HACK5}
${NATIVE_HEADERS_HACK6}
DESTINATION
# PERMISSIONS OWNER_READ GROUP_READ WORLD_READ
${INCLUDES_INSTALL_DIR}
)
#set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}) % wrong for Windows. needed for Mac?
#set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY true)
#install(TARGETS mlvg DESTINATION ${CMAKE_INSTALL_LIBDIR})
#--------------------------------------------------------------------
# build tests
#--------------------------------------------------------------------
if(BUILD_TESTS)
set(target tests)
file(GLOB TEST_SOURCES "tests/*.*")
add_executable(${target} ${TEST_SOURCES})
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL TRUE)
add_dependencies(tests mlvg)
# add madronalib
target_include_directories(${target} PRIVATE ${MADRONALIB_INCLUDE_DIR})
target_include_directories(${target} PRIVATE ${MADRONALIB_INCLUDE_DIR}/madronalib)
if(APPLE)
target_link_libraries(${target} PRIVATE "${MADRONALIB_LIBRARY_DIR}/lib${madronalib_NAME}.a")
elseif(WIN32)
target_link_libraries(${target} PRIVATE "${MADRONALIB_LIBRARY_DIR}/${madronalib_NAME}.lib")
endif()
# add mlvg library
target_include_directories(${target} PRIVATE ${MLVG_INCLUDE_DIRS})
target_link_libraries(${target} PRIVATE "mlvg")
if(APPLE)
target_compile_definitions(${target} PUBLIC "$<$<CONFIG:DEBUG>:DEBUG>")
target_compile_definitions(${target} PUBLIC "$<$<CONFIG:RELEASE>:NDEBUG>")
endif()
# add UI libs and frameworks- note that these appear under
# "other linker flags" in XCode and not in its file browser
if(APPLE)
target_link_libraries(${target} PRIVATE "-framework Cocoa" "-framework Metal" "-framework MetalKit"
"-framework CoreAudio" "-framework CoreServices"
"-framework AppKit" )
elseif(WIN32)
find_package(OpenGL REQUIRED)
target_link_libraries(${target} PRIVATE ${OPENGL_gl_LIBRARY})
target_link_libraries(${target} PRIVATE "Shcore.lib")
target_link_libraries(${target} PRIVATE "winmm.lib")
target_link_libraries(${target} PRIVATE "setupapi.lib")
target_link_libraries(${target} PRIVATE "version.lib")
target_link_libraries(${target} PRIVATE "Imm32.lib")
target_link_libraries(${target} PRIVATE debug "msvcrtd.lib" optimized "msvcrt.lib")
endif()
endif()
#--------------------------------------------------------------------
# make SDL2 application target
#--------------------------------------------------------------------
if(BUILD_SDL2_APP)
create_resources (examples/app/resources build/resources/testapp)
set(target testapp)
file(GLOB LOCAL_SOURCES "${CMAKE_SOURCE_DIR}/examples/app/*.cpp")
file(GLOB LOCAL_INCLUDES "${CMAKE_SOURCE_DIR}/examples/app/*.h")
list(APPEND test_app_sources ${LOCAL_SOURCES} )
list(APPEND test_app_sources ${LOCAL_INCLUDES} )
list(APPEND test_app_sources "${MLVG_SOURCE_DIR}/native/MLSDLUtils.h" )
if(APPLE)
elseif(WIN32)
list(APPEND test_app_sources "${MLVG_SOURCE_DIR}/native/hidpi.manifest" )
endif()
add_executable(${target} ${test_app_sources})
# find SDL headers and libraries
target_compile_definitions(${target} PRIVATE ML_INCLUDE_SDL=1)
if(APPLE)
# to use the SDL2 framework in /Library/Frameworks, do this:
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "/Library/Frameworks")
find_package(SDL2 REQUIRED COMPONENTS SDL2)
elseif(WIN32)
# it seems like there's no standard place to put the SDL dev tools on Windows.
# we put them in an SDL dir alongside the main project directory.
set(SDL2_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../SDL/include")
# Support 64 bit builds
set(SDL2_LIBRARIES_DIR "${CMAKE_CURRENT_LIST_DIR}/../SDL/VisualC/x64/Release")
# note: linking with the debug build of the SDL library made an executable that crashed.
# So for now we link to the release version always.
target_link_libraries(${target} PRIVATE "${SDL2_LIBRARIES_DIR}/SDL2.lib")
target_link_libraries(${target} PRIVATE "${SDL2_LIBRARIES_DIR}/SDL2main.lib")
endif()
target_include_directories(${target} PRIVATE ${SDL2_INCLUDE_DIRS})
# add madronalib
target_include_directories(${target} PRIVATE ${MADRONALIB_INCLUDE_DIR})
target_include_directories(${target} PRIVATE ${MADRONALIB_INCLUDE_DIR}/madronalib)
if(APPLE)
target_link_libraries(${target} PRIVATE "${MADRONALIB_LIBRARY_DIR}/lib${madronalib_NAME}.a")
elseif(WIN32)
target_link_libraries(${target} PRIVATE "${MADRONALIB_LIBRARY_DIR}/${madronalib_NAME}.lib")
endif()
# add mlvg library
target_include_directories(${target} PRIVATE ${MLVG_INCLUDE_DIRS})
target_link_libraries(${target} PRIVATE "mlvg")
# add the package info
if(APPLE)
set_target_properties(
${target} PROPERTIES
# these settings allow the bundle version to be updated from the buildApp script.
# the stale version from when the XCode project was made will still appear in the
# project's "Custom macOS Application Target Properties."
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.madronalabs.guiro_example_app"
XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_LIST_DIR}/examples/app/mac/Info.plist
XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS NO
)
elseif(APPLE)
# target_sources(${target} PRIVATE resource/guiro_example_app.rc)
endif(APPLE)
if(APPLE)
target_compile_definitions(${target} PUBLIC "$<$<CONFIG:DEBUG>:DEBUG>")
target_compile_definitions(${target} PUBLIC "$<$<CONFIG:RELEASE>:NDEBUG>")
endif()
# add UI libs and frameworks- note that these appear under
# "other linker flags" in XCode and not in its file browser
if(APPLE)
target_link_libraries(${target} PRIVATE "-framework Cocoa" "-framework Metal" "-framework MetalKit"
"-framework CoreAudio" "-framework CoreServices"
"-framework AppKit" "-framework SDL2" )
elseif(WIN32)
find_package(OpenGL REQUIRED)
target_link_libraries(${target} PRIVATE ${OPENGL_gl_LIBRARY})
target_link_libraries(${target} PRIVATE "Shcore.lib")
target_link_libraries(${target} PRIVATE "winmm.lib")
target_link_libraries(${target} PRIVATE "setupapi.lib")
target_link_libraries(${target} PRIVATE "version.lib")
target_link_libraries(${target} PRIVATE "Imm32.lib")
target_link_libraries(${target} PRIVATE debug "msvcrtd.lib" optimized "msvcrt.lib")
endif()
endif()
#--------------------------------------------------------------------
# set source groups for some source above
#--------------------------------------------------------------------
source_group(nanovg REGULAR_EXPRESSION "${MLVG_SOURCE_DIR}/external/nanovg/src.*|${MLVG_SOURCE_DIR}/external/MetalNanoVG/src.*")
source_group(nanosvg REGULAR_EXPRESSION "${MLVG_SOURCE_DIR}/external/nanosvg/src.*")
set(NATIVE1 "${MLVG_SOURCE_DIR}/native/*.*")
set(NATIVE2 "${MLVG_SOURCE_DIR}/external/osdialog/osdialog_mac.m")
set(NATIVE3 "${MLVG_SOURCE_DIR}/external/MetalNanoVG/src/*.*")
source_group(native REGULAR_EXPRESSION "${NATIVE1}|${NATIVE2}|${NATIVE3}")
# source_group(native REGULAR_EXPRESSION "*.m")