[CMake] Having difficulty with find_library()

Robert Dailey rcdailey at gmail.com
Thu Jan 15 12:57:46 EST 2009


On Thu, Jan 15, 2009 at 11:30 AM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> I am not really sure about the ins-and-outs of Windows Dev but looking
> through the Windows-cl.cmake file (Located in the
> CMake-2.6.2/share/cmake-2.6/Modules directory) there are some variables that
> you might be able to exploit.
>
> CMAKE_CL_64
> CMAKE_FORCE_WIN64
>
> Not sure how these work if you are running a 32bit system and want to build
> for Win64? They seem to be detecting the system you are building on, not
> what you want to target.


I currently have this:

include( LibFindMacros )

find_file( TBB_INCLUDE_DIR tbb/atomic.h )

if( MSVC90 )
    set( TBB_PATH_SUFFIX ia32/vc9/lib )
elseif( MSVC80 )
    set( TBB_PATH_SUFFIX ia32/vc8/lib )
elseif( MSVC70 OR MSVC71 )
    set( TBB_PATH_SUFFIX ia32/vc7/lib )
elseif( MSVC90 AND CMAKE_GENERATOR STREQUAL "Visual Studio 8 2005 Win64" )
    set( TBB_PATH_SUFFIX em64t/vc8/lib )
elseif( MSVC80 AND CMAKE_GENERATOR STREQUAL "Visual Studio 9 2008 Win64" )
    set( TBB_PATH_SUFFIX em64t/vc9/lib )
endif()

find_library( TBB_LIBRARY_RELEASE tbb PATH_SUFFIXES ${TBB_PATH_SUFFIX} )
find_library( TBBMALLOC_LIBRARY_RELEASE tbbmalloc PATH_SUFFIXES
${TBB_PATH_SUFFIX} )
find_library( TBB_LIBRARY_DEBUG tbb_debug PATH_SUFFIXES ${TBB_PATH_SUFFIX} )
find_library( TBBMALLOC_LIBRARY_DEBUG tbbmalloc_debug PATH_SUFFIXES
${TBB_PATH_SUFFIX} )

set( TBB_LIBRARY
    debug ${TBB_LIBRARY_DEBUG}
    debug ${TBBMALLOC_LIBRARY_DEBUG}
    optimized ${TBB_LIBRARY_RELEASE}
    optimized ${TBBMALLOC_LIBRARY_RELEASE}
)

set( TBB_PROCESS_INCLUDES TBB_INCLUDE_DIR )
set( TBB_PROCESS_LIBS TBB_LIBRARY )
libfind_process( TBB )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090115/67222799/attachment.htm>


More information about the CMake mailing list