LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-10-2018, 06:36 PM   #1
jheengut
Member
 
Registered: Sep 2006
Location: Providence, Moka Mauritius
Distribution: Slackware, Lubuntu
Posts: 352
Blog Entries: 16

Rep: Reputation: 51
policy cmp0003 cmake using kdevelop


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.

Last edited by jheengut; 12-10-2018 at 06:38 PM.
 
Old 12-11-2018, 11:08 AM   #2
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Correct me if I am wrong, but this is not a fatal error and just a warning? With newer cmake versions they add new warnings when behavior changes which might break build projects and you can just let upstream deal with it while suppressing the warnings.

Quote:
This warning is for project developers. Use -Wno-dev to suppress it.
If it really bothers you please feel free to ask upstream about it.

If you want to learn more about these warnings you can try the suggested commands "cmake --help-policy" commands, note that there are several different warnings here.
 
Old 12-12-2018, 01:02 AM   #3
jheengut
Member
 
Registered: Sep 2006
Location: Providence, Moka Mauritius
Distribution: Slackware, Lubuntu
Posts: 352

Original Poster
Blog Entries: 16

Rep: Reputation: 51
Quote:
Originally Posted by orbea View Post
Correct me if I am wrong, but this is not a fatal error and just a warning? With newer cmake versions they add new warnings when behavior changes which might break build projects and you can just let upstream deal with it while suppressing the warnings.



If it really bothers you please feel free to ask upstream about it.

Matter of fact, I have not been able to suppress the warnings, this is why I don't know where to put that code to suppress the warning, in my project.

If the code has to be inserted in the /usr/share files then it is better to create a patch and make a new package.

This is where I am not so sure of which steps I need to take.
 
Old 12-12-2018, 09:06 AM   #4
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
To suppress the warnings just add this to the cmake invocation.

Code:
-Wno-dev
For example:

Code:
mkdir -p build
cd build
  cmake \
    -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DLIB_SUFFIX=${LIBDIRSUFFIX} \
    -DMAN_INSTALL_DIR=/usr/man \
    -Wno-dev \
    -DCMAKE_BUILD_TYPE=Release ..
  make
  make install DESTDIR=$PKG
cd ..
 
1 members found this post helpful.
Old 12-13-2018, 11:42 PM   #5
jheengut
Member
 
Registered: Sep 2006
Location: Providence, Moka Mauritius
Distribution: Slackware, Lubuntu
Posts: 352

Original Poster
Blog Entries: 16

Rep: Reputation: 51
thanks for the info
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware-current: /usr/share/cmake and /usr/share/cmake-3.3 directories igor29768 Slackware 1 11-07-2015 12:37 AM
CMake Strange "Install" behaviour with home-grown software [Linux x86_64, CMake 2.8] ajschaeffer Programming 0 10-24-2011 03:21 AM
Compiling source code for debugging (KDevelop/cmake) deadeyes Programming 5 12-14-2010 02:49 PM
cmake: Using find_package(Boost) when FindBoost.cmake is not in the default location damien_d Programming 3 10-27-2010 03:40 PM
Problems with Cmake and Kdevelop rishi1226 Linux - Newbie 1 09-08-2009 01:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration