Hi, has anyone used kdevelop to make a qt4 qml app based on cmake
I'm getting the error policy cmp0003 cmake.
I am using Slackware-current
Code:
-- Found automoc4: /usr/bin/automoc4
CMake Warning (dev) at /usr/lib64/automoc4/Automoc4Config.cmake:179 (get_directory_property):
Policy CMP0059 is not set: Do not 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/lib64/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
/usr/share/apps/cmake/modules/KDE4Macros.cmake:1027 (_automoc4_kde4_pre_target_handling)
src/CMakeLists.txt:11 (kde4_add_executable)
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.13)
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.
CMake Warning (dev) at /usr/share/apps/cmake/modules/KDE4Macros.cmake:1034 (add_executable):
Policy CMP0037 is not set: Target names should not be reserved and should
match a validity pattern. Run "cmake --help-policy CMP0037" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
The target name "test" is reserved when CTest testing is enabled. It may
result in undefined behavior.
Call Stack (most recent call first):
src/CMakeLists.txt:11 (kde4_add_executable)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
CMake Warning (dev) at /usr/share/apps/cmake/modules/KDE4Macros.cmake:1034 (add_executable):
Policy CMP0003 should be set before this line. Add code such as
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
as early as possible but after the most recent call to
cmake_minimum_required or cmake_policy(VERSION). This warning appears
because target "test" links to some libraries for which the linker must
search:
-lpthread
and other libraries with known full path:
/usr/lib64/libkdeui.so.5.14.38
/usr/lib64/qt/lib/libQtDeclarative.so
CMake is adding directories in the second list to the linker search path in
case they are needed to find libraries from the first list (for backwards
compatibility with CMake 2.4). Set policy CMP0003 to OLD or NEW to enable
or disable this behavior explicitly. Run "cmake --help-policy CMP0003" for
more information.
Call Stack (most recent call first):
src/CMakeLists.txt:11 (kde4_add_executable)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/pritvi/projects/test/build
in the cmake doc at
https://cmake.org/cmake/help/v3.13/policy/CMP0003.html
Quote:
This policy was introduced in CMake version 2.6.0. CMake version 3.13.1 warns when the policy is not set and uses OLD behavior. Use the cmake_policy command to set it to OLD or NEW explicitly.
|
I am not sure whether this is a bug or a mistake from me but -current on my machine is recent and not heavily modified.
I tried to add the cmake configuration in the kdevelop project, it did not work.
Code:
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
If it needs to be added here, /usr/share/apps/cmake/modules/KDE4Macros.cmake then a patch has to be done.