On Fri, Feb 6, 2009 at 7:48 PM, Neal Meyer <[email protected]> wrote:

> I have something like the following in my CMakeLists file.
>
>  set( CMAKE_EXE_LINKER_FLAGS_DEBUG "-lboost_regex-xgcc40-mt-d" )
>  set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-lboost_regex-xgcc40-mt" )
>
> and then a exe that needs this library to link....
>
> However the makefile doesn't actually add this option in.  If i use
> CMAKE_EXE_LINKER_FLAGS it works fine.  Am I missing something?
>
> using CMake 2.6.2


Neal,

What you have there should be being added to the linker flags for
*executables*.  It at least works fine on my system with 2.6.2 (Linux).  It
will not work for libraries, however, so you probably want something better.

In this light I suggest you try using FindBoost.cmake.  I believe the
version in 2.6.2 should work for your needs although if you have any issues
at all please try[1] CMake 2.6.3 RC 11 and see the updated FindBoost
documentation for debugging options.

find_package(Boost <minimum_version> REQUIRED regex)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${Boost_LIBRARIES})


[1] = http://www.cmake.org/files/v2.6/

-- 
Philip Lowman
_______________________________________________
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to