Skip to content
Ruslan Baratov edited this page May 21, 2014 · 15 revisions
GTest
hunter_add_package(GTest)
find_package(GTest CONFIG REQUIRED)

target_link_libraries(foo GTest::main) # GTest::gtest will be linked automatically
target_link_libraries(boo GTest::gtest)
CppNetlib.Uri
hunter_add_package(CppNetlibUri)
find_package(CppNetlibUri CONFIG REQUIRED)

target_link_libraries(foo network-uri)
Boost
if(MSVC)
  add_definitions(-DBOOST_ALL_NO_LIB=1)
endif()

# Detect iOS build
string(COMPARE EQUAL "${CMAKE_OSX_SYSROOT}" "iphoneos" is_ios)
if(is_ios)
  # Strange iOS alignment(?) bug (TODO)
  target_compile_definitions(sober PUBLIC BOOST_SP_NO_SYNC)
endif()

# Boost clang workaround
include(CheckSymbolExists)
check_symbol_exists(__SIZEOF_INT128__ "" has_int128)
if(NOT MSVC AND has_int128)
  add_definitions(-DBOOST_HAS_INT128=1)
endif()
JsonSpirit
hunter_add_package(JsonSpirit)
find_package(JsonSpirit CONFIG REQUIRED)

target_link_libraries(foo json)

Clone this wiki locally