Created
March 30, 2016 15:12
-
-
Save LB--/ce3c51ad24b14f4bdff860f155d2dd14 to your computer and use it in GitHub Desktop.
CMake Boost Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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