Skip to content

Commit

Permalink
feat: add the "DtkWidgets" header file
Browse files Browse the repository at this point in the history
Change-Id: Ib49a7a37c8cd10f6dbec39a602e8206e49c45591
  • Loading branch information
zccrs committed Jan 3, 2018
1 parent d5c6ea4 commit b223577
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ build*/

# executeable files
*.qm

src/DtkWidgets
35 changes: 34 additions & 1 deletion src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ win* {
HEADERS += dtkwidget_global.h

includes.path = $${DTK_INCLUDEPATH}/DWidget
includes.files += $$PWD/dtkwidget_global.h
includes.files += $$PWD/dtkwidget_global.h $$PWD/DtkWidgets

include($$PWD/util/util.pri)
include($$PWD/widgets/widgets.pri)
Expand Down Expand Up @@ -72,3 +72,36 @@ translations.files = $$PWD/../translations/*.qm

INSTALLS += translations cmake_config

# create DtkWidgets file
defineTest(containIncludeFiles) {
header = $$absolute_path($$ARGS)
header_dir = $$quote($$dirname(header))

for (file, includes.files) {
file_ap = $$absolute_path($$file)
file_dir = $$quote($$dirname(file_ap))

isEqual(file_dir, $$header_dir):return(true)
}

return(false)
}

defineTest(updateDtkWidgetsFile) {
dtkwidgets_include_files = $$HEADERS
dtkwidgets_file_content = $$quote($${LITERAL_HASH}ifndef DTK_WIDGETS_MODULE_H)
dtkwidgets_file_content += $$quote($${LITERAL_HASH}defined DTK_WIDGETS_MODULE_H)

for(header, dtkwidgets_include_files) {
containIncludeFiles($$header) {
dtkwidgets_file_content += $$quote($${LITERAL_HASH}include \"$$basename(header)\")
}
}

dtkwidgets_file_content += $$quote($${LITERAL_HASH}endif)
!write_file($$PWD/DtkWidgets, dtkwidgets_file_content, exe):return(false)

return(true)
}

!updateDtkWidgetsFile():warning(Cannot create "DtkWidgets" header file)

0 comments on commit b223577

Please sign in to comment.