On 02/28/2012 10:00 AM, Bart Vandewoestyne wrote: > Hello list, > > I'm quite new to CMake, still learning my way around... I currently > have the following in a CMakeList.txt file: > > set(BOOST_LIBNAME "boost_regex") > #set(BOOST_LIBNAME "boost_regex-mt") > target_link_libraries(airspace ${BOOST_LIBNAME}) > > On some platforms, it only works if I set the Boost RegEx library name > to "boost_regex", on others it only works with "boost_regex-mt". > > Up until now, I always uncomment the correct form, depending on what > platform I am (Linux, Cygwin,...) but this is quite annoying. How can I > figure out automatically the name of the Boost RegEx library to use? > > Thanks! > Bart
Don't do it this way. Use this: find_package(Boost REQUIRED COMPONENTS regex) include_directories(${Boost_INCLUDE_DIRS}) # add_executable etc... target_link_libraries(airspace ${Boost_LIBRARIES}) Michael -- 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