Added a switch to use VCPKG

This commit is contained in:
Paul Ferrand 2020-01-24 09:18:51 +01:00
parent d4abb5cadc
commit 39d20bbf96

View file

@ -21,15 +21,18 @@ if (UNIX)
endif() endif()
if (WIN32) if (WIN32)
find_package(LibSndFile REQUIRED)
find_path(SNDFILE_INCLUDE_DIR sndfile.hh)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
add_compile_options(/Zc:__cplusplus) add_compile_options(/Zc:__cplusplus)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif() endif()
if (WIN32 OR SFIZZ_USE_VCPKG)
find_package(LibSndFile REQUIRED)
find_path(SNDFILE_INCLUDE_DIR sndfile.hh)
endif()
function(SFIZZ_LINK_LIBSNDFILE TARGET) function(SFIZZ_LINK_LIBSNDFILE TARGET)
if (WIN32) if (WIN32 OR SFIZZ_USE_VCPKG)
target_link_libraries (${TARGET} PRIVATE sndfile-static) target_link_libraries (${TARGET} PRIVATE sndfile-static)
target_include_directories(${TARGET} PUBLIC ${SNDFILE_INCLUDE_DIR}) target_include_directories(${TARGET} PUBLIC ${SNDFILE_INCLUDE_DIR})
else() else()