diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2016-10-02 20:09:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-02 20:09:51 -0700 |
| commit | 3b2425833bfe8f11ba673c97864e8626aad683d7 (patch) | |
| tree | bf6d800451847335adb2629e82087e2bc99a0a9d | |
| parent | 3791fd9c10bfeab4a48c65a5ac7a4f2001623336 (diff) | |
| parent | 6cf29cdfb6ca86332cee8b221ed4e6c46dc025b9 (diff) | |
| download | vcpkg-3b2425833bfe8f11ba673c97864e8626aad683d7.tar.gz vcpkg-3b2425833bfe8f11ba673c97864e8626aad683d7.zip | |
Merge pull request #108 from traversaro/add-ace-port
Add ace port
| -rw-r--r-- | ports/ace/CONTROL | 3 | ||||
| -rw-r--r-- | ports/ace/portfile.cmake | 88 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_msbuild.cmake | 46 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_execute_required_process.cmake | 2 |
4 files changed, 135 insertions, 4 deletions
diff --git a/ports/ace/CONTROL b/ports/ace/CONTROL new file mode 100644 index 000000000..352d2b74a --- /dev/null +++ b/ports/ace/CONTROL @@ -0,0 +1,3 @@ +Source: ace +Version: 6.4.0 +Description: The ADAPTIVE Communication Environment diff --git a/ports/ace/portfile.cmake b/ports/ace/portfile.cmake new file mode 100644 index 000000000..f74ffe319 --- /dev/null +++ b/ports/ace/portfile.cmake @@ -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) diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index bf7c1b546..5b422fe5e 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -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 diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index bd6e56f7b..e10a12678 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -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 |
