forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add vcpkg CONTROL file and portfile to build nmos-cpp with vcpkg.
- Loading branch information
1 parent
35d14cc
commit 7957bf1
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Source: nmos-cpp | ||
Version: 1.0.0 | ||
Homepage: https://github.com/aholzinger/nmos-cpp | ||
Description: nmos-cpp is an implementation of the AMWA Networked Media Open Specifications in C++, licensed under the terms of the Apache License 2.0. | ||
Build-Depends: boost, cpprestsdk, openssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
include(vcpkg_common_functions) | ||
|
||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO aholzinger/nmos-cpp | ||
REF 35d14cce1eef2107345419ae690df97d8e17e17e | ||
SHA512 9be9f836231333cdbdfa3efdd871331f3b0de116862977528153a0e24896b30a163ce7e732c0fc3201507b2c772fb3ad729bce1f121d30dbb4f68a006f9cd0da | ||
HEAD_REF master | ||
) | ||
|
||
set (NMOS_CPP_OPTIONS_DEBUG) | ||
set (NMOS_CPP_OPTIONS_RELEASE) | ||
set (NMOS_CPP_LINKAGE_SUFFIX) | ||
|
||
if (${VCPKG_LIBRARY_LINKAGE} STREQUAL "static") | ||
set(NMOS_CPP_LINKAGE_SUFFIX "-${VCPKG_LIBRARY_LINKAGE}") | ||
endif() | ||
|
||
set(NMOS_CPP_BOOST_SYSTEM_USE_UTF8_OPTION "-DNMOS_CPP_BOOST_SYSTEM_USE_UTF8=1") | ||
set(NMOS_CPP_INCLUDE_DIR_PREFIX_OPTION "-DNMOS_CPP_INCLUDE_DIR_PREFIX=nmos-cpp") | ||
|
||
if (DEFINED VCPKG_TARGET_IS_WINDOWS AND ${VCPKG_TARGET_IS_WINDOWS} STREQUAL "1") | ||
set(WEBSOCKETPP_INCLUDE_DIR "${VCPKG_ROOT_PATH}/packages/websocketpp_${VCPKG_TARGET_ARCHITECTURE}-windows${NMOS_CPP_LINKAGE_SUFFIX}/include/websocketpp") | ||
if (${VCPKG_LIBRARY_LINKAGE} STREQUAL "static") | ||
set (NMOS_CPP_OPTIONS_DEBUG "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug") | ||
set (NMOS_CPP_OPTIONS_RELEASE "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded") | ||
else() | ||
# not yet tested | ||
if (${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic") | ||
set (NMOS_CPP_OPTIONS_DEBUG "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL") | ||
set (NMOS_CPP_OPTIONS_RELEASE "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL") | ||
endif() | ||
endif() | ||
else() | ||
# not yet tested | ||
# perhaps this isn't necessary | ||
if (DEFINED VCPKG_TARGET_IS_LINUX AND ${VCPKG_TARGET_IS_LINUX} STREQUAL "1") | ||
set(WEBSOCKETPP_INCLUDE_DIR "${VCPKG_ROOT_PATH}/packages/websocketpp_${VCPKG_TARGET_ARCHITECTURE}-linux${NMOS_CPP_LINKAGE_SUFFIX}/include/websocketpp") | ||
endif() | ||
endif() | ||
|
||
if (DEFINED WEBSOCKETPP_INCLUDE_DIR) | ||
set(NMOS_CPP_WEBSOCKETPP_INCLUDE_DIR_OPTION "-DWEBSOCKETPP_INCLUDE_DIR=${WEBSOCKETPP_INCLUDE_DIR}") | ||
endif() | ||
|
||
set(CMAKE_POLICY_DEFAULT_CMP0074 NEW) | ||
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW) | ||
|
||
set(OPTIONS) | ||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
${NMOS_CPP_BOOST_SYSTEM_USE_UTF8_OPTION} | ||
${NMOS_CPP_INCLUDE_DIR_PREFIX_OPTION} | ||
${NMOS_CPP_WEBSOCKETPP_INCLUDE_DIR_OPTION} | ||
OPTIONS_DEBUG | ||
${NMOS_CPP_OPTIONS_DEBUG} | ||
OPTIONS_RELEASE | ||
${NMOS_CPP_OPTIONS_RELEASE} | ||
) | ||
|
||
vcpkg_install_cmake() | ||
|
||
message(STATUS "CURRENT_PACKAGES_DIR = ${CURRENT_PACKAGES_DIR}") | ||
|
||
# vcpkg_fixup_cmake_targets(CONFIG_PATH share/nmos-cpp) | ||
# vcpkg_fixup_cmake_targets() | ||
|
||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share) | ||
|
||
file(INSTALL | ||
${SOURCE_PATH}/LICENSE | ||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/nmos-cpp RENAME copyright) | ||
|
||
vcpkg_copy_pdbs() |