title: C++, Mac OS X, Xcode 8 : Compile Boost : Set deployment target to OS X 10.11
body: <p>I am trying to use Boost CPP library on Mac OS X 10.11.6. I downloaded the 1.62 version of Boost from official SourceForge repository. Extracted it and built is as per the docs here: <a href="http://www.boost.org/doc/libs/1_62_0/more/getting_started/unix-variants.html" rel="nofollow">http://www.boost.org/doc/libs/1_62_0/more/getting_started/unix-variants.html</a></p>
  
  <p>Basically, I went to the directory and ran the "bootstrap.sh" and "b2" scripts. </p>
  
  <p>Then I created a simple C++ program : </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  #include &lt;boost/algorithm/string.hpp&gt;
  #include &lt;boost/regex.hpp&gt;
  
  int main() {
    std::string str1(" hello world! ");
    boost::to_upper(str1);
  
    std::cout &lt;&lt; str1 &lt;&lt; std::endl;
  
    std::string s = " Boost Libraries ";
    boost::regex expr{"\\s"};
    std::string fmt{"_"};
    std::cout &lt;&lt; boost::regex_replace(s, expr, fmt) &lt;&lt; '\n';
  
    return 0;
  }
  </code></pre>
  
  <p>And tried to build it with the following CMake file</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.9)
  
  set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++")
  
  project(app_project)
  
  set(Boost_USE_STATIC_LIBS ON) 
  set(Boost_USE_MULTITHREADED ON)  
  set(Boost_USE_STATIC_RUNTIME ON) 
  
  find_package(Boost 1.62.0 COMPONENTS regex) 
  
  if(Boost_FOUND)
      include_directories(${Boost_INCLUDE_DIRS}) 
      add_executable(myapp main.cpp)
      target_link_libraries(myapp ${Boost_LIBRARIES})
  endif()
  </code></pre>
  
  <p>When I make the program I get following warnings:</p>
  
  <pre><code>ld: warning: object file (/Users/pritam/opt/boost_1_62_0/stage/lib/libboost_regex.a(instances.o)) was built for newer OSX version (10.12) than being linked (10.11)
  ld: warning: object file (/Users/pritam/opt/boost_1_62_0/stage/lib/libboost_regex.a(regex.o)) was built for newer OSX version (10.12) than being linked (10.11)
  ld: warning: object file (/Users/pritam/opt/boost_1_62_0/stage/lib/libboost_regex.a(regex_traits_defaults.o)) was built for newer OSX version (10.12) than being linked (10.11)
  ld: warning: object file (/Users/pritam/opt/boost_1_62_0/stage/lib/libboost_regex.a(regex_raw_buffer.o)) was built for newer OSX version (10.12) than being linked (10.11)
  ld: warning: object file (/Users/pritam/opt/boost_1_62_0/stage/lib/libboost_regex.a(cpp_regex_traits.o)) was built for newer OSX version (10.12) than being linked (10.11)
  ld: warning: object file (/Users/pritam/opt/boost_1_62_0/stage/lib/libboost_regex.a(static_mutex.o)) was built for newer OSX version (10.12) than being linked (10.11)
  </code></pre>
  
  <p>I have XCode 8 installed on this machine. It seems that while building Boost it sets the deployment target to OS X 10.12. </p>
  
  <p>So the question is:</p>
  
  <p>How can I set the deployment target to OS X 10.11 while building Boost? </p>