Debian Codegraph @

coin/instructions/qmake/ensure_pro_file.cmake

raw
1 # Copyright (C) 2022 The Qt Company Ltd.
2 # SPDX-License-Identifier: BSD-3-Clause
3
4 # CMake script to ensure that a qmake project file exists.
5 #
6 # Usage: cmake -DPRO_FILE=.../project.pro -P .../ensure_pro_file.cmake
7 #
8 # This script checks for existence of ${PRO_FILE} and creates a fake one, if needed.
9 #
10
11 if(NOT EXISTS "${PRO_FILE}")
12 get_filename_component(dir "${PRO_FILE}" DIRECTORY)
13 if(NOT IS_DIRECTORY "${dir}")
14 file(MAKE_DIRECTORY "${dir}")
15 endif()
16
17 file(WRITE "${PRO_FILE}" "TEMPLATE = aux
18 ")
19 endif()