pro2cmake: Enable AUTOUIC only if the project has FORMS

Change-Id: I1bf232fa3c389eb86707d3af04de6cf9eb09451a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2022-03-03 12:11:58 +01:00
parent 1c2f6d2ace
commit e60c41ac0a

View File

@ -3878,7 +3878,11 @@ def write_example(
f"project({binary_name} VERSION {project_version} LANGUAGES CXX)\n\n" f"project({binary_name} VERSION {project_version} LANGUAGES CXX)\n\n"
"set(CMAKE_INCLUDE_CURRENT_DIR ON)\n\n" "set(CMAKE_INCLUDE_CURRENT_DIR ON)\n\n"
"set(CMAKE_AUTOMOC ON)\n" "set(CMAKE_AUTOMOC ON)\n"
"set(CMAKE_AUTOUIC ON)\n\n" )
if scope.get_files("FORMS"):
cm_fh.write("set(CMAKE_AUTOUIC ON)\n")
cm_fh.write("\n")
cm_fh.write(
"if(NOT DEFINED INSTALL_EXAMPLESDIR)\n" "if(NOT DEFINED INSTALL_EXAMPLESDIR)\n"
' set(INSTALL_EXAMPLESDIR "examples")\n' ' set(INSTALL_EXAMPLESDIR "examples")\n'
"endif()\n\n" "endif()\n\n"