Re: [cmake-developers] Proper way to find 64-bit version of a library (or specifically OSG)

2015-05-13 Thread Brad King
On 05/12/2015 04:24 PM, Mattias Helsing wrote:
 I'm wondering what the proper way is to go about finding 64-bit
 versions of a library.

The find_library command automatically adds 64 to lib directories
if the FIND_LIBRARY_USE_LIB64_PATHS global property is set and the
target architecture is 64-bit:

 http://www.cmake.org/cmake/help/v3.2/command/find_library.html
 http://www.cmake.org/cmake/help/v3.2/prop_gbl/FIND_LIBRARY_USE_LIB64_PATHS.html

The global property is normally set automatically for the current
operating system.  Note that Debian-based distros do not use lib64
in their packages so it is not enabled there.  On such distros
hand-built packages should also be configured to avoid lib64 paths.

 My situation is that I have built
 OpenSceneGraph 64-bit and installed it. The libraries end up in
 /usr/whatever/lib64. But to be able to find the libraries I needed to
 modify Modules/FindOpenThreads.cmake and
 Modules/Findosg_functions.cmake to also search lib64 suffixes
 (modified PATH_SUFFIXES).

CMake's find modules for OSG were created long ago, but ideally OSG
should distribute cmake package configuration files as documented here:

 http://www.cmake.org/cmake/help/v3.2/manual/cmake-packages.7.html

That way only a single find_package call is needed and CMake does not
have to find individual library files.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] Proper way to find 64-bit version of a library (or specifically OSG)

2015-05-12 Thread Mattias Helsing
Hi all,

I'm wondering what the proper way is to go about finding 64-bit
versions of a library. My situation is that I have built
OpenSceneGraph 64-bit and installed it. The libraries end up in
/usr/whatever/lib64. But to be able to find the libraries I needed to
modify Modules/FindOpenThreads.cmake and
Modules/Findosg_functions.cmake to also search lib64 suffixes
(modified PATH_SUFFIXES).

Is this the way to go? Should I submit a patch ? Or is there some
higher level way to make find_package look for 64-bit libraries that
is more appropriate ?

And yes, I'm on CMake master as of may12.

Thanks
Mattias
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers