mirror of
https://github.com/ttroy50/cmake-examples.git
synced 2025-12-18 12:14:36 +03:00
fix boost include example
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
# Set the project name
|
||||
project (third_party_include)
|
||||
|
||||
|
||||
# find a boost install with the libraries filesystem and system
|
||||
find_package(Boost REQUIRED COMPONENTS filesystem system)
|
||||
find_package(Boost 1.46.1 REQUIRED COMPONENTS filesystem system)
|
||||
|
||||
# check if boost was found
|
||||
if(Boost_FOUND)
|
||||
@@ -18,12 +18,13 @@ endif()
|
||||
add_executable(third_party_include main.cpp)
|
||||
|
||||
# Include the boost headers
|
||||
#target_include_directories( third_party_include
|
||||
# PRIVATE Boost::boost
|
||||
#)
|
||||
target_include_directories( third_party_include
|
||||
PRIVATE ${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# link against the boost libraries
|
||||
target_link_libraries( third_party_include
|
||||
PRIVATE
|
||||
Boost::filesystem
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user