-
Notifications
You must be signed in to change notification settings - Fork 1
/
premake4.lua
50 lines (48 loc) · 1.83 KB
/
premake4.lua
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
local qt = require 'qt'
local dependencies = {
blob_display = {'background_cleaner'},
color_display = {'background_cleaner'},
delta_t_display = {'background_cleaner'},
dvs_display = {'background_cleaner'},
flow_display = {'background_cleaner'},
frame_generator = {'grey_display'},
grey_display = {'background_cleaner'},
}
setmetatable(dependencies, {__index = function() return {} end})
solution 'chameleon'
configurations {'release', 'debug'}
location 'build'
for index, file in pairs(os.matchfiles('test/*.cpp')) do
local name = path.getbasename(file)
project(name)
kind 'ConsoleApp'
language 'C++'
location 'build'
files {'source/' .. name .. '.hpp', 'test/' .. name .. '.cpp'}
files(qt.moc({'source/' .. name .. '.hpp'}, 'build/moc'))
for index, dependency_name in pairs(dependencies[name]) do
files(qt.moc({'source/' .. dependency_name .. '.hpp'}, 'build/moc'))
end
includedirs(qt.includedirs())
libdirs(qt.libdirs())
links(qt.links())
buildoptions(qt.buildoptions())
linkoptions(qt.linkoptions())
configuration 'release'
targetdir 'build/release'
defines {'NDEBUG'}
flags {'OptimizeSpeed'}
configuration 'debug'
targetdir 'build/debug'
defines {'DEBUG'}
flags {'Symbols'}
configuration 'linux'
links {'pthread'}
buildoptions {'-std=c++11'}
linkoptions {'-std=c++11'}
configuration 'macosx'
buildoptions {'-std=c++11'}
linkoptions {'-std=c++11'}
configuration 'windows'
files {'.clang-format'}
end