daily pastebin goal
18%
SHARE
TWEET

A finally fucking working boost library CMake file with MSVC

qyzk Feb 19th, 2019 (edited) 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MAKE_MINIMUM_REQUIRED (VERSION 3.0)
  2.  
  3. PROJECT (OHNO)
  4.  
  5. ADD_EXECUTABLE (
  6.     ohno
  7.     ./src/main.cpp
  8. )
  9.  
  10. SET_TARGET_PROPERTIES (
  11.     ohno
  12.     PROPERTIES
  13.     CXX_STANDARD 17
  14. )
  15.  
  16. # directory where the library is i.e. that contains libs, doc, boost, ...
  17. SET (BOOST_ROOT "C:/Development/Library")
  18.  
  19. # your demanded boost components be listed here
  20. FIND_PACKAGE (Boost COMPONENTS log REQUIRED)
  21.  
  22. LINK_DIRECTORIES (${Boost_LIBRARY_DIRS})
  23. INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS})
  24. ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK) # does not work without this
  25.  
  26. TARGET_LINK_LIBRARIES (
  27.     ohno
  28.     Boost::log # also, list your demanded boost components
  29. )
  30.  
  31. # took a entire day to make it just built wtf
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top