Boost logo

Boost Interest :

Subject: [Boost-cmake] CMAKE_CXX_FLAGS on Darwin...
From: Sean Chittenden (sean_at_[hidden])
Date: 2009-10-29 18:37:03

I've been running with the following snippet in my boost build
directory for a while.

> # At some point in the future, this won't be requied to silence an
> # error message for boost, but for the time being it is.

If boost isn't built for the current project, I have cmake call a
shell scipt to use cmake to build boost (passed in via -
DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}). The -gdwarf-2 flag prevents
N_GSYM errors on Darwin, similar to the following:

cd /Users/sean/src/obj/contrib-Darwin-i386/boost-1.40.0.cmake2.obj/
libs/thread/src && /opt/local/bin/cmake -E cmake_link_script
CMakeFiles/boost_thread-mt-shared-debug.dir/link.txt --verbose=1
/opt/local/bin/g++-mp-4.3 -dynamiclib -
headerpad_max_install_names -o ../../../lib/libboost_thread-
mt-d.dylib -install_name /Users/sean/src/obj/contrib-Darwin-i386/
boost-1.40.0.cmake2.obj/lib/libboost_thread-mt-d.dylib CMakeFiles/
boost_thread-mt-shared-debug.dir/pthread/thread.cpp.o CMakeFiles/
boost_thread-mt-shared-debug.dir/pthread/exceptions.cpp.o CMakeFiles/
boost_thread-mt-shared-debug.dir/pthread/once.cpp.o ld: warning: can't
find atom for N_GSYM stabs uninitialized_flag:G(0,1440) in CMakeFiles/
boost_thread-mt-shared-debug.dir/pthread/thread.cpp.old: warning:
can't find atom for N_GSYM stabs being_initialized:G(0,1440) in
/opt/local/bin/cmake -E cmake_progress_report /Users/sean/src/obj/
contrib-Darwin-i386/boost-1.40.0.cmake2.obj/CMakeFiles 6

Starting with cmake2, it looks like CMAKE_CXX_FLAGS is being reset
somewhere along the lines. Is there a correct/better way to pass this
in to CMake or is there a way to have Boost cmake automatically set -
gdwarf-2 using the above logic? tia. -sc

Sean Chittenden

Boost-cmake list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at