Skip to contentSkip to conversation

CMake infrastructure refactoring

PATCH Superseded Samuel Martin 5 participants 30 messages Apr 23, 2014 – May 29, 2014

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

cover CMake infrastructure refactoring

Hi all,

Here is a series reviving a couple of patches (pending for a long while in patchwork) about the CMake infrastructure (patch 4/14 and 5/14) and some new ones cleaning up this infrastructure, so some packages as well.

Yours,
Samuel

Samuel Martin (14):
pkg-cmake.mk: replace "echo -en" with printf pkg-cmake.mk: remove unneeded quotes in the generated
toolchainfile.cmake
pkg-cmake.mk: rework toolchainfile.cmake
pkg-cmake.mk: do not hardcode absolute path in toolchainfile.cmake pkg-cmake.mk: enable ccache for cmake packages pkg-cmake.mk: cosmetic changes in the generated toolchainfile.cmake
file
pkg-cmake.mk: set additional variables in toolchainfile.cmake
rpi-userland: cleanup *_CONF_OPT
pkg-cmake.mk: globally disable BUILD_TESTING flag pkg-cmake.mk: globally drive the CMAKE_BUILD_TYPE flag using
BR2_ENABLE_DEBUG
openpowerlink: do not override CMAKE_BUILD_TYPE
opencv: do not override CMAKE_BUILD_TYPE
flann: do not override CMAKE_BUILD_TYPE
qhull: do not override CMAKE_BUILD_TYPE

 package/flann/flann.mk                 |  1 -
 package/opencv/opencv.mk               |  1 -
 package/openpowerlink/openpowerlink.mk |  6 ---
 package/pkg-cmake.mk                   | 80 ++++++++++++++++++++++++++++------
 package/qhull/qhull.mk                 |  1 -
 package/rpi-userland/rpi-userland.mk   |  2 +-
 6 files changed, 67 insertions(+), 24 deletions(-)

--
1.9.2

#1 lore raw

PATCH 1/14 pkg-cmake.mk: replace "echo -en" with printf

Cc Arnout Vandecappelle <[email protected]>

---
changes v1 -> v2
- new patch

---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-cmake.mk +1 -1
index bf3db90..edda14a 100644
@@ -160,7 +160,7 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 	@mkdir -p $(@D)
-	@echo -en "\
+	@printf "\
 	set(CMAKE_SYSTEM_NAME Linux)\n\
 	set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
 	set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
Signature · 1 line
1.9.2
#2 lore raw

PATCH 1/14 pkg-cmake.mk: replace "echo -en" with printf

Quoted 2 lines · Samuel Martin
Cc Arnout Vandecappelle <[email protected]>

Commit message could have been clarified with

printf is POSIX-compliant, echo -e is not.

Still,

Regards,
Arnout

Quoted 22 lines

---
changes v1 -> v2
- new patch

---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-cmake.mk +1 -1
index bf3db90..edda14a 100644
@@ -160,7 +160,7 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 	@mkdir -p $(@D)
-	@echo -en "\
+	@printf "\
 	set(CMAKE_SYSTEM_NAME Linux)\n\
 	set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
 	set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
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
#3 lore raw

PATCH 1/14 pkg-cmake.mk: replace "echo -en" with printf

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle <[email protected]> writes:

Quoted 2 lines · Samuel Martin
Cc Arnout Vandecappelle <[email protected]>

Commit message could have been clarified with

printf is POSIX-compliant, echo -e is not.

Committed with that added, thanks.

It would also be good to get rid of the other instances of this in the tree:

git grep -l 'echo -e'
package/acpid/acpid.mk
package/eudev/S10udev
package/pkg-utils.mk
package/udev/S10udev

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 2/14 pkg-cmake.mk: remove unneeded quotes in the generated toolchainfile.cmake

In reply to Samuel Martin

Since Buildroot does not support space in paths (at least neither in the Buildroot installation location, nor in the output directory).

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/pkg-cmake.mk +3 -3
index edda14a..963a423 100644
@@ -167,10 +167,10 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 	set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
 	set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
 	set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
-	set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
-	set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
+	set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)\n\
+	set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))\n\
 	set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
 	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
 	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
-	set(ENV{PKG_CONFIG_SYSROOT_DIR} \"$(STAGING_DIR)\")\n\
+	set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))\n\
 	" > $@
Signature · 1 line
1.9.2
#5 lore raw

PATCH 2/14 pkg-cmake.mk: remove unneeded quotes in the generated toolchainfile.cmake

Quoted 2 lines · Samuel Martin

Since Buildroot does not support space in paths (at least neither in the Buildroot installation location, nor in the output directory).

But is that sufficient reason to remove the quotes? I think not... We
don't support space in paths because make doesn't, not because we don't _want_ to.

So, NAK for me. Unless there is some other reason why those quotes are
in the way, but since they're still there a couple of lines above (and needed there) it's NAK for me.

Unless you can give a better explanation why you'd prefer no quotes.

Regards,
Arnout

Quoted 29 lines

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/pkg-cmake.mk +3 -3
index edda14a..963a423 100644
@@ -167,10 +167,10 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 	set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
 	set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
 	set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
-	set(CMAKE_PROGRAM_PATH \"$(HOST_DIR)/usr/bin\")\n\
-	set(CMAKE_FIND_ROOT_PATH \"$(STAGING_DIR)\")\n\
+	set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)\n\
+	set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))\n\
 	set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
 	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
 	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
-	set(ENV{PKG_CONFIG_SYSROOT_DIR} \"$(STAGING_DIR)\")\n\
+	set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))\n\
 	" > $@
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
#6 lore raw

PATCH 3/14 pkg-cmake.mk: rework toolchainfile.cmake

In reply to Samuel Martin
Cc Arnout Vandecappelle <[email protected]>

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
package/pkg-cmake.mk +16 -14
index 963a423..af8ecf5 100644
@@ -158,19 +158,21 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 # Generation of the CMake toolchain file
 ################################################################################
 
+define TOOLCHAINFILE_CMAKE
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))
+set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))
+set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
+set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
+set(CMAKE_INSTALL_SO_NO_EXE 0)
+set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)
+set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))
+endef
+
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 	@mkdir -p $(@D)
-	@printf "\
-	set(CMAKE_SYSTEM_NAME Linux)\n\
-	set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
-	set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
-	set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
-	set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
-	set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
-	set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)\n\
-	set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))\n\
-	set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
-	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
-	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
-	set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))\n\
-	" > $@
+	@printf '$(subst $(sep),\n,$(TOOLCHAINFILE_CMAKE))' > $@
Signature · 1 line
1.9.2
#7 lore raw

PATCH 3/14 pkg-cmake.mk: rework toolchainfile.cmake

Quoted 2 lines · Samuel Martin
Cc Arnout Vandecappelle <[email protected]>

More explicit commit log:

By putting the content of toolchainfile.cmake in a separate define, we can remove a lot of the quoting and it becomes much more similar to the resulting file.

Otherwise, looks good to me except for the quoting.

Quoted 13 lines

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)
package/pkg-cmake.mk +0 -0
index 963a423..af8ecf5 100644

package/pkg-cmake.mk host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE · line 164

Quoted 7 lines
package/pkg-cmake.mk +4 -0
@@ -158,19 +158,21 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 # Generation of the CMake toolchain file
 ################################################################################
 
+define TOOLCHAINFILE_CMAKE
+set(CMAKE_SYSTEM_NAME Linux)
+set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))
+set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))

Amendment to the comment I made on the previous patch 2/14: the quoting
of these two should of course be consistent with the quoting of PROGRAM_PATH and FIND_ROOT_PATH. So I would say to add quotes.

Regards,
Arnout

Quoted 29 lines
package/pkg-cmake.mk +12 -14
+set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
+set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
+set(CMAKE_INSTALL_SO_NO_EXE 0)
+set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)
+set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))
+endef
+
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
 	@mkdir -p $(@D)
-	@printf "\
-	set(CMAKE_SYSTEM_NAME Linux)\n\
-	set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))\n\
-	set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))\n\
-	set(CMAKE_C_FLAGS \"\$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)\" CACHE STRING \"Buildroot CFLAGS\" FORCE)\n\
-	set(CMAKE_CXX_FLAGS \"\$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)\" CACHE STRING \"Buildroot CXXFLAGS\" FORCE)\n\
-	set(CMAKE_INSTALL_SO_NO_EXE 0)\n\
-	set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)\n\
-	set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))\n\
-	set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
-	set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
-	set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
-	set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))\n\
-	" > $@
+	@printf '$(subst $(sep),\n,$(TOOLCHAINFILE_CMAKE))' > $@
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
#8 lore raw

PATCH 4/14 pkg-cmake.mk: do not hardcode absolute path in toolchainfile.cmake

In reply to Samuel Martin

The patch allows sharing or moving the toolchains.

This is a step toward making the toolchain/sdk relocatable.

Closes #6818

Cc Uwe Strempel <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
changes v1 -> v2:
- rebase
- use CMAKE_CURRENT_LIST_DIR instead of get_filename_component()
- rewrite subst call in a more natural way (Arnout)

---
 package/pkg-cmake.mk | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
package/pkg-cmake.mk +6 -5
index af8ecf5..b2ac2df 100644
@@ -159,18 +159,19 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 ################################################################################
 
 define TOOLCHAINFILE_CMAKE
+string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
 set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))
-set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))
+set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
-set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)
-set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))
+set(CMAKE_PROGRAM_PATH $${_HOST_DIR}/usr/bin)
+set(CMAKE_FIND_ROOT_PATH $${_HOST_DIR}/$(STAGING_SUBDIR))
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))
+set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
 endef
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
Signature · 1 line
1.9.2
#9 lore raw

PATCH 4/14 pkg-cmake.mk: do not hardcode absolute path in toolchainfile.cmake

Quoted 24 lines · Samuel Martin

The patch allows sharing or moving the toolchains.

This is a step toward making the toolchain/sdk relocatable.

Closes #6818

Cc Uwe Strempel <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

---
changes v1 -> v2:
- rebase
- use CMAKE_CURRENT_LIST_DIR instead of get_filename_component()
- rewrite subst call in a more natural way (Arnout)

---
 package/pkg-cmake.mk | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
package/pkg-cmake.mk +0 -0
index af8ecf5..b2ac2df 100644

package/pkg-cmake.mk host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE · line 162

Quoted 4 lines
package/pkg-cmake.mk +1 -0
@@ -159,18 +159,19 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 ################################################################################
 
 define TOOLCHAINFILE_CMAKE
+string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})

_HOST_DIR is not sufficiently explanatory. How about RELOCATED_HOST_DIR?

This could benefit from some explanatory comment (took me some time to
figure it out, at least).

# In order to allow the toolchain to be relocated, we calculated the # HOST_DIR based on this file's location: $(HOST_DIR)/usr/share/buildroot # In all the other variables, HOST_DIR will be replaced by
# RELOCATED_HOST_DIR

package/pkg-cmake.mk host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE · line 164

Quoted 4 lines
package/pkg-cmake.mk +1 -2
 set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_C_COMPILER $(TARGET_CC_NOCCACHE))
-set(CMAKE_CXX_COMPILER $(TARGET_CXX_NOCCACHE))
+set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)

Why is this using $(TARGET_CROSS)gcc instead of the original
$(TARGET_CC_NOCACHE) ?

Regards,
Arnout

Quoted 17 lines
package/pkg-cmake.mk +4 -3
+set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
-set(CMAKE_PROGRAM_PATH $(HOST_DIR)/usr/bin)
-set(CMAKE_FIND_ROOT_PATH $(STAGING_DIR))
+set(CMAKE_PROGRAM_PATH $${_HOST_DIR}/usr/bin)
+set(CMAKE_FIND_ROOT_PATH $${_HOST_DIR}/$(STAGING_SUBDIR))
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-set(ENV{PKG_CONFIG_SYSROOT_DIR} $(STAGING_DIR))
+set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
 endef
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
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
#10 lore raw

PATCH 5/14 pkg-cmake.mk: enable ccache for cmake packages

In reply to Samuel Martin

This patch updates the generated toolchainfile.cmake to use ccache.

When toolchainfile.cmake is used inside Buildroot, using ccache during the build is driven by a CMake knob: USE_CCACHE, automatically set by the cmake-package infrastructure and reflecting the BR2_CCACHE value.

Since this toolchainefile.cmake file can be used outside Buildroot, and this file also set a couple of things (among these: the sysroot cflag, some pkg-config environment variables), it is important to set the compiler variables as well to keep the consistency of the cross-compilation configuration.
So, when it is used outside Buildroot, using ccache for the build is driven by the ccache program availability.

Note that using ccache for the build is achieved by setting the *_ARG1 CMake variables to let CMake use ccache without failing in detecting the compiler.

---
changes v2 -> v3 (Samuel):
- rebase
- inline the -DUSE_CCACHE=... in the configure commands.
- always set the compiler variables, even when called for outside Buildroot.
- update commit message

changes v1 -> v2 (Luca):
- totally reimplemented based on Samuel's suggestion;
- added dependency on host-ccache for cmake packages if ccache is enabled.

---
 package/pkg-cmake.mk | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
package/pkg-cmake.mk +33 -2
index b2ac2df..a032426 100644
@@ -66,6 +66,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_SHARED_LIBS=$(if $(BR2_PREFER_STATIC_LIB),OFF,ON) \
+		-DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
 		$$($$(PKG)_CONF_OPT) \
 	)
 endef
@@ -83,6 +84,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
 		-DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
+		-DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
 		$$($$(PKG)_CONF_OPT) \
 	)
 endef
@@ -161,8 +163,6 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 define TOOLCHAINFILE_CMAKE
 string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
 set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
-set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
@@ -172,6 +172,37 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
+# This toolchain file can be used both inside and outside Buildroot.
+# * When used inside Buildroot, ccache support is explicitly driven using the
+#   USE_CCACHE variable.
+# * When used outside Buildroot (i.e. when USE_CCACHE is not defined), ccache
+#   support is automatically enabled if the ccache program is available.
+if(DEFINED USE_CCACHE)
+	if(USE_CCACHE)
+		set(CMAKE_ASM_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_C_COMPILER $${_HOST_DIR}/usr/bin/ccache)
+		set(CMAKE_CXX_COMPILER $${_HOST_DIR}/usr/bin/ccache)
+		set(CMAKE_C_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+	else()
+		set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+	endif()
+else()
+	find_program(CCACHE ccache)
+	if(CCACHE)
+		set(CMAKE_ASM_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_C_COMPILER $${CCACHE})
+		set(CMAKE_CXX_COMPILER $${CCACHE})
+		set(CMAKE_C_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+		message(STATUS "ccache program has been found and will be used for the build.")
+		message(STATUS "  To disable ccache, add -DUSE_CCACHE=OFF on the cmake command line.")
+	else()
+		set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+	endif()
+endif()
 endef
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
Signature · 1 line
1.9.2
#11 lore raw

PATCH 5/14 pkg-cmake.mk: enable ccache for cmake packages

Quoted 6 lines · Samuel Martin

This patch updates the generated toolchainfile.cmake to use ccache.

When toolchainfile.cmake is used inside Buildroot, using ccache during the build is driven by a CMake knob: USE_CCACHE, automatically set by the cmake-package infrastructure and reflecting the BR2_CCACHE value.

Quoted 7 lines

Since this toolchainefile.cmake file can be used outside Buildroot, and this file also set a couple of things (among these: the sysroot cflag, some pkg-config environment variables), it is important to set the compiler variables as well to keep the consistency of the cross-compilation configuration.
So, when it is used outside Buildroot, using ccache for the build is driven by the ccache program availability.

I don't understand this. We can just use br-ccache when it's called from
outside buildroot as well, no?

Quoted 64 lines

Note that using ccache for the build is achieved by setting the *_ARG1 CMake variables to let CMake use ccache without failing in detecting the compiler.

---
changes v2 -> v3 (Samuel):
- rebase
- inline the -DUSE_CCACHE=... in the configure commands.
- always set the compiler variables, even when called for outside Buildroot.
- update commit message

changes v1 -> v2 (Luca):
- totally reimplemented based on Samuel's suggestion;
- added dependency on host-ccache for cmake packages if ccache is enabled.

---
 package/pkg-cmake.mk | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
package/pkg-cmake.mk +8 -2
index b2ac2df..a032426 100644
@@ -66,6 +66,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_SHARED_LIBS=$(if $(BR2_PREFER_STATIC_LIB),OFF,ON) \
+		-DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
 		$$($$(PKG)_CONF_OPT) \
 	)
 endef
@@ -83,6 +84,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
 		-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
 		-DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
+		-DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
 		$$($$(PKG)_CONF_OPT) \
 	)
 endef
@@ -161,8 +163,6 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 define TOOLCHAINFILE_CMAKE
 string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
 set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
-set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
@@ -172,6 +172,37 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
+# This toolchain file can be used both inside and outside Buildroot.
+# * When used inside Buildroot, ccache support is explicitly driven using the
+#   USE_CCACHE variable.
+# * When used outside Buildroot (i.e. when USE_CCACHE is not defined), ccache
+#   support is automatically enabled if the ccache program is available.
+if(DEFINED USE_CCACHE)

package/pkg-cmake.mk set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) · line 190

Quoted 10 lines
package/pkg-cmake.mk +10 -0
+	if(USE_CCACHE)
+		set(CMAKE_ASM_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_C_COMPILER $${_HOST_DIR}/usr/bin/ccache)
+		set(CMAKE_CXX_COMPILER $${_HOST_DIR}/usr/bin/ccache)
+		set(CMAKE_C_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+	else()
+		set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+	endif()

I don't see why this USE_CCACHE condition should be dynamic. If
BR2_CCACHE is set, then we can _always_ use ccache, no? So:

ifeq($(BR2_CCACHE),y)
define TOOLCHAINFILE_CMAKE_CCACHE set(CMAKE_C_COMPILER $${_HOST_DIR}/usr/bin/ccache) set(CMAKE_CXX_COMPILER $${_HOST_DIR}/usr/bin/ccache)
...
endef
else # BR2_CCACHE
define TOOLCHAINFILE_CMAKE_CCACHE
...
endef
endif

package/pkg-cmake.mk set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) · line 192

Quoted 2 lines
package/pkg-cmake.mk +2 -0
+else()
+	find_program(CCACHE ccache)

Note that if we don't set PATH explicitly to point to the host dir, this
will point to the system's ccache instead of buildroot ccache.

Regards,
Arnout

Quoted 17 lines
package/pkg-cmake.mk +13 -0
+	if(CCACHE)
+		set(CMAKE_ASM_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_C_COMPILER $${CCACHE})
+		set(CMAKE_CXX_COMPILER $${CCACHE})
+		set(CMAKE_C_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+		message(STATUS "ccache program has been found and will be used for the build.")
+		message(STATUS "  To disable ccache, add -DUSE_CCACHE=OFF on the cmake command line.")
+	else()
+		set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+		set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+	endif()
+endif()
 endef
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
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
#12 lore raw

PATCH 5/14 pkg-cmake.mk: enable ccache for cmake packages

Arnout, all,

Quoted 15 lines · Arnout Vandecappelle
Quoted 6 lines · Samuel Martin

This patch updates the generated toolchainfile.cmake to use ccache.

When toolchainfile.cmake is used inside Buildroot, using ccache during the build is driven by a CMake knob: USE_CCACHE, automatically set by the cmake-package infrastructure and reflecting the BR2_CCACHE value.

Quoted 7 lines

Since this toolchainefile.cmake file can be used outside Buildroot, and this file also set a couple of things (among these: the sysroot cflag, some pkg-config environment variables), it is important to set the compiler variables as well to keep the consistency of the cross-compilation configuration.
So, when it is used outside Buildroot, using ccache for the build is driven by the ccache program availability.

Quoted 2 lines

I don't understand this. We can just use br-ccache when it's called from
outside buildroot as well, no?

One may want to use ccache in Buildroot to build its rootfs, but not when building its project.
Does this use-case make sense?

Quoted 80 lines
Quoted 66 lines

Note that using ccache for the build is achieved by setting the *_ARG1/cc CMake variables to let CMake use ccache without failing in detecting the compiler.

---
changes v2 -> v3 (Samuel):
- rebase
- inline the -DUSE_CCACHE=... in the configure commands.
- always set the compiler variables, even when called for outside Buildroot.
- update commit message

changes v1 -> v2 (Luca):
- totally reimplemented based on Samuel's suggestion;
- added dependency on host-ccache for cmake packages if ccache is enabled.

---
 package/pkg-cmake.mk | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)
package/pkg-cmake.mk +8 -2
index b2ac2df..a032426 100644
@@ -66,6 +66,7 @@ define $(2)_CONFIGURE_CMDS
              -DCMAKE_INSTALL_PREFIX="/usr" \
              -DCMAKE_COLOR_MAKEFILE=OFF \
              -DBUILD_SHARED_LIBS=$(if $(BR2_PREFER_STATIC_LIB),OFF,ON) \
+             -DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
              $$($$(PKG)_CONF_OPT) \
      )
 endef
@@ -83,6 +84,7 @@ define $(2)_CONFIGURE_CMDS
              -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY="BOTH" \
              -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="BOTH" \
              -DCMAKE_INSTALL_PREFIX="$$(HOST_DIR)/usr" \
+             -DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
              $$($$(PKG)_CONF_OPT) \
      )
 endef
@@ -161,8 +163,6 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 define TOOLCHAINFILE_CMAKE
 string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
 set(CMAKE_SYSTEM_NAME Linux)
-set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
-set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
@@ -172,6 +172,37 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
+# This toolchain file can be used both inside and outside Buildroot.
+# * When used inside Buildroot, ccache support is explicitly driven using the
+#   USE_CCACHE variable.
+# * When used outside Buildroot (i.e. when USE_CCACHE is not defined), ccache
+#   support is automatically enabled if the ccache program is available.
+if(DEFINED USE_CCACHE)

package/pkg-cmake.mk set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) · line 190

Quoted 10 lines
package/pkg-cmake.mk +10 -0
+     if(USE_CCACHE)
+             set(CMAKE_ASM_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+             set(CMAKE_C_COMPILER $${_HOST_DIR}/usr/bin/ccache)
+             set(CMAKE_CXX_COMPILER $${_HOST_DIR}/usr/bin/ccache)
+             set(CMAKE_C_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+             set(CMAKE_CXX_COMPILER_ARG1 $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+     else()
+             set(CMAKE_C_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))gcc)
+             set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
+     endif()

I don't see why this USE_CCACHE condition should be dynamic. If
BR2_CCACHE is set, then we can _always_ use ccache, no? So:

Quoted 12 lines

ifeq($(BR2_CCACHE),y)
define TOOLCHAINFILE_CMAKE_CCACHE set(CMAKE_C_COMPILER $${_HOST_DIR}/usr/bin/ccache) set(CMAKE_CXX_COMPILER $${_HOST_DIR}/usr/bin/ccache)
...
endef
else # BR2_CCACHE
define TOOLCHAINFILE_CMAKE_CCACHE
...
endef
endif

The idea behind this is to always get the same toolchainfile.cmake generated (except for the target tuple).
In the end we could also use a toolchainfile.cmake.in file, then just replace the '$(TARGET_CROSS)' using sed.

Quoted 6 lines

package/pkg-cmake.mk set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) · line 192

Quoted 3 lines
package/pkg-cmake.mk +2 -0
+else()
+     find_program(CCACHE ccache)

Note that if we don't set PATH explicitly to point to the host dir, this
will point to the system's ccache instead of buildroot ccache.

Right, good catch!
I see 2 ways to solve this:
- extend PATH env. var., but this will be valib for all others programs;
- use the HINTS or PATHS option of find_program().
Funnily, when ccache is available in the system:
- using find_program(CCACHE ccache HINTS $${_HOST_DIR}/usr/bin) will
find set CCACHE to $${_HOST_DIR}/usr/bin/ccache;
- whereas find_program(CCACHE ccache PATHS $${_HOST_DIR}/usr/bin)
will find set CCACHE to /usr/bin/ccache

I'll use find_program(... HINTS ...)

Regards,

Signature · 1 line
Samuel
#13 lore raw

PATCH 6/14 pkg-cmake.mk: cosmetic changes in the generated toolchainfile.cmake file

In reply to Samuel Martin

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-cmake.mk +8 -0
index a032426..19f7843 100644
@@ -161,17 +161,25 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 ################################################################################
 
 define TOOLCHAINFILE_CMAKE
+#
+# Automatically generated file; DO NOT EDIT.
+# CMake toolchain file for Buildroot
+#
+
 string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
+
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
+
 set(CMAKE_PROGRAM_PATH $${_HOST_DIR}/usr/bin)
 set(CMAKE_FIND_ROOT_PATH $${_HOST_DIR}/$(STAGING_SUBDIR))
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
+
 # This toolchain file can be used both inside and outside Buildroot.
 # * When used inside Buildroot, ccache support is explicitly driven using the
 #   USE_CCACHE variable.
Signature · 1 line
1.9.2
#14 lore raw

PATCH 6/14 pkg-cmake.mk: cosmetic changes in the generated toolchainfile.cmake file

Hi Samuel,

Quoted 29 lines · Samuel Martin

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-cmake.mk +7 -0
index a032426..19f7843 100644
@@ -161,17 +161,25 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 ################################################################################
 
 define TOOLCHAINFILE_CMAKE
+#
+# Automatically generated file; DO NOT EDIT.
+# CMake toolchain file for Buildroot
+#
+
 string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
+
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
+

package/pkg-cmake.mk host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE · line 185

Quoted 10 lines
package/pkg-cmake.mk +1 -0
 set(CMAKE_PROGRAM_PATH $${_HOST_DIR}/usr/bin)
 set(CMAKE_FIND_ROOT_PATH $${_HOST_DIR}/$(STAGING_SUBDIR))
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
+
 # This toolchain file can be used both inside and outside Buildroot.
 # * When used inside Buildroot, ccache support is explicitly driven using the
 #   USE_CCACHE variable.

Shouldn't this be squashed into patch #3?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#15 lore raw

PATCH 6/14 pkg-cmake.mk: cosmetic changes in the generated toolchainfile.cmake file

Baruch, all,

Quoted 36 lines · Baruch Siach

Hi Samuel,

Quoted 33 lines · Samuel Martin

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-cmake.mk +7 -0
index a032426..19f7843 100644
@@ -161,17 +161,25 @@ host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE
 ################################################################################
 
 define TOOLCHAINFILE_CMAKE
+#
+# Automatically generated file; DO NOT EDIT.
+# CMake toolchain file for Buildroot
+#
+
 string(REPLACE /usr/share/buildroot "" _HOST_DIR $${CMAKE_CURRENT_LIST_DIR})
+
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_C_FLAGS "$${CMAKE_C_FLAGS} $(TARGET_CFLAGS)" CACHE STRING "Buildroot CFLAGS" FORCE)
 set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} $(TARGET_CXXFLAGS)" CACHE STRING "Buildroot CXXFLAGS" FORCE)
 set(CMAKE_INSTALL_SO_NO_EXE 0)
+
 set(CMAKE_PROGRAM_PATH $${_HOST_DIR}/usr/bin)
 set(CMAKE_FIND_ROOT_PATH $${_HOST_DIR}/$(STAGING_SUBDIR))
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Quoted 8 lines

package/pkg-cmake.mk host-cmake-package = $(call inner-cmake-package,host-$(pkgname),$(call UPPERCASE · line 185

Quoted 6 lines
package/pkg-cmake.mk +1 -0
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} $${_HOST_DIR}/$(STAGING_SUBDIR))
+
 # This toolchain file can be used both inside and outside Buildroot.
 # * When used inside Buildroot, ccache support is explicitly driven using the
 #   USE_CCACHE variable.

Shouldn't this be squashed into patch #3?

Will do.

Regards,

Signature · 1 line
Samuel
#16 lore raw

PATCH 7/14 pkg-cmake.mk: set additional variables in toolchainfile.cmake

In reply to Samuel Martin

Set binutils programs CMake variables in the toolchainfile.cmake file.

This variables must be cached, otherwise they are wrongly set, resulting empty, which will make the builds fail.

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-cmake.mk +8 -0
index 19f7843..d6dadbe 100644
@@ -211,6 +211,14 @@ else()
 		set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 	endif()
 endif()
+
+set(CMAKE_LINKER  $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))ld      CACHE FILEPATH \"\" FORCE)
+set(CMAKE_AR      $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))ar      CACHE FILEPATH \"\" FORCE)
+set(CMAKE_RANLIB  $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))ranlib  CACHE FILEPATH \"\" FORCE)
+set(CMAKE_NM      $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))nm      CACHE FILEPATH \"\" FORCE)
+set(CMAKE_OBJCOPY $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))objcopy CACHE FILEPATH \"\" FORCE)
+set(CMAKE_OBJDUMP $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))objdump CACHE FILEPATH \"\" FORCE)
+set(CMAKE_STRIP   $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))strip   CACHE FILEPATH \"\" FORCE)
 endef
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
Signature · 1 line
1.9.2
#17 lore raw

PATCH 7/14 pkg-cmake.mk: set additional variables in toolchainfile.cmake

Quoted 4 lines · Samuel Martin

Set binutils programs CMake variables in the toolchainfile.cmake file.

This variables must be cached, otherwise they are wrongly set, resulting empty, which will make the builds fail.

Can you point to a specific build failure?

Regards,
Arnout

Quoted 30 lines

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/pkg-cmake.mk +8 -0
index 19f7843..d6dadbe 100644
@@ -211,6 +211,14 @@ else()
 		set(CMAKE_CXX_COMPILER $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))g++)
 	endif()
 endif()
+
+set(CMAKE_LINKER  $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))ld      CACHE FILEPATH \"\" FORCE)
+set(CMAKE_AR      $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))ar      CACHE FILEPATH \"\" FORCE)
+set(CMAKE_RANLIB  $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))ranlib  CACHE FILEPATH \"\" FORCE)
+set(CMAKE_NM      $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))nm      CACHE FILEPATH \"\" FORCE)
+set(CMAKE_OBJCOPY $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))objcopy CACHE FILEPATH \"\" FORCE)
+set(CMAKE_OBJDUMP $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))objdump CACHE FILEPATH \"\" FORCE)
+set(CMAKE_STRIP   $(subst $(HOST_DIR),$${_HOST_DIR},$(TARGET_CROSS))strip   CACHE FILEPATH \"\" FORCE)
 endef
 
 $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
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
#18 lore raw

PATCH 7/14 pkg-cmake.mk: set additional variables in toolchainfile.cmake

Arnout, all,

Quoted 7 lines · Arnout Vandecappelle
Quoted 4 lines · Samuel Martin

Set binutils programs CMake variables in the toolchainfile.cmake file.

This variables must be cached, otherwise they are wrongly set, resulting empty, which will make the builds fail.

Can you point to a specific build failure?

None.
It is just a use-case I have, but I can workaround some other way. I'll drop this patch.

Regards,

Signature · 1 line
Samuel
#19 lore raw

PATCH 8/14 rpi-userland: cleanup *_CONF_OPT

In reply to Samuel Martin

rpi-userland does not need -DBUILD_SHARED_LIBS=OFF to be passed to correclty build its static libraries; so remove this cmake flag from the configure options.

Cc "Yann E. MORIN" <[email protected]>

---
changes v1 -> v2:
- new patch

---
 package/rpi-userland/rpi-userland.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/rpi-userland/rpi-userland.mk +1 -1
index 7188dcf..bec5d46 100644
@@ -9,7 +9,7 @@ RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION))
 RPI_USERLAND_LICENSE = BSD-3c
 RPI_USERLAND_LICENSE_FILES = LICENCE
 RPI_USERLAND_INSTALL_STAGING = YES
-RPI_USERLAND_CONF_OPT = -DVMCS_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=OFF
+RPI_USERLAND_CONF_OPT = -DVMCS_INSTALL_PREFIX=/usr
 
 define RPI_USERLAND_POST_TARGET_CLEANUP
     rm -Rf $(TARGET_DIR)/usr/src
Signature · 1 line
1.9.2
#20 lore raw

PATCH 9/14 pkg-cmake.mk: globally disable BUILD_TESTING flag

In reply to Samuel Martin

This CMake flag is used to enable tests. It may not disable the test programs from being built, but it controls the test execution.

Since we don't care about building the tests (and usually disable them when possible), make sure Buildroot won't try to run them.

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 1 +
 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +1 -0
index d6dadbe..e0efccb 100644
@@ -65,6 +65,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
+		-DBUILD_TESTING=OFF \
 		-DBUILD_SHARED_LIBS=$(if $(BR2_PREFER_STATIC_LIB),OFF,ON) \
 		-DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
 		$$($$(PKG)_CONF_OPT) \
Signature · 1 line
1.9.2
#21 lore raw

PATCH 9/14 pkg-cmake.mk: globally disable BUILD_TESTING flag

Quoted 20 lines · Samuel Martin

This CMake flag is used to enable tests. It may not disable the test programs from being built, but it controls the test execution.

Since we don't care about building the tests (and usually disable them when possible), make sure Buildroot won't try to run them.

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 1 +
 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +0 -0
index d6dadbe..e0efccb 100644

package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 68

Quoted 4 lines
package/pkg-cmake.mk +1 -0
@@ -65,6 +65,7 @@ define $(2)_CONFIGURE_CMDS
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
+		-DBUILD_TESTING=OFF \

Shouldn't this be done for the host variant as well?

package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 69

Quoted 1 line
package/pkg-cmake.mk +0 -0
 		-DBUILD_SHARED_LIBS=$(if $(BR2_PREFER_STATIC_LIB),OFF,ON) \

Not really related to this patch, but is there a specific reason why
some options are set in the toolchainfile.cmake and some are set on the command line?

Regards,
Arnout

Quoted 3 lines
package/pkg-cmake.mk +0 -0
 		-DUSE_CCACHE=$(if $(BR2_CCACHE),ON,OFF) \
 		$$($$(PKG)_CONF_OPT) \
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
#22 lore raw

PATCH 9/14 pkg-cmake.mk: globally disable BUILD_TESTING flag

Arnout, all,

Quoted 16 lines · Arnout Vandecappelle
Quoted 15 lines · Samuel Martin

This CMake flag is used to enable tests. It may not disable the test programs from being built, but it controls the test execution.

Since we don't care about building the tests (and usually disable them when possible), make sure Buildroot won't try to run them.

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 1 +
 1 file changed, 1 insertion(+)
Quoted 11 lines

package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 68

Quoted 9 lines
package/pkg-cmake.mk +1 -0
index d6dadbe..e0efccb 100644
@@ -65,6 +65,7 @@ define $(2)_CONFIGURE_CMDS
              -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
              -DCMAKE_INSTALL_PREFIX="/usr" \
              -DCMAKE_COLOR_MAKEFILE=OFF \
+             -DBUILD_TESTING=OFF \

Shouldn't this be done for the host variant as well?

Yes. Good catch!

Quoted 6 lines

package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 69

Quoted 2 lines
package/pkg-cmake.mk +0 -0
              -DBUILD_SHARED_LIBS=$(if $(BR2_PREFER_STATIC_LIB),OFF,ON) \

Not really related to this patch, but is there a specific reason why
some options are set in the toolchainfile.cmake and some are set on the command line?

Here is how I see this:
- the toolchainfile.cmake is only about the toolchain/target properties (programs and sysroot location), not about the way one wants to build a project.
- the options on the command line describe how one want to build its project, enabling the build of this or that sub-project, toggling tests, if the binaries should include debug symbols, and so on and so forth.

To me, it's kind of similar rules applied to choose between the 'select'-'depends on' statements (and the need of comments) in the Config.in files.

Regards,

Signature · 1 line
Samuel
#23 lore raw

PATCH 10/14 pkg-cmake.mk: globally drive the CMAKE_BUILD_TYPE flag using BR2_ENABLE_DEBUG

In reply to Samuel Martin

This CMake flag is usually used to adjust compiler flags (like: -Ox, -g, etc).

So, it makes sense for Buildroot to globally drive this CMake flags in the cmake-package infrastructure.

However, if a package prefer overriding this default setting, it still can via the <PKG>_CONF_OPT variable.

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 1 +
 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +1 -0
index e0efccb..1c52a53 100644
@@ -63,6 +63,7 @@ define $(2)_CONFIGURE_CMDS
 	PATH=$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
+		-DCMAKE_BUILD_TYPE=$(if $(BR2_ENABLE_DEBUG),Debug,Release) \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_TESTING=OFF \
Signature · 1 line
1.9.2
#24 lore raw

PATCH 10/14 pkg-cmake.mk: globally drive the CMAKE_BUILD_TYPE flag using BR2_ENABLE_DEBUG

Quoted 10 lines · Samuel Martin

This CMake flag is usually used to adjust compiler flags (like: -Ox, -g, etc).

So, it makes sense for Buildroot to globally drive this CMake flags in the cmake-package infrastructure.

However, if a package prefer overriding this default setting, it still can via the <PKG>_CONF_OPT variable.

Regards,
Arnout

Quoted 21 lines

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 1 +
 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +1 -0
index e0efccb..1c52a53 100644
@@ -63,6 +63,7 @@ define $(2)_CONFIGURE_CMDS
 	PATH=$(BR_PATH) \
 	$$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
 		-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
+		-DCMAKE_BUILD_TYPE=$(if $(BR2_ENABLE_DEBUG),Debug,Release) \
 		-DCMAKE_INSTALL_PREFIX="/usr" \
 		-DCMAKE_COLOR_MAKEFILE=OFF \
 		-DBUILD_TESTING=OFF \
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
#25 lore raw

PATCH 10/14 pkg-cmake.mk: globally drive the CMAKE_BUILD_TYPE flag using BR2_ENABLE_DEBUG

Hi all,

Quoted 52 lines · Arnout Vandecappelle
Quoted 10 lines · Samuel Martin

This CMake flag is usually used to adjust compiler flags (like: -Ox, -g, etc).

So, it makes sense for Buildroot to globally drive this CMake flags in the cmake-package infrastructure.

However, if a package prefer overriding this default setting, it still can via the <PKG>_CONF_OPT variable.

Regards,
Arnout

Quoted 14 lines

---
changes v1 -> v2:
- new patch

---
 package/pkg-cmake.mk | 1 +
 1 file changed, 1 insertion(+)
package/pkg-cmake.mk +0 -0
index e0efccb..1c52a53 100644

package/pkg-cmake.mk define $(2)_CONFIGURE_CMDS · line 69

Quoted 7 lines
package/pkg-cmake.mk +1 -0
@@ -63,6 +63,7 @@ define $(2)_CONFIGURE_CMDS
      PATH=$(BR_PATH) \
      $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
              -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
+             -DCMAKE_BUILD_TYPE=$(if $(BR2_ENABLE_DEBUG),Debug,Release) \
              -DCMAKE_INSTALL_PREFIX="/usr" \
              -DCMAKE_COLOR_MAKEFILE=OFF \
              -DBUILD_TESTING=OFF \

--

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

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#26 lore raw

PATCH 11/14 openpowerlink: do not override CMAKE_BUILD_TYPE

In reply to Samuel Martin

This flag is already correctly set by the cmake-package infrastructure.

---
changes v1 -> v2:
- new patch

---
 package/openpowerlink/openpowerlink.mk | 6 ------
 1 file changed, 6 deletions(-)
package/openpowerlink/openpowerlink.mk +0 -6
index 37a06e5..db3ac74 100644
@@ -26,12 +26,6 @@ OPENPOWERLINK_CONF_OPT = -DCMAKE_SYSTEM_PROCESSOR=$(OPENPOWERLINK_ARCH)
 # so force static lib to build libpowerlink.a
 OPENPOWERLINK_CONF_OPT += -DBUILD_SHARED_LIBS=OFF
 
-ifeq ($(BR2_ENABLE_DEBUG),y)
-OPENPOWERLINK_CONF_OPT += -DCMAKE_BUILD_TYPE=Debug
-else
-OPENPOWERLINK_CONF_OPT += -DCMAKE_BUILD_TYPE=Release
-endif
-
 OPENPOWERLINK_CONF_OPT += -DCFG_DEBUG_LVL=$(call qstrip,$(BR2_PACKAGE_OPENPOWERLINK_DEBUG_LEVEL))
 
 ifeq ($(BR2_PACKAGE_OPENPOWERLINK_LIBPCAP),y)
Signature · 1 line
1.9.2
#27 lore raw

PATCH 12/14 opencv: do not override CMAKE_BUILD_TYPE

In reply to Samuel Martin

This flag is already correctly set by the cmake-package infrastructure.

---
changes v1 -> v2:
- new patch

---
 package/opencv/opencv.mk | 1 -
 1 file changed, 1 deletion(-)
package/opencv/opencv.mk +0 -1
index 42f9b0a..3fcba80 100644
@@ -10,7 +10,6 @@ OPENCV_SOURCE  = OpenCV-$(OPENCV_VERSION).tar.bz2
 OPENCV_INSTALL_STAGING = YES
 
 OPENCV_CONF_OPT += \
-	-DCMAKE_BUILD_TYPE=$(if $(BR2_ENABLE_DEBUG),Debug,Release)   \
 	-DBUILD_WITH_STATIC_CRT=OFF                                  \
 	-DBUILD_DOCS=OFF                                             \
 	-DBUILD_EXAMPLES=OFF                                         \
Signature · 1 line
1.9.2
#28 lore raw

PATCH 13/14 flann: do not override CMAKE_BUILD_TYPE

In reply to Samuel Martin

This flag is already correctly set by the cmake-package infrastructure.

---
changes v1 -> v2:
- new patch

---
 package/flann/flann.mk | 1 -
 1 file changed, 1 deletion(-)
package/flann/flann.mk +0 -1
index 6f95f19..cddd2aa 100644
@@ -10,7 +10,6 @@ FLANN_INSTALL_STAGING = YES
 FLANN_LICENSE = BSD-3c
 FLANN_LICENSE_FILES = COPYING
 FLANN_CONF_OPT = \
-	-DCMAKE_BUILD_TYPE=Release \
 	-DBUILD_C_BINDINGS=ON \
 	-DBUILD_PYTHON_BINDINGS=OFF \
 	-DBUILD_MATLAB_BINDINGS=OFF \
Signature · 1 line
1.9.2
#29 lore raw

PATCH 14/14 qhull: do not override CMAKE_BUILD_TYPE

In reply to Samuel Martin

This flag is already correctly set by the cmake-package infrastructure.

---
changes v1 -> v2:
- new patch

---
 package/qhull/qhull.mk | 1 -
 1 file changed, 1 deletion(-)
package/qhull/qhull.mk +0 -1
index f2bc771..3451775 100644
@@ -9,6 +9,5 @@ QHULL_SITE = git://gitorious.org/qhull/qhull.git
 QHULL_INSTALL_STAGING = YES
 QHULL_LICENSE = BSD-Style
 QHULL_LICENSE_FILES = COPYING.txt
-QHULL_CONF_OPT = -DCMAKE_BUILD_TYPE=Release
 
 $(eval $(cmake-package))
Signature · 1 line
1.9.2