mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
build: fix qmake ground/share copy commands for all platforms
Read share.pro comments for more details. +review OPReview-429
This commit is contained in:
parent
17a687e79d
commit
e24b66897b
@ -6,15 +6,21 @@ SUBDIRS = openpilotgcs/translations
|
||||
DATACOLLECTIONS = dials models pfd sounds diagrams mapicons stylesheets default_configurations
|
||||
|
||||
equals(copydata, 1) {
|
||||
for(dir, DATACOLLECTIONS) {
|
||||
exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) {
|
||||
macx:data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline()
|
||||
win32:data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
|
||||
unix:data_copy.commands += $(MKDIR) $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
|
||||
unix:data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline()
|
||||
}
|
||||
}
|
||||
|
||||
for(dir, DATACOLLECTIONS) {
|
||||
exists($$GCS_SOURCE_TREE/share/openpilotgcs/$$dir) {
|
||||
# Qt make macros (CHK_DIR_EXISTS, COPY_DIR, etc) have different syntax. They cannot be used
|
||||
# reliably to copy subdirectories in two different Windows environments (bash and cmd/QtCreator).
|
||||
# So undocumented QMAKE_SH variable is used to find out the real environment.
|
||||
!isEmpty(QMAKE_SH) {
|
||||
# sh environment (including Windows bash)
|
||||
data_copy.commands += $(MKDIR) $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
|
||||
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/\") $$addNewline()
|
||||
} else {
|
||||
# native Windows cmd environment
|
||||
data_copy.commands += $(COPY_DIR) $$targetPath(\"$$GCS_SOURCE_TREE/share/openpilotgcs/$$dir\") $$targetPath(\"$$GCS_DATA_PATH/$$dir\") $$addNewline()
|
||||
}
|
||||
}
|
||||
}
|
||||
data_copy.target = FORCE
|
||||
QMAKE_EXTRA_TARGETS += data_copy
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user