Commit 9c4ee991 authored by Martin Heistermann's avatar Martin Heistermann

cmake: workaround for qtcreator bug

parent 16612e64
Pipeline #3285 passed with stage
in 82 minutes and 29 seconds
...@@ -109,6 +109,7 @@ acg_append_files (sources "*.cc" ${directories}) ...@@ -109,6 +109,7 @@ acg_append_files (sources "*.cc" ${directories})
acg_append_files (ui "*.ui" ${directories}) acg_append_files (ui "*.ui" ${directories})
acg_append_files (qrc "*.qrc" ${directories} .) acg_append_files (qrc "*.qrc" ${directories} .)
target_sources(_qtcreator_add_files PUBLIC ${sources} ${headers})
# remove template cc files from source file list # remove template cc files from source file list
acg_drop_templates (sources) acg_drop_templates (sources)
......
...@@ -79,6 +79,22 @@ include (MSVCMacros) ...@@ -79,6 +79,22 @@ include (MSVCMacros)
acg_get_version (OpenFlipper) acg_get_version (OpenFlipper)
# ========================================================================
# qtcrator workaround for missing files in project
# ========================================================================
# qtcreator (4.0.3) does not include some header files and *T.cc in its
# project structure. The issue is well-known, this is a workaround.
# Unfortunately I could not find a workaround that does not involve adding
# a dummy target that is visible in the target list.
# To force adding files to the project structure, use
# target_sources(_qtcreator_add_files PUBLIC ${EXTRA_FILES})
# in your CMakeLists.txt
add_library(_qtcreator_add_files CMakeLists.txt) # dummy file that always exists
set_target_properties(_qtcreator_add_files PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
# ======================================================================== # ========================================================================
# Branding # Branding
# ======================================================================== # ========================================================================
......
...@@ -576,6 +576,8 @@ function (_build_openflipper_plugin plugin) ...@@ -576,6 +576,8 @@ function (_build_openflipper_plugin plugin)
acg_append_files (ui "*.ui" ${directories}) acg_append_files (ui "*.ui" ${directories})
acg_append_files (qrc "*.qrc" ${directories}) acg_append_files (qrc "*.qrc" ${directories})
target_sources(_qtcreator_add_files PUBLIC ${sources} ${headers})
# remove template cc files from source file list # remove template cc files from source file list
acg_drop_templates (sources) acg_drop_templates (sources)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment