Merge pull request #108 from traversaro/add-ace-port

Add ace port
This commit is contained in:
Robert Schumacher 2016-10-02 20:09:51 -07:00 committed by GitHub
commit 3b2425833b
4 changed files with 135 additions and 4 deletions

3
ports/ace/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: ace
Version: 6.4.0
Description: The ADAPTIVE Communication Environment

88
ports/ace/portfile.cmake Normal file
View File

@ -0,0 +1,88 @@
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ACE_wrappers/ace)
vcpkg_download_distfile(ARCHIVE
URL "http://download.dre.vanderbilt.edu/previous_versions/ACE-6.4.0.zip"
FILENAME "ACE-6.4.0.zip"
SHA512 3543291332b96cf06a966dedda617169e8db051cebbbc4f05cdc2c2c9e7908174f8ed67bc152bbcd57541279d3addb1138f1fc092468e856c2bb04ee6ad2b95a
)
vcpkg_extract_source_archive(${ARCHIVE})
if (TRIPLET_SYSTEM_ARCH MATCHES "arm")
message(FATAL_ERROR, "ARM is currently not supported.")
return()
elseif (TRIPLET_SYSTEM_ARCH MATCHES "x86")
set(MSBUILD_PLATFORM "Win32")
else ()
set(MSBUILD_PLATFORM ${TRIPLET_SYSTEM_ARCH})
endif()
# Add ace/config.h file
# see http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/ACE/ACE-INSTALL.html#win32
file(WRITE ${SOURCE_PATH}/config.h "#include \"ace/config-windows.h\"")
vcpkg_build_msbuild(
PROJECT_PATH ${SOURCE_PATH}/ace_vc14.sln
PLATFORM ${MSBUILD_PLATFORM}
)
# ACE itself does not define an install target, so it is not clear which
# headers are public and which not. For the moment we install everything
# that is in the source path and ends in .h, .inl
function(install_ace_headers_subdirectory SOURCE_PATH RELATIVE_PATH)
file(GLOB HEADER_FILES ${SOURCE_PATH}/${RELATIVE_PATH}/*.h ${SOURCE_PATH}/${RELATIVE_PATH}/*.inl)
file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ace/${RELATIVE_PATH})
endfunction()
# We manually install header found in the ace directory because in that case
# we are supposed to install also *cpp files, see ACE_wrappers\debian\libace-dev.install file
file(GLOB HEADER_FILES ${SOURCE_PATH}/*.h ${SOURCE_PATH}/*.inl ${SOURCE_PATH}/*.cpp)
file(INSTALL ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include/ace/)
# Install headers in subdirectory
install_ace_headers_subdirectory(${SOURCE_PATH} "Compression")
install_ace_headers_subdirectory(${SOURCE_PATH} "Compression/rle")
install_ace_headers_subdirectory(${SOURCE_PATH} "ETCL")
install_ace_headers_subdirectory(${SOURCE_PATH} "Monitor_Control")
install_ace_headers_subdirectory(${SOURCE_PATH} "os_include")
install_ace_headers_subdirectory(${SOURCE_PATH} "os_include/arpa")
install_ace_headers_subdirectory(${SOURCE_PATH} "os_include/net")
install_ace_headers_subdirectory(${SOURCE_PATH} "os_include/netinet")
install_ace_headers_subdirectory(${SOURCE_PATH} "os_include/sys")
# Install the libraries
function(install_ace_library SOURCE_PATH ACE_LIBRARY)
set(LIB_PATH ${SOURCE_PATH}/../lib/)
file(INSTALL
${LIB_PATH}/${ACE_LIBRARY}d.dll
${LIB_PATH}/${ACE_LIBRARY}d_dll.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
)
file(INSTALL
${LIB_PATH}/${ACE_LIBRARY}.dll
${LIB_PATH}/${ACE_LIBRARY}.pdb
DESTINATION ${CURRENT_PACKAGES_DIR}/bin
)
file(INSTALL
${LIB_PATH}/${ACE_LIBRARY}d.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
)
file(INSTALL
${LIB_PATH}/${ACE_LIBRARY}.lib
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
)
endfunction()
install_ace_library(${SOURCE_PATH} "ACE")
install_ace_library(${SOURCE_PATH} "ACE_Compression")
install_ace_library(${SOURCE_PATH} "ACE_ETCL")
install_ace_library(${SOURCE_PATH} "ACE_Monitor_Control")
install_ace_library(${SOURCE_PATH} "ACE_QoS")
install_ace_library(${SOURCE_PATH} "ACE_RLECompression")
vcpkg_copy_pdbs()
# Handle copyright
file(COPY ${SOURCE_PATH}/../COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/ace)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ace/COPYING ${CURRENT_PACKAGES_DIR}/share/ace/copyright)

View File

@ -1,5 +1,42 @@
#.rst:
# .. command:: vcpkg_build_msbuild
#
# Build a msbuild-based project.
#
# ::
# vcpkg_build_msbuild(PROJECT_PATH <sln_project_path>
# [RELEASE_CONFIGURATION <release_configuration>] # (default = "Release")
# [DEBUG_CONFIGURATION <debug_configuration>] @ (default = "Debug")
# [PLATFORM <platform>] # (default = "${TRIPLET_SYSTEM_ARCH}")
# [OPTIONS arg1 [arg2 ...]]
# [OPTIONS_RELEASE arg1 [arg2 ...]]
# [OPTIONS_DEBUG arg1 [arg2 ...]]
# )
#
# ``PROJECT_PATH``
# The path to the *.sln msbuild project file.
# ``RELEASE_CONFIGURATION``
# The configuration (``/p:Configuration`` msbuild parameter)
# used for Release builds.
# ``DEBUG_CONFIGURATION``
# The configuration (``/p:Configuration`` msbuild parameter)
# used for Debug builds.
# ``DEBUG_CONFIGURATION``
# The configuration (``/p:Configuration`` msbuild parameter)
# used for Debug builds.
# ``PLATFORM``
# The platform (``/p:Platform`` msbuild parameter)
# used for the build.
# ``OPTIONS``
# The options passed to msbuild for all builds.
# ``OPTIONS_RELEASE``
# The options passed to msbuild for Release builds.
# ``OPTIONS_DEBUG``
# The options passed to msbuild for Debug builds.
#
function(vcpkg_build_msbuild)
cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN})
cmake_parse_arguments(_csc "" "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN})
if(NOT DEFINED _csc_RELEASE_CONFIGURATION)
set(_csc_RELEASE_CONFIGURATION Release)
@ -7,13 +44,16 @@ function(vcpkg_build_msbuild)
if(NOT DEFINED _csc_DEBUG_CONFIGURATION)
set(_csc_DEBUG_CONFIGURATION Debug)
endif()
if(NOT DEFINED _csc_PLATFORM)
set(_csc_PLATFORM ${TRIPLET_SYSTEM_ARCH})
endif()
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
vcpkg_execute_required_process(
COMMAND msbuild ${_csc_PROJECT_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_RELEASE}
/p:Configuration=${_csc_RELEASE_CONFIGURATION}
/p:Platform=${TRIPLET_SYSTEM_ARCH}
/p:Platform=${_csc_PLATFORM}
/p:VCPkgLocalAppDataDisabled=true
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME build-${TARGET_TRIPLET}-rel
@ -24,7 +64,7 @@ function(vcpkg_build_msbuild)
vcpkg_execute_required_process(
COMMAND msbuild ${_csc_PROJECT_PATH} ${_csc_OPTIONS} ${_csc_OPTIONS_DEBUG}
/p:Configuration=${_csc_DEBUG_CONFIGURATION}
/p:Platform=${TRIPLET_SYSTEM_ARCH}
/p:Platform=${_csc_PLATFORM}
/p:VCPkgLocalAppDataDisabled=true
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
LOGNAME build-${TARGET_TRIPLET}-dbg

View File

@ -1,7 +1,7 @@
# Usage: vcpkg_execute_required_process(COMMAND <cmd> [<args>...] WORKING_DIRECTORY </path/to/dir> LOGNAME <my_log_name>)
function(vcpkg_execute_required_process)
cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
#debug_message("vcpkg_execute_required_process(${vcpkg_execute_required_process_COMMAND})")
debug_message("vcpkg_execute_required_process(${vcpkg_execute_required_process_COMMAND})")
execute_process(
COMMAND ${vcpkg_execute_required_process_COMMAND}
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log