I am trying to include Boost\'s thread library in my C++ project. My CMake file is like so:
cmake_minimum_required(VERSION 3.6)
project(LearningC)
find_pack
I found a solution. Basically, Boost has most of its code in C++ headers (.hpp). Some of the libraries however need to be compiled and linked... The code below works!
cmake_minimum_required(VERSION 3.6)
project(LearningC)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES main.cpp Student.cpp Student.h)
add_executable(LearningC ${SOURCE_FILES})
find_package(Boost COMPONENTS thread system REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(LearningC ${Boost_LIBRARIES})