← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Remove unused custom cmake target

 

Hi Wayne,

Ahh, ok. I clearly failed at grepping at first. I also get those cmake
warnings when I actually make and not just configure.To me it seems that it
is indeed true that we don't need that custom target.

I have attached a v2 patch which also removes it as a dependency from the
other places. This is to be applied instead of the previous patch.

Nick

2017-12-02 15:05 GMT+01:00 Wayne Stambaugh <stambaughw@xxxxxxxxx>:

> I'm using cmake 3.9.5 so it may be a new policy warning that isn't
> available on older versions of cmake.  In any event, the dependencies on
> lib-dependencies should be removed since your patch removes it as a
> custom target.
>
> On 12/02/2017 08:36 AM, Nick Østergaard wrote:
> > Hmm, strange. I didn't have those warnings, but I mostly tested in a new
> > build dir.  I will have a look.
> >
> > 2017-12-02 14:15 GMT+01:00 Wayne Stambaugh <stambaughw@xxxxxxxxx
> > <mailto:stambaughw@xxxxxxxxx>>:
> >
> >     Hey Nick,
> >
> >     I don't have any build issues with your patch but I get a bunch of
> CMake
> >     warnings (see below) about the undefined dependencies.  Would you
> please
> >     remove the dependencies on lib-dependencies so cmake doesn't complain
> >     and resubmit your patch when you get a chance.
> >
> >     Thanks,
> >
> >     Wayne
> >
> >     CMake Warning (dev) at common/CMakeLists.txt:67 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "gal" does not
> >     exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >     CMake Warning (dev) at common/CMakeLists.txt:439 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "pcbcommon"
> >     does not
> >       exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >     CMake Warning (dev) at common/CMakeLists.txt:356 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "common" does
> not
> >     exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >     CMake Warning (dev) at common/CMakeLists.txt:544 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "dsntest" does
> not
> >       exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >     CMake Warning (dev) at pcbnew/CMakeLists.txt:718 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "pcbnew" does
> not
> >     exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >     CMake Warning (dev) at pcbnew/CMakeLists.txt:577 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "github_plugin"
> >     does not
> >       exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >     CMake Warning (dev) at polygon/CMakeLists.txt:20 (add_dependencies):
> >       Policy CMP0046 is not set: Error on non-existent dependency in
> >       add_dependencies.  Run "cmake --help-policy CMP0046" for policy
> >     details.
> >       Use the cmake_policy command to set the policy and suppress this
> >     warning.
> >
> >       The dependency target "lib-dependencies" of target "polygon" does
> not
> >       exist.
> >     This warning is for project developers.  Use -Wno-dev to suppress it.
> >
> >
> >
> >     On 12/01/2017 02:28 PM, Nick Østergaard wrote:
> >     > Hello
> >     >
> >     > I just fell over some legacy stuff in the CMakeLists. It seems to
> >     not be
> >     > used, so therefore I propose to remove it.
> >     >
> >     > This target seems to only create empty makefiles, tested on linux.
> >     And I
> >     > can not find any references to it in any of the current
> >     CMakeLists. Lets
> >     > remove it.
> >     >
> >     > Nick
> >     >
> >     >
> >     > _______________________________________________
> >     > Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     > Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     > More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >     >
> >
> >     _______________________________________________
> >     Mailing list: https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> >     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> >     Unsubscribe : https://launchpad.net/~kicad-developers
> >     <https://launchpad.net/~kicad-developers>
> >     More help   : https://help.launchpad.net/ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >
> >
>
From 483fd63320e5bbdde0a4f5c69f775da9f9faa9a0 Mon Sep 17 00:00:00 2001
From: Nick ?stergaard <oe.nick@xxxxxxxxx>
Date: Fri, 1 Dec 2017 20:21:20 +0100
Subject: [PATCH] Remove unused custom cmake target

This target seems to only create empty makefiles, tested on linux. And I
can not find any references to it in any of the current CMakeLists. Lets
remove it.
---
 CMakeLists.txt         | 10 ----------
 common/CMakeLists.txt  |  6 ------
 pcbnew/CMakeLists.txt  |  4 ----
 polygon/CMakeLists.txt |  2 --
 4 files changed, 22 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 565508c89..c70a34237 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -513,16 +513,6 @@ include( ${wxWidgets_USE_FILE} )
 #
 find_package( OpenGL REQUIRED )
 
-# Dick 5-Feb-2014:
-# Marco: We cannot use both ExternalProject_Add() add and find_package()
-# in the same CMake tree and have them both reference the same package:
-# http://stackoverflow.com/questions/6351609/cmake-linking-to-library-downloaded-from-externalproject-add
-# https://www.mail-archive.com/cmake@xxxxxxxxx/msg47501.html
-
-# Handle target used to specify if a target needs wx-widgets or other libraries
-# Always defined, empty if no libraries are to be built
-add_custom_target( lib-dependencies )
-
 #
 # Find GLEW library, required
 #
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index f4ff41469..cb7281846 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -64,7 +64,6 @@ set( GAL_SRCS
     )
 
 add_library( gal STATIC ${GAL_SRCS} )
-add_dependencies( gal lib-dependencies )
 
 target_link_libraries( gal
     ${GLEW_LIBRARIES}
@@ -353,7 +352,6 @@ set( COMMON_SRCS
     libeval/numeric_evaluator.cpp
     )
 add_library( common STATIC ${COMMON_SRCS} )
-add_dependencies( common lib-dependencies )
 add_dependencies( common version_header )
 target_link_libraries( common
     gal
@@ -436,8 +434,6 @@ set_source_files_properties( ${PCB_COMMON_SRCS} PROPERTIES
     )
 
 add_library( pcbcommon STATIC ${PCB_COMMON_SRCS} )
-add_dependencies( pcbcommon lib-dependencies )
-
 
 # auto-generate netlist_lexer.h and netlist_keywords.cpp
 make_lexer(
@@ -541,8 +537,6 @@ add_dependencies( common page_layout_lexer_source_files )
 add_executable( dsntest EXCLUDE_FROM_ALL dsnlexer.cpp )
 target_link_libraries( dsntest common ${wxWidgets_LIBRARIES} rt )
 
-add_dependencies( dsntest lib-dependencies )
-
 target_link_libraries( pcbcommon )
 
 
diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt
index aa1886f25..d1b78b2e8 100644
--- a/pcbnew/CMakeLists.txt
+++ b/pcbnew/CMakeLists.txt
@@ -574,7 +574,6 @@ add_subdirectory( pcad2kicadpcb_plugin )
 
 if( BUILD_GITHUB_PLUGIN )
     add_subdirectory( github )
-    add_dependencies( github_plugin lib-dependencies )
     # github_plugin depends on make_lexer outputs in common
     add_dependencies( github_plugin pcbcommon )
 endif()
@@ -715,9 +714,6 @@ else()
         )
 endif()
 
-add_dependencies( pcbnew lib-dependencies )
-
-
 if( KICAD_SCRIPTING )
     if( NOT APPLE )
         install( FILES ${CMAKE_BINARY_DIR}/pcbnew/pcbnew.py DESTINATION ${PYTHON_DEST} )
diff --git a/polygon/CMakeLists.txt b/polygon/CMakeLists.txt
index afa51cfe5..cd5959ef3 100644
--- a/polygon/CMakeLists.txt
+++ b/polygon/CMakeLists.txt
@@ -17,5 +17,3 @@ set(POLYGON_SRCS
 
 add_library(polygon STATIC ${POLYGON_SRCS})
 
-add_dependencies( polygon lib-dependencies )
-
-- 
2.15.0


Follow ups

References