如何通过满足依赖关系来安静 cmake?
-- Found Qt-Version 4.8.7 (using /usr/bin/qmake-qt4)
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found KDE 4.12 include dir: /usr/include
-- Found KDE 4.12 library dir: /usr/lib
-- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
-- Found Qt-Version 4.8.7 (using /usr/bin/qmake-qt4)
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1094 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:218 (kde4_add_library)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:255 (kde4_add_executable)
src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:268 (kde4_add_unit_test)
src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:273 (kde4_add_unit_test)
src/CMakeLists.txt:290 (add_database_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
src/CMakeLists.txt:273 (kde4_add_unit_test)
src/CMakeLists.txt:290 (add_database_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
property. Run "cmake --help-policy CMP0059" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
/usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:339 (kde4_add_executable)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/MacroOptionalAddSubdirectory.cmake:38 (ADD_SUBDIRECTORY):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The binary directory
/home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc
is already used to build a source directory. This command uses it to build
source directory
/home/alexandr/krecipes/doc
which can generate conflicting build files. CMake does not support this
use case but it used to work accidentally and is being allowed for
compatibility.
Call Stack (most recent call first):
CMakeLists.txt:31 (macro_optional_add_subdirectory)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at doc/CMakeLists.txt:1 (add_subdirectory):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The binary directory
/home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/uk
is already used to build a source directory. This command uses it to build
source directory
/home/alexandr/krecipes/doc/uk
which can generate conflicting build files. CMake does not support this
use case but it used to work accidentally and is being allowed for
compatibility.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
Policy CMP0002 is not set: Logical target names must be globally unique.
Run "cmake --help-policy CMP0002" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
doc/uk/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at doc/CMakeLists.txt:2 (add_subdirectory):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The binary directory
/home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/sv
is already used to build a source directory. This command uses it to build
source directory
/home/alexandr/krecipes/doc/sv
which can generate conflicting build files. CMake does not support this
use case but it used to work accidentally and is being allowed for
compatibility.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
Policy CMP0002 is not set: Logical target names must be globally unique.
Run "cmake --help-policy CMP0002" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
doc/sv/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at doc/CMakeLists.txt:3 (add_subdirectory):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The binary directory
/home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/en_US
is already used to build a source directory. This command uses it to build
source directory
/home/alexandr/krecipes/doc/en_US
which can generate conflicting build files. CMake does not support this
use case but it used to work accidentally and is being allowed for
compatibility.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
Policy CMP0002 is not set: Logical target names must be globally unique.
Run "cmake --help-policy CMP0002" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
doc/en_US/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at doc/CMakeLists.txt:4 (add_subdirectory):
Policy CMP0013 is not set: Duplicate binary directories are not allowed.
Run "cmake --help-policy CMP0013" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The binary directory
/home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/pt_BR
is already used to build a source directory. This command uses it to build
source directory
/home/alexandr/krecipes/doc/pt_BR
which can generate conflicting build files. CMake does not support this
use case but it used to work accidentally and is being allowed for
compatibility.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
Policy CMP0002 is not set: Logical target names must be globally unique.
Run "cmake --help-policy CMP0002" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Call Stack (most recent call first):
doc/pt_BR/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.5)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes
CMake 不是在抱怨依赖关系,而是在抱怨策略CMP0059。
在您的开头写下以下行
CMakeLists.txt:一般来说,“策略”是一种在不同版本的 CMake 之间保持向后兼容性的方式。一旦对某些现有功能进行更改,就会引入一项策略,允许您在旧行为和新行为之间进行选择。默认情况下,选择旧行为并显示警告以做出明确选择。
在这种情况下,我们谈论的是在 3.3 版本之前,预处理器声明列表仅在其位置不高于
CMakeLists.txt添加相应声明的文件夹时才可见。在新版本中,所有声明似乎都变成了全局的。