Skip to content

Commit

Permalink
ENH: libsodium: Copy necessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
xoviat authored Oct 17, 2017
1 parent b3f123f commit 9642423
Showing 1 changed file with 44 additions and 11 deletions.
55 changes: 44 additions & 11 deletions ports/libsodium/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
${SOURCE_PATH}/LICENSE
DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsodium
RENAME copyright
)

0 comments on commit 9642423

Please sign in to comment.