mirror of
https://github.com/ttroy50/cmake-examples.git
synced 2025-12-18 12:14:36 +03:00
25 lines
530 B
CMake
25 lines
530 B
CMake
cmake_minimum_required(VERSION 3.5)
|
|
|
|
# Set the project name
|
|
project (imported_targets)
|
|
|
|
|
|
# find a boost install with the libraries filesystem and system
|
|
find_package(Boost 1.46.1 REQUIRED COMPONENTS filesystem system)
|
|
|
|
# check if boost was found
|
|
if(Boost_FOUND)
|
|
message ("boost found")
|
|
else()
|
|
message (FATAL_ERROR "Cannot find Boost")
|
|
endif()
|
|
|
|
# Add an executable
|
|
add_executable(imported_targets main.cpp)
|
|
|
|
# link against the boost libraries
|
|
target_link_libraries( imported_targets
|
|
PRIVATE
|
|
Boost::filesystem
|
|
)
|