boost - How to add macro's definition in cmake? -


i using mongodb client , boost in c++ application. because mongodb client still using boost old filesystem , c++ application using filesystem version 3 boost 1.47.0, conflict.

i found way solve compilation problem, namely add macro definition before include statements header files boost in cpp files:

#define boost_filesystem_version 2 

but want know how put above macro's definition cmake project files.

take @ add_definitions, add definitions compiler command line, e.g. -d gcc, or /d msvc. try like:

add_definitions( -dboost_filesystem_version=2 ) 

in case, go add_definition method, alternative may take @ configure_file. can create header-file template, filled cmake-values , include in source files. can useful if have many, many configurable parameters determined cmake.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -