Skip to content

Commit

Permalink
Merge pull request #23 from AntelopeIO/boost_submodule
Browse files Browse the repository at this point in the history
Do not use `find_package()` if boost is already included as a submodule
  • Loading branch information
greg7mdp authored Jul 25, 2023
2 parents 2da170e + fe1b3a6 commit b75b31e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads)

find_package(Boost 1.67 REQUIRED COMPONENTS program_options system)
if(NOT TARGET Boost::program_options)
find_package(Boost 1.67 REQUIRED COMPONENTS program_options system)
endif()

if( APPLE )
# Apple Specific Options Here
Expand All @@ -47,6 +49,11 @@ add_library( appbase
)

target_link_libraries( appbase PUBLIC Boost::program_options Boost::system Threads::Threads)

if(TARGET Boost::asio)
target_link_libraries( appbase PUBLIC Boost::asio Boost::unit_test_framework Boost::signals2 )
endif()

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9)
target_link_libraries( appbase PUBLIC stdc++fs )
Expand Down

0 comments on commit b75b31e

Please sign in to comment.