Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 6632] New: CMake use host pkg-config
@ 2013-10-30  9:46 bugzilla at busybox.net
  2013-10-30 10:03 ` [Buildroot] [Bug 6632] " bugzilla at busybox.net
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2013-10-30  9:46 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=6632

           Summary: CMake use host pkg-config
           Product: buildroot
           Version: 2013.02
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
        AssignedTo: unassigned at buildroot.uclibc.org
        ReportedBy: damien at zeetim.com
                CC: buildroot at uclibc.org
   Estimated Hours: 0.0


Dear All,

I try to add cairo-dock in buildroot but I have a problem with CMAKE based
package.

When I try to compile a CMAKE based package, cmake use the /usr/bin/pkg-config
instead of the one compiled by buildroot.
So pkg-config look for package on host and not in buildroot directory.

Is there any solution to force cmake to use the correct pkg-config and find
dependencies ?

Best regards

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 6632] CMake use host pkg-config
  2013-10-30  9:46 [Buildroot] [Bug 6632] New: CMake use host pkg-config bugzilla at busybox.net
@ 2013-10-30 10:03 ` bugzilla at busybox.net
  2013-10-30 10:11 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2013-10-30 10:03 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=6632

--- Comment #1 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2013-10-30 10:03:33 UTC ---
1/ Make sure your package depends on 'host-pkgconf', by doing something like
<pkg>_DEPENDENCIES = host-pkgconf

2/ Make sure your package uses the cmake-package infrastructure, as described
at
http://buildroot.org/downloads/manual/manual.html#_infrastructure_for_cmake_based_packages.
This will ensure that the directory where our cross pkg-config is installed is
in the PATH, and before /usr/bin where the native pkg-config is.

Let us know if that fixes the problem for you.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 6632] CMake use host pkg-config
  2013-10-30  9:46 [Buildroot] [Bug 6632] New: CMake use host pkg-config bugzilla at busybox.net
  2013-10-30 10:03 ` [Buildroot] [Bug 6632] " bugzilla at busybox.net
@ 2013-10-30 10:11 ` bugzilla at busybox.net
  2013-10-30 10:29 ` bugzilla at busybox.net
  2013-10-30 10:58 ` bugzilla at busybox.net
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2013-10-30 10:11 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=6632

--- Comment #2 from Damien <damien@zeetim.com> 2013-10-30 10:11:43 UTC ---
Created attachment 5108
  --> https://bugs.busybox.net/attachment.cgi?id=5108
cairo-dock.mk

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 6632] CMake use host pkg-config
  2013-10-30  9:46 [Buildroot] [Bug 6632] New: CMake use host pkg-config bugzilla at busybox.net
  2013-10-30 10:03 ` [Buildroot] [Bug 6632] " bugzilla at busybox.net
  2013-10-30 10:11 ` bugzilla at busybox.net
@ 2013-10-30 10:29 ` bugzilla at busybox.net
  2013-10-30 17:25   ` Arnout Vandecappelle
  2013-10-30 10:58 ` bugzilla at busybox.net
  3 siblings, 1 reply; 6+ messages in thread
From: bugzilla at busybox.net @ 2013-10-30 10:29 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=6632

--- Comment #3 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2013-10-30 10:29:15 UTC ---
What about something like:

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 0e08722..70014b5 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -62,7 +62,7 @@ ifeq ($(5),target)
 define $(2)_CONFIGURE_CMDS
        (cd $$($$(PKG)_BUILDDIR) && \
        rm -f CMakeCache.txt && \
-       $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
+       $(TARGET_MAKE_ENV) $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake
$$($$(PKG)_SRCDIR) \
               
-DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
                -DCMAKE_INSTALL_PREFIX="/usr" \
                $$($$(PKG)_CONF_OPT) \
@@ -74,7 +74,7 @@ else
 define $(2)_CONFIGURE_CMDS
        (cd $$($$(PKG)_BUILDDIR) && \
        rm -f CMakeCache.txt && \
-       $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
+       $(HOST_MAKE_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
                -DCMAKE_INSTALL_SO_NO_EXE=0 \
                -DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
                -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 6632] CMake use host pkg-config
  2013-10-30  9:46 [Buildroot] [Bug 6632] New: CMake use host pkg-config bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2013-10-30 10:29 ` bugzilla at busybox.net
@ 2013-10-30 10:58 ` bugzilla at busybox.net
  3 siblings, 0 replies; 6+ messages in thread
From: bugzilla at busybox.net @ 2013-10-30 10:58 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=6632

Damien <damien@zeetim.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Damien <damien@zeetim.com> 2013-10-30 10:58:28 UTC ---
thanks a lot, it's work with your patch.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [Bug 6632] CMake use host pkg-config
  2013-10-30 10:29 ` bugzilla at busybox.net
@ 2013-10-30 17:25   ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2013-10-30 17:25 UTC (permalink / raw)
  To: buildroot

  Hi Thomas,

On 30/10/13 11:29, bugzilla at busybox.net wrote:
> https://bugs.busybox.net/show_bug.cgi?id=6632
>
> --- Comment #3 from Thomas Petazzoni <thomas.petazzoni@free-electrons.com> 2013-10-30 10:29:15 UTC ---
> What about something like:
>
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index 0e08722..70014b5 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -62,7 +62,7 @@ ifeq ($(5),target)
>   define $(2)_CONFIGURE_CMDS
>          (cd $$($$(PKG)_BUILDDIR) && \
>          rm -f CMakeCache.txt && \
> -       $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> +       $(TARGET_MAKE_ENV) $$($$(PKG)_CONF_ENV) $(HOST_DIR)/usr/bin/cmake
> $$($$(PKG)_SRCDIR) \

  Maybe we should generalize this, and export the elements of 
TARGET_MAKE_ENV for all target goals:

ifeq ($(5),target)
$$($(2)_TARGET_INSTALL_TARGET):         export PATH=$(TARGET_PATH)
$$($(2)_TARGET_INSTALL_STAGING):        export PATH=$(TARGET_PATH)
$$($(2)_TARGET_INSTALL_IMAGES):         export PATH=$(TARGET_PATH)
$$($(2)_TARGET_INSTALL_HOST):           export PATH=$(TARGET_PATH)
$$($(2)_TARGET_BUILD):                  export PATH=$(TARGET_PATH)
$$($(2)_TARGET_CONFIGURE):              export PATH=$(TARGET_PATH)
$$($(2)_TARGET_RSYNC):                  export PATH=$(TARGET_PATH)
$$($(2)_TARGET_RSYNC_SOURCE):           export PATH=$(TARGET_PATH)
$$($(2)_TARGET_PATCH):                  export PATH=$(TARGET_PATH)
$$($(2)_TARGET_EXTRACT):                export PATH=$(TARGET_PATH)
$$($(2)_TARGET_SOURCE):                 export PATH=$(TARGET_PATH)
$$($(2)_TARGET_UNINSTALL):              export PATH=$(TARGET_PATH)
$$($(2)_TARGET_CLEAN):                  export PATH=$(TARGET_PATH)
$$($(2)_TARGET_DIRCLEAN):               export PATH=$(TARGET_PATH)
endif

  And so on for all the other variables. Unfortunately you need a 
separate line for each variable, you can't do something like 'export 
$(TARGET_MAKE_ENV)' on the right-hand side.

  Anyway, it's just an idea, cause it's quite a big change that will 
probably break some things.

  Regards,
  Arnout


>
> -DCMAKE_TOOLCHAIN_FILE="$$(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake" \
>                  -DCMAKE_INSTALL_PREFIX="/usr" \
>                  $$($$(PKG)_CONF_OPT) \
> @@ -74,7 +74,7 @@ else
>   define $(2)_CONFIGURE_CMDS
>          (cd $$($$(PKG)_BUILDDIR) && \
>          rm -f CMakeCache.txt && \
> -       $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
> +       $(HOST_MAKE_ENV) $(HOST_DIR)/usr/bin/cmake $$($$(PKG)_SRCDIR) \
>                  -DCMAKE_INSTALL_SO_NO_EXE=0 \
>                  -DCMAKE_FIND_ROOT_PATH="$$(HOST_DIR)" \
>                  -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="BOTH" \
>


-- 
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-30 17:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-30  9:46 [Buildroot] [Bug 6632] New: CMake use host pkg-config bugzilla at busybox.net
2013-10-30 10:03 ` [Buildroot] [Bug 6632] " bugzilla at busybox.net
2013-10-30 10:11 ` bugzilla at busybox.net
2013-10-30 10:29 ` bugzilla at busybox.net
2013-10-30 17:25   ` Arnout Vandecappelle
2013-10-30 10:58 ` bugzilla at busybox.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox