[CMake] Having difficulty with find_library()
Michael Jackson
mike.jackson at bluequartz.net
Thu Jan 15 00:23:20 EST 2009
I would try the following just to make sure it will find the library:
find_library(TBB_LIBRARY
NAMES tbb
PATHS <tbb_rootdirectory>/ai32/vc9/lib )
Substitute the proper full path for <tbb_rootdirectory> in the path
above.
Run CMake and see if the TBB_LIBRARY gets found. If it does get found
by CMake then start breaking the path into parts based on which
compiler is being used.
BTW - TBB is a Framework on OS X, just in case you plan to use it or
release the FindTBB.cmake file to the community (if you are allowed).
_________________________________________________________
Mike Jackson mike.jackson at bluequartz.net
BlueQuartz Software www.bluequartz.net
Principal Software Engineer Dayton, Ohio
On Jan 15, 2009, at 12:06 AM, Robert Dailey wrote:
> Hi,
>
> I'm creating a Find module for Intel's TBB library and I can't get
> find_library to work properly. It's just not finding the library.
> The path to the library in question is <tbb_rootdirectory>/ai32/vc9/
> lib/tbb.lib for the MSVC9 32-bit compiler. Am I doing something
> wrong? I've set the root path to the TBB library in
> CMAKE_PREFIX_PATH outside of the find module before my external call
> to find_package(). I wonder if my PATH_SUFFIXES arguments are
> appropriate.
>
> include( LibFindMacros )
>
> find_file( TBB_INCLUDE_DIR tbb/atomic.h )
>
> if( CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008" )
> set( TBB_PATH_SUFFIX ai32/vc9 )
> elseif( CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005" )
> set( TBB_PATH_SUFFIX ai32/vc8 )
> elseif( CMAKE_GENERATOR STREQUAL "Visual Studio 7 .NET 2003" )
> set( TBB_PATH_SUFFIX ai32/vc7 )
> elseif( CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005 Win64" )
> set( TBB_PATH_SUFFIX em64t/vc8 )
> elseif( CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008 Win64" )
> set( TBB_PATH_SUFFIX em64t/vc9 )
> endif()
>
> find_library( TBB_LIBRARY tbb PATH_SUFFIXES ${TBB_PATH_SUFFIX} )
>
> set( TBB_PROCESS_INCLUDES TBB_INCLUDE_DIR )
> set( TBB_PROCESS_LIBS TBB_LIBRARY )
> libfind_process( TBB )
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list