macro(linkBoost components)
  if(BUILD_SHARED_LIBS)
     if (WIN32)
         set(Boost_USE_STATIC_LIBS ON)
     else()
         set(Boost_USE_STATIC_LIBS OFF)
     endif()
	 set(Boost_USE_STATIC_RUNTIME OFF)
  else()
	 set(Boost_USE_STATIC_LIBS ON)
	 set(Boost_USE_STATIC_RUNTIME ON)
  endif()
	  
  set(Boost_USE_MULTITHREADED ON)

  if (WIN32)
	add_definitions( -DBOOST_ALL_NO_LIB )
#	add_definitions( -DBOOST_ALL_DYN_LINK )
  endif()
  vf_get_library_name(library_name)
  find_package( Boost REQUIRED COMPONENTS ${components})
  target_include_directories(${library_name} PRIVATE ${Boost_INCLUDE_DIR})
  target_link_libraries(${library_name} PRIVATE ${Boost_LIBRARIES})
endmacro(linkBoost)