CMake janitor
cover CMake janitor
Hi all,
Here is a short series cleaning the packages using the cmake-package infra. It mostly consists in removing configure options already preset by the infra.
Regards,
Samuel Martin (15):
package/pkg-cmake.mk: globally disable doc, examples and tests package/pkg-cmake.mk: disable colouring the output package/clapack: cleanup configure options package/flann: cleanup configure options package/libsoxr: cleanup configure options package/libsoxr: cleanup configure options package/libubox: cleanup dependencies package/libubox: cleanup configure options package/libubox: cleanup configure options package/libuci: cleanup configure options package/libuci: cleanup configure options package/ne10: cleanup configure options package/opencv: cleanup configure options package/polarssl: cleanup configure options docs/manual: update cmake-package infrastructure section
docs/manual/adding-packages-cmake.txt | 10 ++++++++++ package/clapack/clapack.mk | 1 - package/flann/flann.mk | 2 -- package/libsoxr/libsoxr.mk | 4 ++-- package/libubox/libubox.mk | 7 ++++--- package/libuci/libuci.mk | 5 +++-- package/ne10/ne10.mk | 5 ----- package/opencv/opencv.mk | 2 -- package/pkg-cmake.mk | 13 +++++++++++++ package/polarssl/polarssl.mk | 1 - 10 files changed, 32 insertions(+), 18 deletions(-)
--
2.1.2
PATCH 1/15 package/pkg-cmake.mk: globally disable doc, examples and tests
This patch globally disables doc, examples and tests build for both the target and host packages.
If needed, these configure flags can be overloaded in the per-package *_CONF_OPTS variables.
This makes the cmake-package infrastructure even closer to the autotools one.
--- package/pkg-cmake.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+)
package/pkg-cmake.mk +12 -0
@@ -66,6 +66,12 @@ define $(2)_CONFIGURE_CMDS -DCMAKE_BUILD_TYPE=$$(if $$(BR2_ENABLE_DEBUG),Debug,Release) \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_COLOR_MAKEFILE=OFF \ + -DBUILD_DOC=OFF \ + -DBUILD_DOCS=OFF \ + -DBUILD_EXAMPLE=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TEST=OFF \ + -DBUILD_TESTS=OFF \ -DBUILD_TESTING=OFF \ -DBUILD_SHARED_LIBS=$$(if $$(BR2_PREFER_STATIC_LIB),OFF,ON) \ -DUSE_CCACHE=$$(if $$(BR2_CCACHE),ON,OFF) \
@@ -89,6 +95,12 @@ define $(2)_CONFIGURE_CMDS -DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \ + -DBUILD_DOC=OFF \ + -DBUILD_DOCS=OFF \ + -DBUILD_EXAMPLE=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TEST=OFF \ + -DBUILD_TESTS=OFF \ -DBUILD_TESTING=OFF \ $$($$(PKG)_CONF_OPTS) \ )
Signature · 1 line
2.1.2
PATCH 1/15 package/pkg-cmake.mk: globally disable doc, examples and tests
Dear Samuel Martin,
package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 74
Quoted 6 lines · Samuel Martin
package/pkg-cmake.mk +6
-0+ -DBUILD_DOC=OFF \ + -DBUILD_DOCS=OFF \ + -DBUILD_EXAMPLE=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TEST=OFF \ + -DBUILD_TESTS=OFF \
Are these options standardized by CMake, or are they just "generally" used by a number of packages?
If not, I don't see why they should be passed by the CMake infrastructure.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/15 package/pkg-cmake.mk: globally disable doc, examples and tests
Hi Thomas, all,
Quoted 11 lines · Thomas Petazzoni
Dear Samuel Martin,
package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 74
Quoted 6 lines · Samuel Martin
package/pkg-cmake.mk +6
-0+ -DBUILD_DOC=OFF \ + -DBUILD_DOCS=OFF \ + -DBUILD_EXAMPLE=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DBUILD_TEST=OFF \ + -DBUILD_TESTS=OFF \
Quoted 2 lines
Are these options standardized by CMake, or are they just "generally" used by a number of packages?
Not standardized by CMake, just used by a number of packages.
Quoted 3 lines
If not, I don't see why they should be passed by the CMake infrastructure.
Since we don't really care about these things, and don't want to be bothered by failure because of these features, I think it's a way to enforce disabling them.
Quoted 8 lines
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Regards,
Signature · 1 line
Samuel
PATCH 1/15 package/pkg-cmake.mk: globally disable doc, examples and tests
Dear Samuel Martin,
Quoted 6 lines · Samuel Martin
Quoted 2 lines
Are these options standardized by CMake, or are they just "generally" used by a number of packages?
Not standardized by CMake, just used by a number of packages.
Quoted 1 line
Quoted 6 lines
Quoted 2 lines
If not, I don't see why they should be passed by the CMake infrastructure.
Since we don't really care about these things, and don't want to be bothered by failure because of these features, I think it's a way to enforce disabling them.
And so, we will keep adding more and more options that are not CMake standard options to the core CMake infrastructure?
I know we've done that for pkg-autotools, but I'm not sure it was such a great idea. Especially, I'd like to understand where we will stop:
will we, when two packages have common options, move them to the common infrastructure, even if those options are not CMake standard at all?
At least, I'd like to see what is our "policy" about this, and get some feedback from other Buildroot developers on this.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/15 package/pkg-cmake.mk: globally disable doc, examples and tests
Quoted 17 lines · Thomas Petazzoni
Dear Samuel Martin,
Quoted 6 lines · Samuel Martin
Quoted 2 lines
Are these options standardized by CMake, or are they just "generally" used by a number of packages?
Not standardized by CMake, just used by a number of packages.
Quoted 1 line
Quoted 6 lines
Quoted 2 lines
If not, I don't see why they should be passed by the CMake infrastructure.
Since we don't really care about these things, and don't want to be bothered by failure because of these features, I think it's a way to enforce disabling them.
Quoted 7 lines
And so, we will keep adding more and more options that are not CMake standard options to the core CMake infrastructure?
I know we've done that for pkg-autotools, but I'm not sure it was such a great idea. Especially, I'd like to understand where we will stop:
will we, when two packages have common options, move them to the common infrastructure, even if those options are not CMake standard at all?
This is a fair question.
Quoted 3 lines
At least, I'd like to see what is our "policy" about this, and get some feedback from other Buildroot developers on this.
Well, the discussion is now open. ;-)
BTW, this series also contains a number of fixes and cleanup unrelated to this particular change that go in anyway IMHO.
Regards,
Quoted 6 lines
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Signature · 1 line
Samuel
PATCH 1/15 package/pkg-cmake.mk: globally disable doc, examples and tests
In reply to Thomas PetazzoniQuoted 3 lines · Thomas Petazzoni
Dear Samuel Martin,
On Sun, 19 Oct 2014 22:28:18 +0200, Samuel Martin wrote:
[snip]
Quoted 7 lines
Quoted 3 lines
Since we don't really care about these things, and don't want to be bothered by failure because of these features, I think it's a way to enforce disabling them.
And so, we will keep adding more and more options that are not CMake standard options to the core CMake infrastructure?
Quoted 7 lines
I know we've done that for pkg-autotools, but I'm not sure it was such a great idea. Especially, I'd like to understand where we will stop:
will we, when two packages have common options, move them to the common infrastructure, even if those options are not CMake standard at all?At least, I'd like to see what is our "policy" about this, and get some feedback from other Buildroot developers on this.
I prefer to have these things in the common package infrastructure. It makes it
easier for package contributors to get things right. It doesn't really hurt to add redundant options to configure or cmake (except for the warning, but the warning message is clear enough to see when it is or isn't problematic). And it's extremely unlikely that the options we provide in the infrastructure will ever by wrong.
So for me, ease of development takes precedence over cleanliness.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 2/15 package/pkg-cmake.mk: disable colouring the output
In reply to Samuel MartinBecause cmake was the only build-system supporting this feature, it has been disabled for the target packages.
For consistency, this patch does the same for host package too.
--- package/pkg-cmake.mk | 1 + 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +1 -0
@@ -95,6 +95,7 @@ define $(2)_CONFIGURE_CMDS -DCMAKE_C_FLAGS="$$(HOST_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$$(HOST_LDFLAGS)" \ + -DCMAKE_COLOR_MAKEFILE=OFF \ -DBUILD_DOC=OFF \ -DBUILD_DOCS=OFF \ -DBUILD_EXAMPLE=OFF \
Signature · 1 line
2.1.2
PATCH 3/15 package/clapack: cleanup configure options
In reply to Samuel MartinRemove the BUILD_TESTING configure option (note the typo in its existing name), which is already set to the same value by the cmake infrastructure.
--- package/clapack/clapack.mk | 1 - 1 file changed, 1 deletion(-)
package/clapack/clapack.mk +0 -1
@@ -14,7 +14,6 @@ CLAPACK_LICENSE = HPND (libf2c), BSD-3c (libblas and liblapack) CLAPACK_LICENSE_FILES = F2CLIBS/libf2c/Notice COPYING CLAPACK_SITE = http://www.netlib.org/clapack CLAPACK_INSTALL_STAGING = YES -CLAPACK_CONF_OPTS = -DBUILDTESTING=OFF ifneq ($(BR2_PACKAGE_CLAPACK_ARITH_H),) CLAPACK_CONF_OPTS += -DARITH_H=$(BR2_PACKAGE_CLAPACK_ARITH_H)
Signature · 1 line
2.1.2
PATCH 4/15 package/flann: cleanup configure options
In reply to Samuel MartinDisabling doc and test build is already done by the cmake-package infrastructure.
--- package/flann/flann.mk | 2 -- 1 file changed, 2 deletions(-)
package/flann/flann.mk +0 -2
@@ -14,8 +14,6 @@ FLANN_CONF_OPTS = \ -DBUILD_PYTHON_BINDINGS=OFF \ -DBUILD_MATLAB_BINDINGS=OFF \ -DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_FLANN_EXAMPLES),ON,OFF) \ - -DBUILD_TESTS=OFF \ - -DBUILD_DOC=OFF \ -DUSE_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF) \ -DPYTHON_EXECUTABLE=OFF
Signature · 1 line
2.1.2
PATCH 5/15 package/libsoxr: cleanup configure options
In reply to Samuel MartinTest build is already disabled by the cmake-package infrastructure.
--- package/libsoxr/libsoxr.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libsoxr/libsoxr.mk +1 -1
@@ -10,7 +10,7 @@ LIBSOXR_SITE = http://downloads.sourceforge.net/project/soxr LIBSOXR_LICENSE = LGPLv2.1+ LIBSOXR_LICENSE_FILES = LICENCE COPYING.LGPL LIBSOXR_INSTALL_STAGING = YES -LIBSOXR_CONF_OPTS = -DWITH_OPENMP:BOOL=OFF -DBUILD_TESTS:BOOL=OFF +LIBSOXR_CONF_OPTS = -DWITH_OPENMP=OFF ifeq ($(BR2_PREFER_STATIC_LIB),y) LIBSOXR_CONF_OPTS += -DBUILD_SHARED_LIBS:BOOL=OFF
Signature · 1 line
2.1.2
PATCH 6/15 package/libsoxr: cleanup configure options
In reply to Samuel MartinBUILD_SHARED_LIBS is already driven by the cmake-package infrastructure.
--- package/libsoxr/libsoxr.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libsoxr/libsoxr.mk +1 -1
@@ -13,7 +13,7 @@ LIBSOXR_INSTALL_STAGING = YES LIBSOXR_CONF_OPTS = -DWITH_OPENMP=OFF ifeq ($(BR2_PREFER_STATIC_LIB),y) -LIBSOXR_CONF_OPTS += -DBUILD_SHARED_LIBS:BOOL=OFF +LIBSOXR_CONF_OPTS += -DBUILD_SHARED_LIBS=OFF endif ifeq ($(call qstrip,$(BR2_ENDIAN)),BIG)
Signature · 1 line
2.1.2
PATCH 7/15 package/libubox: cleanup dependencies
In reply to Samuel Martinhost-pkgconf is already a (runtime) dependency for host-cmake.
--- package/libubox/libubox.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libubox/libubox.mk +1 -1
@@ -8,7 +8,7 @@ LIBUBOX_VERSION = 5a0bbefc8fa440446253b171d0ac038d839360e3 LIBUBOX_SITE = git://nbd.name/luci2/libubox.git LIBUBOX_LICENSE = LGPLv2.1, GPLv2, BSD-3c, MIT LIBUBOX_INSTALL_STAGING = YES -LIBUBOX_DEPENDENCIES = host-pkgconf $(if $(BR2_PACKAGE_JSON_C),json-c) +LIBUBOX_DEPENDENCIES = $(if $(BR2_PACKAGE_JSON_C),json-c) ifeq ($(BR2_USE_MMU)$(BR2_PACKAGE_LUA_5_1),yy) LIBUBOX_DEPENDENCIES += lua
Signature · 1 line
2.1.2
PATCH 8/15 package/libubox: cleanup configure options
In reply to Samuel MartinRemove unneeded type in configure option's definition.
--- package/libubox/libubox.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libubox/libubox.mk +1 -1
@@ -15,7 +15,7 @@ LIBUBOX_DEPENDENCIES += lua LIBUBOX_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include else -LIBUBOX_CONF_OPTS += -DBUILD_LUA:BOOL=OFF +LIBUBOX_CONF_OPTS += -DBUILD_LUA=OFF endif $(eval $(cmake-package))
Signature · 1 line
2.1.2
PATCH 9/15 package/libubox: cleanup configure options
In reply to Samuel MartinMake BUILD_LUA assignation symetrical.
--- package/libubox/libubox.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/libubox/libubox.mk +2 -1
@@ -12,7 +12,8 @@ LIBUBOX_DEPENDENCIES = $(if $(BR2_PACKAGE_JSON_C),json-c) ifeq ($(BR2_USE_MMU)$(BR2_PACKAGE_LUA_5_1),yy) LIBUBOX_DEPENDENCIES += lua -LIBUBOX_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ +LIBUBOX_CONF_OPTS += -DBUILD_LUA=ON \ + -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include else LIBUBOX_CONF_OPTS += -DBUILD_LUA=OFF
Signature · 1 line
2.1.2
PATCH 10/15 package/libuci: cleanup configure options
In reply to Samuel MartinRemove unneeded type in configure option's definition.
--- package/libuci/libuci.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/libuci/libuci.mk +1 -1
@@ -15,7 +15,7 @@ LIBUCI_DEPENDENCIES += lua LIBUCI_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include else -LIBUCI_CONF_OPTS += -DBUILD_LUA:BOOL=OFF +LIBUCI_CONF_OPTS += -DBUILD_LUA=OFF endif $(eval $(cmake-package))
Signature · 1 line
2.1.2
PATCH 11/15 package/libuci: cleanup configure options
In reply to Samuel MartinMake BUILD_LUA assignation symetrical.
--- package/libuci/libuci.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/libuci/libuci.mk +2 -1
@@ -12,7 +12,8 @@ LIBUCI_DEPENDENCIES = libubox ifeq ($(BR2_PACKAGE_LUA_5_1),y) LIBUCI_DEPENDENCIES += lua -LIBUCI_CONF_OPTS += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ +LIBUCI_CONF_OPTS += -DBUILD_LUA=ON \ + -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \ -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include else LIBUCI_CONF_OPTS += -DBUILD_LUA=OFF
Signature · 1 line
2.1.2
PATCH 12/15 package/ne10: cleanup configure options
In reply to Samuel MartinBUILD_SHARED_LIBS is already driven by the cmake-package infrastructure.
--- package/ne10/ne10.mk | 5 ----- 1 file changed, 5 deletions(-)
package/ne10/ne10.mk +0 -5
@@ -11,11 +11,6 @@ NE10_LICENSE_FILES = doc/LICENSE NE10_CONF_OPTS = -DGNULINUX_PLATFORM=ON -ifeq ($(BR2_PREFER_STATIC_LIB),) -NE10_CONF_OPTS += \ - -DNE10_BUILD_SHARED=ON -endif - # The package does not have any install target, so have to provide # INSTALL_STAGING_CMDS and INSTALL_TARGET_CMDS.
Signature · 1 line
2.1.2
PATCH 13/15 package/opencv: cleanup configure options
In reply to Samuel MartinDisabling doc and example build is already done by the cmake-package infrastructure.
--- package/opencv/opencv.mk | 2 -- 1 file changed, 2 deletions(-)
package/opencv/opencv.mk +0 -2
@@ -13,8 +13,6 @@ OPENCV_LICENSE_FILES = LICENSE # OpenCV component options OPENCV_CONF_OPTS += \ -DBUILD_WITH_DEBUG_INFO=OFF \ - -DBUILD_DOCS=OFF \ - -DBUILD_EXAMPLES=OFF \ -DBUILD_PERF_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_PERF_TESTS),ON,OFF) \ -DBUILD_TESTS=$(if $(BR2_PACKAGE_OPENCV_BUILD_TESTS),ON,OFF)
Signature · 1 line
2.1.2
PATCH 14/15 package/polarssl: cleanup configure options
In reply to Samuel MartinTest build is already disabled by the cmake-package infrastructure.
--- package/polarssl/polarssl.mk | 1 - 1 file changed, 1 deletion(-)
package/polarssl/polarssl.mk +0 -1
@@ -8,7 +8,6 @@ POLARSSL_SITE = https://polarssl.org/code/releases POLARSSL_VERSION = 1.2.11 POLARSSL_SOURCE = polarssl-$(POLARSSL_VERSION)-gpl.tgz POLARSSL_CONF_OPTS = \ - -DBUILD_TESTS=OFF \ -DENABLE_PROGRAMS=$(if $(BR2_PACKAGE_POLARSSL_PROGRAMS),ON,OFF) POLARSSL_INSTALL_STAGING = YES
Signature · 1 line
2.1.2
PATCH 15/15 docs/manual: update cmake-package infrastructure section
In reply to Samuel MartinThis patch documents the CMake options preset by the cmake-package infrastructure.
--- docs/manual/adding-packages-cmake.txt | 10 ++++++++++ 1 file changed, 10 insertions(+)
docs/manual/adding-packages-cmake.txt +10 -0
@@ -96,6 +96,16 @@ typical packages will therefore only use a few of them. * +LIBFOO_CONF_OPTS+, to specify additional configure options to pass to CMake. By default, empty. + A number of common CMake options are set by the +cmake-package+ + infrastructure; so it should not be necessary to set them in the + package's +*.mk+ file unless you want to override them: + +** +CMAKE_BUILD_TYPE+ is driven by +BR2_ENABLE_DEBUG+; +** +CMAKE_INSTALL_PREFIX+; +** +BUILD_SHARED_LIBS+ is driven by +BR2_PREFER_STATIC_LIBS+; +** +BUILD_DOC+, +BUILD_DOCS+ are disabled; +** +BUILD_EXAMPLE+, +BUILD_EXAMPLES+ are disabled; +** +BUILD_TEST+, +BUILD_TESTS+, +BUILD_TESTING+ are disabled. * +LIBFOO_MAKE+, to specify an alternate +make+ command. This is typically useful when parallel make is enabled in the configuration
Signature · 1 line
2.1.2
cover CMake janitor
In reply to Samuel MartinDear Samuel Martin,
Quoted 6 lines · Samuel Martin
Samuel Martin (15):
package/pkg-cmake.mk: globally disable doc, examples and testspackage/pkg-cmake.mk: disable colouring the output package/clapack: cleanup configure options package/flann: cleanup configure options package/libsoxr: cleanup configure options
All applied.
Quoted 1 line
package/libsoxr: cleanup configure options
Applied after removing the entire BUILD_SHARED_LIBS option.
Quoted 5 lines
package/libubox: cleanup dependencies
package/libubox: cleanup configure options
package/libubox: cleanup configure options
package/libuci: cleanup configure options
package/libuci: cleanup configure options
All applied.
Quoted 1 line
package/ne10: cleanup configure options
Rejected, as it doesn't make sense: the ne10 option to disable shared libraries is specific, and is not the one passed by the CMake package infra.
Quoted 3 lines
package/opencv: cleanup configure options package/polarssl: cleanup configure options docs/manual: update cmake-package infrastructure section
All applied.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com