Skip to content

Instantly share code, notes, and snippets.

@LB--
Created March 30, 2016 15:12
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LB--/ce3c51ad24b14f4bdff860f155d2dd14 to your computer and use it in GitHub Desktop.
Save LB--/ce3c51ad24b14f4bdff860f155d2dd14 to your computer and use it in GitHub Desktop.
CMake Boost Example
cmake_minimum_required(VERSION 3.4)
project(boost-example
VERSION 0.0.0
LANGUAGES
CXX
)
find_package(Boost 1.60 REQUIRED
COMPONENTS
filesystem
system
)
add_executable(example
"main.cpp"
)
target_link_libraries(example
Boost::filesystem
Boost::system
)
#include <iostream>
#include <boost/filesystem.hpp>
int main(int nargs, char const *const *args)
{
for(int i = 0; i < nargs; ++i)
{
std::cout << args[i] << " " << boost::filesystem::file_size(args[i]) << std::endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment