i've read post , none of solutions works in windows , linux. current solution works pretty in windows, creating, if doesn't exist, respective directory debug or release.
i want create object files (*.o) inside 1 of these folders. in windows achieved in linux destdir variable empty. =|
template = app target = dependpath += . includepath += . # input headers += config.h \ keyboard.h \ keyboardgui.h \ keyboardkey.h \ log.h \ main.h \ mainwindow.h \ settings.h forms += mainwindow.ui sources += config.cpp \ keyboard.cpp \ keyboardgui.cpp \ keyboardkey.cpp \ log.cpp \ main.cpp \ mainwindow.cpp resources += resources.qrc other_files += \ default_layout.kl # se windows win32 { # inclui lib para acessar o dmi libs += -lqaxcontainer } # habilita opcao de copia de diretorios config += copy_dir_files debug:destdir = debug release:destdir = release # copia pasta configuracao para o diretorio de saida win32 { qmake_post_link += copy /y default_layout.kl $$destdir } else { qmake_post_link += cp -a default_layout.kl $$destdir }
i tried use install var without success. debug directory created , object files put there when changed compilation mode release objects files continue moved debug directory , release directory isn't created (i've tried run qmake again). in both configurations files (default_layout , layout) aren't copied output directory.
# habilita opcao de copia de diretorios config += copy_dir_files release:destdir = release release:objects_dir = release/ release:moc_dir = release/ release:rcc_dir = release/ release:ui_dir = release/ debug:destdir = debug debug:objects_dir = debug/ debug:moc_dir = debug/ debug:rcc_dir = debug/ debug:ui_dir = debug/ installs += config_files config_files.path = $$destdir config_files.filename = default_layout.kl config_files.filename += layout.kl
thx!
i think reason works on windows , not on linux because capitalized "debug" , "release". examples have found have them lower case (see second example in section on qmake document page.)
the other thing question use of destdirs. destdirs tells qmake want put target. if want directly control object files put, should use object_dirs.
personally, use qmake's installs keyword copy files need go. mean executing both make
, make install
, produce more platform dependent code.
if assume want target , objects in 'debug' or 'release', this:
# habilita opcao de copia de diretorios debug { destdir = debug obj_dir = debug } release { destdir = release obj_dir = release } # copia pasta configuracao para o diretorio de saida config_files.path = $$destdir config_files.files = default_layout.kl installs += config_files
if running qtcreator, can add make install
step building settings selecting "projects" icon in left hand tool bar. next, select "add build step", "make", , set "make arguments" install
. have each build configuration.
Comments
Post a Comment