Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show First 20 Lines • Show All 326 Lines • ▼ Show 20 Lines | |||||
endif() | endif() | ||||
# Target specific configs | # Target specific configs | ||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||||
set(Boost_USE_STATIC_LIBS ON) | set(Boost_USE_STATIC_LIBS ON) | ||||
set(Boost_THREADAPI win32) | set(Boost_THREADAPI win32) | ||||
find_package(SHLWAPI REQUIRED) | find_package(SHLWAPI REQUIRED) | ||||
target_link_libraries(util ${SHLWAPI_LIBRARY}) | # We cannot use the imported target here, because cmake will introduce an | ||||
target_include_directories(util PUBLIC ${SHLWAPI_INCLUDE_DIR}) | # -isystem compilation directive and cause the build to fail with MinGw. | ||||
# This comes from a couple cmake bugs: | |||||
# - https://gitlab.kitware.com/cmake/cmake/issues/16291 | |||||
# - https://gitlab.kitware.com/cmake/cmake/issues/19095 | |||||
# These issues are solved from cmake 3.14.1. Once this version is enforced, | |||||
# the following can be used: | |||||
# target_link_libraries(util SHLWAPI::shlwapi) | |||||
target_link_libraries(util ${SHLWAPI_LIBRARIES}) | |||||
target_include_directories(util PUBLIC ${SHLWAPI_INCLUDE_DIRS}) | |||||
find_library(WS2_32_LIBRARY NAMES ws2_32) | find_library(WS2_32_LIBRARY NAMES ws2_32) | ||||
target_link_libraries(util ${WS2_32_LIBRARY}) | target_link_libraries(util ${WS2_32_LIBRARY}) | ||||
target_compile_definitions(util PUBLIC BOOST_THREAD_USE_LIB) | target_compile_definitions(util PUBLIC BOOST_THREAD_USE_LIB) | ||||
endif() | endif() | ||||
# Boost packages | # Boost packages | ||||
▲ Show 20 Lines • Show All 263 Lines • Show Last 20 Lines |