Skip to content

Commit

Permalink
Clean-up examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Dec 15, 2017
1 parent 2e4679e commit c7bb4a7
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 78 deletions.
6 changes: 2 additions & 4 deletions examples/Boost-chrono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost COMPONENTS system chrono)

# now boost can be used
find_package(Boost CONFIG REQUIRED system chrono)

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::system Boost::chrono)
target_link_libraries(foo PUBLIC Boost::system Boost::chrono)
5 changes: 1 addition & 4 deletions examples/Boost-compute/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ include("../common.cmake")

project(download-boost-compute)

# download boost.compute
hunter_add_package(BoostCompute)

# now boost.compute can be used
find_package(BoostCompute CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo BoostCompute::boost_compute)
target_link_libraries(foo PUBLIC BoostCompute::boost_compute)
6 changes: 1 addition & 5 deletions examples/Boost-filesystem-shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost COMPONENTS system filesystem)

# now boost can be used
find_package(Boost CONFIG REQUIRED system filesystem)

add_executable(foo foo.cpp)

target_link_libraries(foo Boost::system Boost::filesystem)
target_link_libraries(foo PUBLIC Boost::system Boost::filesystem)
9 changes: 0 additions & 9 deletions examples/Boost-filesystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ endif()

target_link_libraries(foo Boost::system Boost::filesystem)

# Compatibility mode
set(Boost_USE_STATIC_LIBS ON)
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB=1)
endif()
find_package(Boost REQUIRED system filesystem)
include_directories("${Boost_INCLUDE_DIRS}")
target_link_libraries(foo ${Boost_LIBRARIES})

if(ANDROID)
target_link_libraries(foo log android)
target_include_directories(
Expand Down
15 changes: 2 additions & 13 deletions examples/Boost-iostreams/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ include("../common.cmake")

project(boost_iostreams)

# download boost
hunter_add_package(Boost COMPONENTS iostreams serialization)

# now boost can be used
find_package(Boost CONFIG REQUIRED iostreams serialization)
add_executable(foo foo.cpp)
target_link_libraries(foo Boost::iostreams Boost::serialization)

# Compatibility mode
set(Boost_USE_STATIC_LIBS ON)
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB=1)
endif()
find_package(Boost REQUIRED iostreams)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(foo ${Boost_LIBRARIES})
add_executable(foo foo.cpp)
target_link_libraries(foo PUBLIC Boost::iostreams Boost::serialization)
6 changes: 2 additions & 4 deletions examples/Boost-log/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost COMPONENTS log)

# now boost can be used
find_package(Boost CONFIG REQUIRED log)

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::log)
target_link_libraries(foo PUBLIC Boost::log)
5 changes: 1 addition & 4 deletions examples/Boost-process/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ include("../common.cmake")

project(example-boost-process)

# download boost.process
hunter_add_package(BoostProcess)

# now boost.process can be used
find_package(BoostProcess CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo BoostProcess::boost_process)
target_link_libraries(foo PUBLIC BoostProcess::boost_process)
6 changes: 2 additions & 4 deletions examples/Boost-random/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ include("../common.cmake")

project(download-boost-random)

# download boost-random
hunter_add_package(Boost COMPONENTS random)

# now boost can be used
find_package(Boost CONFIG REQUIRED random)

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::random)
target_link_libraries(foo PUBLIC Boost::random)
2 changes: 1 addition & 1 deletion examples/Boost-serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ hunter_add_package(Boost COMPONENTS serialization)
find_package(Boost CONFIG REQUIRED serialization)

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::serialization)
target_link_libraries(foo PUBLIC Boost::serialization)
15 changes: 2 additions & 13 deletions examples/Boost-system/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,8 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost COMPONENTS system)

# now boost can be used
find_package(Boost CONFIG REQUIRED system)
add_executable(foo foo.cpp)
target_link_libraries(foo Boost::system)

# Compatibility mode
set(Boost_USE_STATIC_LIBS ON)
if(MSVC)
add_definitions(-DBOOST_ALL_NO_LIB=1)
endif()
find_package(Boost REQUIRED system)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(foo ${Boost_LIBRARIES})
add_executable(foo foo.cpp)
target_link_libraries(foo PUBLIC Boost::system)
7 changes: 2 additions & 5 deletions examples/Boost-thread/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost COMPONENTS system thread)

# now boost can be used
find_package(Boost CONFIG REQUIRED system thread)
add_executable(foo foo.cpp)
target_link_libraries(foo Boost::system Boost::thread)

add_executable(foo foo.cpp)
target_link_libraries(foo PUBLIC Boost::system Boost::thread)
5 changes: 1 addition & 4 deletions examples/Boost-uuid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost)

# now boost can be used
find_package(Boost CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::boost)
target_link_libraries(foo PUBLIC Boost::boost)
9 changes: 1 addition & 8 deletions examples/Boost/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ include("../common.cmake")

project(download-boost)

# download boost
hunter_add_package(Boost)

# now boost can be used
find_package(Boost CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::boost)
target_link_libraries(foo PUBLIC Boost::boost)

set(project_license "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
file(
Expand All @@ -40,7 +37,3 @@ foreach(x ${Boost_LICENSES})
endforeach()

message("Project license: ${project_license}")

# Compatibility mode
find_package(Boost REQUIRED)
include_directories("${Boost_INCLUDE_DIRS}")

0 comments on commit c7bb4a7

Please sign in to comment.