diff options
-rw-r--r-- | .cmake.conf | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 13 |
3 files changed, 15 insertions, 2 deletions
diff --git a/.cmake.conf b/.cmake.conf new file mode 100644 index 0000000000..9305480451 --- /dev/null +++ b/.cmake.conf @@ -0,0 +1 @@ +set(QT_REPO_MODULE_VERSION "6.0.0") diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cf6e7cac3..97fbfac421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,8 +14,9 @@ if (CMAKE_CROSSCOMPILING AND CMAKE_SYSROOT) set(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_SYSROOT}) endif() +include(".cmake.conf") project(QtBase - VERSION 6.0.0 + VERSION "${QT_REPO_MODULE_VERSION}" DESCRIPTION "Qt Base Libraries" HOMEPAGE_URL "https://qt.io/" LANGUAGES CXX C ASM diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 89d8412448..48bb8b7d88 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -3846,8 +3846,9 @@ def handle_top_level_repo_project(scope: Scope, cm_fh: IO[str]): f"""\ cmake_minimum_required(VERSION {cmake_version_string}) + include(.cmake.conf) project({qt_lib} - VERSION 6.0.0 + VERSION "${{QT_REPO_MODULE_VERSION}}" DESCRIPTION "Qt {qt_lib_no_prefix} Libraries" HOMEPAGE_URL "https://qt.io/" LANGUAGES CXX C @@ -3868,6 +3869,15 @@ def handle_top_level_repo_project(scope: Scope, cm_fh: IO[str]): cm_fh.write(f"{header}{expand_project_requirements(scope)}{build_repo}") +def create_top_level_cmake_conf(): + conf_file_name = ".cmake.conf" + try: + with open(conf_file_name, 'x') as file: + file.write("set(QT_REPO_MODULE_VERSION \"6.0.0\")\n") + except FileExistsError as _: + pass + + def find_top_level_repo_project_file(project_file_path: str = "") -> Optional[str]: qmake_conf_path = find_qmake_conf(project_file_path) qmake_dir = os.path.dirname(qmake_conf_path) @@ -4034,6 +4044,7 @@ def cmakeify_scope( # Handle top level repo project in a special way. if is_top_level_repo_project(scope.file_absolute_path): + create_top_level_cmake_conf() handle_top_level_repo_project(scope, temp_buffer) # Same for top-level tests. elif is_top_level_repo_tests_project(scope.file_absolute_path): |