-
Notifications
You must be signed in to change notification settings - Fork 0
/
qmake_script
executable file
·41 lines (37 loc) · 1.49 KB
/
qmake_script
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
#!/usr/bin/ruby
# Ignore this for now...
FolderName = File.basename(Dir.getwd)
#FileName = FolderName + ".pro"
# Just call everything chemvp
FileName = "cheMVP.pro"
QMakeFile = File.new(FileName, "w")
SourceArray = Dir["../src/*.{cc,cpp}"].reject{|f| f.match(/^moc_/) || f.match(/^qrc_/)}
ResourceArray = Dir["../src/*.{qrc}"]
QMakeFile.puts "SOURCES = " + SourceArray.join(" \\ \n")
QMakeFile.puts "HEADERS = " + Dir["../src/*.h"].join(" \\ \n")
if(ResourceArray.size)
QMakeFile.puts "RESOURCES = " + ResourceArray.join(" \\ \n")
end
QMakeFile.puts "\nCONFIG += debug_and_release static"
QMakeFile.puts "QT += svg printsupport"
QMakeFile.puts "QMAKE_CXXFLAGS_DEBUG = \" -O0 -g\""
QMakeFile.puts "\nmacx{"
QMakeFile.puts " ICON = ../images/icon.icns\n"
QMakeFile.puts " CONFIG += x86_64\n"
QMakeFile.puts " LIBS += -llapack -lblas\n"
QMakeFile.puts " QMAKE_INFO_PLIST = ../chemvp.plist"
QMakeFile.puts " RPATHDIR *= @loader_path/../Frameworks"
QMakeFile.puts " QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/"
QMakeFile.puts " isEmpty(QMAKE_LFLAGS_RPATH): QMAKE_LFLAGS_RPATH=-Wl,-rpath,"
QMakeFile.puts " for(R,RPATHDIR) {"
QMakeFile.puts " QMAKE_LFLAGS *= \'$${QMAKE_LFLAGS_RPATH}$$R\'"
QMakeFile.puts " }"
QMakeFile.puts "}"
QMakeFile.puts "\nwin32{"
QMakeFile.puts " RC_FILE = ../images/icon.rc"
QMakeFile.puts " CONFIG -= debug"
QMakeFile.puts " QMAKE_CXXFLAGS_RELEASE -= -mthreads"
QMakeFile.puts " QMAKE_LFLAGS_RELEASE -= -mthreads"
QMakeFile.puts "}"
QMakeFile.close
`qmake #{FileName}`