Notes |
|
(0027012)
|
Alex Neundorf
|
2011-07-06 12:04
|
|
That's a weakness of pkg-config, if you want to use it in cmake basically you have to deal with it.
What I usually recommend:
use the results of pkg-config as HINTS to find_path() and find_library(), so if pkg-config has found the package, the dirs it reported will be checked first by find_library() and find_path(). If pkg-config has not found the package, cmake may still find it.
This also makes sure that the cmake code will also work on systems without pkg-config or where it is not properly set up.
I.e. something like:
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_LIBXML libxml-2.0 QUIET)
SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h
HINTS
${PC_LIBXML_INCLUDEDIR}
${PC_LIBXML_INCLUDE_DIRS}
PATH_SUFFIXES libxml2
)
FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
HINTS
${PC_LIBXML_LIBDIR}
${PC_LIBXML_LIBRARY_DIRS}
)
|
|
|
(0030275)
|
David Cole
|
2012-08-11 11:38
|
|
Sending old, never assigned issues to the backlog.
(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)
If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]
It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
|
|
|
(0039408)
|
Dan Kegel
|
2015-09-11 18:06
(edited on: 2015-09-11 18:07) |
|
You have to fix the list separator. It's rather painful. e.g.:
pkg_check_modules(GSTREAMER gstreamer-1.0)
# Ah, cmake, gotta love your list separator.
STRING(REPLACE ";" " " GSTREAMER_CFLAGS_STRING "${GSTREAMER_CFLAGS}")
STRING(REPLACE ";" " " GSTREAMER_LDFLAGS_STRING "${GSTREAMER_LDFLAGS}")
pkg_check_modules(GSTREAMER_APP REQUIRED gstreamer-app-1.0)
STRING(REPLACE ";" " " GSTREAMER_APP_CFLAGS_STRING "${GSTREAMER_APP_CFLAGS}")
STRING(REPLACE ";" " " GSTREAMER_APP_LDFLAGS_STRING "${GSTREAMER_APP_LDFLAGS}")
...
That undoes some of the brain damage. Woe until you if a library has a space in a filename, though!
|
|
|
(0041857)
|
Kitware Robot
|
2016-06-10 14:28
|
|
Resolving issue as `moved`.
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
|