diff --git a/ports/libsodium/portfile.cmake b/ports/libsodium/portfile.cmake index 593c173e9c..731d63e9bb 100644 --- a/ports/libsodium/portfile.cmake +++ b/ports/libsodium/portfile.cmake @@ -12,20 +12,53 @@ vcpkg_from_github( ) if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/libsodium.vcxproj - RELEASE_CONFIGURATION ReleaseDLL - DEBUG_CONFIGURATION DebugDLL - ) + set(LIBSODIUM_RELEASE_CONFIGURATION ReleaseDLL) + set(LIBSODIUM_DEBUG_CONFIGURATION DebugDLL) else() - vcpkg_build_msbuild( - PROJECT_PATH ${SOURCE_PATH}/libsodium.vcxproj - ) + set(LIBSODIUM_RELEASE_CONFIGURATION Release) + set(LIBSODIUM_DEBUG_CONFIGURATION Debug) endif() +vcpkg_build_msbuild( + PROJECT_PATH ${SOURCE_PATH}/libsodium.vcxproj + RELEASE_CONFIGURATION ${LIBSODIUM_RELEASE_CONFIGURATION} + DEBUG_CONFIGURATION ${LIBSODIUM_DEBUG_CONFIGURATION} +) + +IF(VCPKG_TARGET_ARCHITECTURE MATCHES "x86") + SET(BUILD_ARCH "Win32") +ELSE() + SET(BUILD_ARCH ${VCPKG_TARGET_ARCHITECTURE}) +ENDIF() + + +file(GLOB LIBSODIUM_HEADERS "${SOURCE_PATH}/src/libsodium/include/sodium/*.h") +file(INSTALL + ${LIBSODIUM_HEADERS} + DESTINATION ${CURRENT_PACKAGES_DIR}/include/sodium +) file(INSTALL - ${SOURCE_PATH}/LICENSE - DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsodium - RENAME copyright + Build\${LIBSODIUM_RELEASE_CONFIGURATION}\${BUILD_ARCH}\libsodium.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin +) +file(INSTALL + Build\${LIBSODIUM_RELEASE_CONFIGURATION}\${BUILD_ARCH}\libsodium.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib +) +file(INSTALL + Build\${LIBSODIUM_DEBUG_CONFIGURATION}\${BUILD_ARCH}\libsodium.dll + DESTINATION ${CURRENT_PACKAGES_DIR}/bin/debug +) +file(INSTALL + Build\${LIBSODIUM_DEBUG_CONFIGURATION}\${BUILD_ARCH}\libsodium.lib + DESTINATION ${CURRENT_PACKAGES_DIR}/lib/debug +) + +vcpkg_copy_pdbs() + +file(INSTALL + ${SOURCE_PATH}/LICENSE + DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsodium + RENAME copyright )