CMakePM: auto-setup.cmake do not fail if QtCreator.ini doesn't exist

There are Qt Creator installations that do not provide
"QtProject/QtCreator.ini" file, and without it the auto-setup.cmake
code would fail.

Task-number: QTBUG-99273
Change-Id: I7674f68bc89375d8065d820b89650a358a7226b2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2022-01-25 15:33:00 +01:00
parent 4fc883d491
commit 795d7364df

View File

@@ -33,6 +33,7 @@ macro(qtc_auto_setup_conan)
# Get conan from Qt SDK
set(qt_creator_ini "${CMAKE_CURRENT_LIST_DIR}/../QtProject/QtCreator.ini")
if (EXISTS ${qt_creator_ini})
file(STRINGS ${qt_creator_ini} install_settings REGEX "^InstallSettings=.*$")
if (install_settings)
string(REPLACE "InstallSettings=" "" install_settings "${install_settings}")
@@ -46,6 +47,7 @@ macro(qtc_auto_setup_conan)
file(TO_CMAKE_PATH "${conan_executable}" conan_executable)
get_filename_component(conan_path "${conan_executable}" DIRECTORY)
endif()
endif()
set(path_sepparator ":")
if (WIN32)