2022-07-05 11:26:52 +00:00
|
|
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2022-08-19 13:21:34 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-07-05 11:26:52 +00:00
|
|
|
|
2020-08-18 16:13:03 +00:00
|
|
|
# CMake script to ensure that a qmake project file exists.
|
|
|
|
#
|
|
|
|
# Usage: cmake -DPRO_FILE=.../project.pro -P .../ensure_pro_file.cmake
|
|
|
|
#
|
|
|
|
# This script checks for existence of ${PRO_FILE} and creates a fake one, if needed.
|
|
|
|
#
|
|
|
|
|
|
|
|
if(NOT EXISTS "${PRO_FILE}")
|
|
|
|
get_filename_component(dir "${PRO_FILE}" DIRECTORY)
|
|
|
|
if(NOT IS_DIRECTORY "${dir}")
|
|
|
|
file(MAKE_DIRECTORY "${dir}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
file(WRITE "${PRO_FILE}" "TEMPLATE = aux
|
|
|
|
")
|
|
|
|
endif()
|