Re: [CMake] telling find_package exactly where to find a package

2009-02-03 Thread Alexander Neundorf
On Friday 30 January 2009, Adolfo Rodríguez wrote:
...
 I have a project with similar requirements as Tyler's, and we effectively
 use the  CMAKE_PREFIX_PATH variable. The thing is that if you ONLY want the
 FindXXX.cmake to look in the paths pointed by CMAKE_PREFIX_PATH, and not
 the standard ones (e.g., /usr, /usr/local, ... on Unix), this might not be
 enough.
 FindBoost.cmake has a very convenient variable named Boost_ROOT that
 specifies where the boost libraries are located. Taking a quick look at the
 FindQt*.cmake doc, I didn't find a similar functionality, but I still
 wonder if it can be achieved in a simple way.


CMake first tries to find qmake and then uses this qmake to gather all the 
other information. So by you can e.g. adjust the PATH env. var before running 
cmake that it will find the qmake you want, or you can set 
QT_QMAKE_EXECUTABLE when running cmake:
cmake -DQT_QMAKE_EXECUTABLE=/opt/qt4/bin/qmake ...

But in general, I also recommend using CMAKE_PREFIX_PATH.

Alex
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] telling find_package exactly where to find a package

2009-01-30 Thread Adolfo Rodríguez
On Fri, Jan 30, 2009 at 7:11 AM, Philip Lowman phi...@yhbt.com wrote:

 On Fri, Jan 30, 2009 at 12:08 AM, Tyler Roscoe ty...@cryptio.net wrote:

 I'll spend some more time reading FindQt4.cmake at work tomorrow, but I
 wanted to post this while I'm thinking about it.

 I would like to tell find_package where my third-party libraries are (Qt
 specifically). Since I know where the libraries are, I could manually
 add paths to INCLUDE_DIRS and LINK_LIBRARIES, but FindQt4 already knows
 how to do all of that so why duplicate the effort?

 This is for an internal build system, so I want to use a specific
 version of Qt installed on a networked filesystem to prevent any
 weirdness caused by a developer compiling against some random Qt that
 she might have on her dev machine.

 This seems like a common situation, so surely there's a CMake way to
 handle it? I was hoping the PATHS parameter would do what I want but
 it's for specifying the path to the FindXXX modules.


 Read the documentation for the find_path() and find_library() commands.
 Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely
 be of tremendous help to you.


I have a project with similar requirements as Tyler's, and we effectively
use the  CMAKE_PREFIX_PATH variable. The thing is that if you ONLY want the
FindXXX.cmake to look in the paths pointed by CMAKE_PREFIX_PATH, and not the
standard ones (e.g., /usr, /usr/local, ... on Unix), this might not be
enough.
FindBoost.cmake has a very convenient variable named Boost_ROOT that
specifies where the boost libraries are located. Taking a quick look at the
FindQt*.cmake doc, I didn't find a similar functionality, but I still wonder
if it can be achieved in a simple way.


A side-comment that is tangentially related to the subject: all of our
custom-made FindXXX.cmake files use the HINTS property of find_path(...) and
find_library(...) (CMake = 2.6).

HTH,

Adolfo Rodríguez Tsouroukdissian


 --
 Philip Lowman

 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] telling find_package exactly where to find a package

2009-01-30 Thread Philip Lowman
On Fri, Jan 30, 2009 at 3:44 AM, Adolfo Rodríguez dof...@gmail.com wrote:

 On Fri, Jan 30, 2009 at 7:11 AM, Philip Lowman phi...@yhbt.com wrote:

 On Fri, Jan 30, 2009 at 12:08 AM, Tyler Roscoe ty...@cryptio.net wrote:

 This seems like a common situation, so surely there's a CMake way to
 handle it? I was hoping the PATHS parameter would do what I want but
 it's for specifying the path to the FindXXX modules.


 Read the documentation for the find_path() and find_library() commands.
 Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely
 be of tremendous help to you.


 I have a project with similar requirements as Tyler's, and we effectively
 use the  CMAKE_PREFIX_PATH variable. The thing is that if you ONLY want the
 FindXXX.cmake to look in the paths pointed by CMAKE_PREFIX_PATH, and not the
 standard ones (e.g., /usr, /usr/local, ... on Unix), this might not be
 enough.
 FindBoost.cmake has a very convenient variable named Boost_ROOT that
 specifies where the boost libraries are located. Taking a quick look at the
 FindQt*.cmake doc, I didn't find a similar functionality, but I still wonder
 if it can be achieved in a simple way.


Sorry to disappoint, but FindBoost suffers from the same issue in that
setting Boost_ROOT doesn't guarantee you won't have libraries picked up in
the system paths.
http://public.kitware.com/Bug/view.php?id=8412

Worse case, if you absolutely can't stand finding stuff outside of X_ROOT
perhaps you can obtain the path of X_LIBRARY with GET_FILENAME_COMPONENT()
and ensure it's within X_ROOT through a regex or something, after you call
FIND_PACKAGE()? I am considering such an approach with FindBoost to warn
about detection of a Boost library in a system path when the Boost include
dir is in Boost_ROOT.

-- 
Philip Lowman
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] telling find_package exactly where to find a package

2009-01-30 Thread Adolfo Rodríguez
Hmmm, nice to know that. I currently do not perform any kind of sanity check
on the include/lib paths, although I print an informative message to the
user. Thanks for the tip!

Adolfo Rodríguez Tsouroukdissian


On Fri, Jan 30, 2009 at 10:49 AM, Philip Lowman phi...@yhbt.com wrote:

 On Fri, Jan 30, 2009 at 3:44 AM, Adolfo Rodríguez dof...@gmail.comwrote:

 On Fri, Jan 30, 2009 at 7:11 AM, Philip Lowman phi...@yhbt.com wrote:

 On Fri, Jan 30, 2009 at 12:08 AM, Tyler Roscoe ty...@cryptio.netwrote:

 This seems like a common situation, so surely there's a CMake way to
 handle it? I was hoping the PATHS parameter would do what I want but
 it's for specifying the path to the FindXXX modules.


 Read the documentation for the find_path() and find_library() commands.
 Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely
 be of tremendous help to you.


 I have a project with similar requirements as Tyler's, and we effectively
 use the  CMAKE_PREFIX_PATH variable. The thing is that if you ONLY want the
 FindXXX.cmake to look in the paths pointed by CMAKE_PREFIX_PATH, and not the
 standard ones (e.g., /usr, /usr/local, ... on Unix), this might not be
 enough.
 FindBoost.cmake has a very convenient variable named Boost_ROOT that
 specifies where the boost libraries are located. Taking a quick look at the
 FindQt*.cmake doc, I didn't find a similar functionality, but I still wonder
 if it can be achieved in a simple way.


 Sorry to disappoint, but FindBoost suffers from the same issue in that
 setting Boost_ROOT doesn't guarantee you won't have libraries picked up in
 the system paths.
 http://public.kitware.com/Bug/view.php?id=8412

 Worse case, if you absolutely can't stand finding stuff outside of X_ROOT
 perhaps you can obtain the path of X_LIBRARY with GET_FILENAME_COMPONENT()
 and ensure it's within X_ROOT through a regex or something, after you call
 FIND_PACKAGE()? I am considering such an approach with FindBoost to warn
 about detection of a Boost library in a system path when the Boost include
 dir is in Boost_ROOT.

 --
 Philip Lowman

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] telling find_package exactly where to find a package

2009-01-30 Thread Tyler Roscoe
On Fri, Jan 30, 2009 at 01:11:13AM -0500, Philip Lowman wrote:
 Read the documentation for the find_path() and find_library() commands.
 Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely
 be of tremendous help to you.

Ah, yes. This is why a close re-reading of the find_package docs was
also on my todo list for today :).

Thanks Philip! This is what I was looking for.

tyler
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] telling find_package exactly where to find a package

2009-01-29 Thread Philip Lowman
On Fri, Jan 30, 2009 at 12:08 AM, Tyler Roscoe ty...@cryptio.net wrote:

 I'll spend some more time reading FindQt4.cmake at work tomorrow, but I
 wanted to post this while I'm thinking about it.

 I would like to tell find_package where my third-party libraries are (Qt
 specifically). Since I know where the libraries are, I could manually
 add paths to INCLUDE_DIRS and LINK_LIBRARIES, but FindQt4 already knows
 how to do all of that so why duplicate the effort?

 This is for an internal build system, so I want to use a specific
 version of Qt installed on a networked filesystem to prevent any
 weirdness caused by a developer compiling against some random Qt that
 she might have on her dev machine.

 This seems like a common situation, so surely there's a CMake way to
 handle it? I was hoping the PATHS parameter would do what I want but
 it's for specifying the path to the FindXXX modules.


Read the documentation for the find_path() and find_library() commands.
Setting the variable CMAKE_PREFIX_PATH (or environment variable) will likely
be of tremendous help to you.

-- 
Philip Lowman
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake