aboutsummaryrefslogtreecommitdiff
path: root/ports/aubio/portfile.cmake
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-20 02:52:02 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-06-28 13:37:52 -0700
commita2cee615e4c444d5ce84fac618bfb2b18cd6985f (patch)
treece736fa5323eb28e5ea42e3a600d981406ce12bd /ports/aubio/portfile.cmake
parent4509e764cc691a0ae097ef512bda2095cf477152 (diff)
downloadvcpkg-a2cee615e4c444d5ce84fac618bfb2b18cd6985f.tar.gz
vcpkg-a2cee615e4c444d5ce84fac618bfb2b18cd6985f.zip
[aubio] CMake buildsystem replacement
Diffstat (limited to 'ports/aubio/portfile.cmake')
-rw-r--r--ports/aubio/portfile.cmake91
1 files changed, 7 insertions, 84 deletions
diff --git a/ports/aubio/portfile.cmake b/ports/aubio/portfile.cmake
index 714ec3ae8..e8a7d4551 100644
--- a/ports/aubio/portfile.cmake
+++ b/ports/aubio/portfile.cmake
@@ -1,14 +1,3 @@
-# NOTES
-# - if you get a codepage/unicode related error (non-critical) during configuration,
-# ignore it or, try switching the console codepage to windows english (`chcp 1252`)
-# - the build breaks with "missing pthreads" if --enable-fftw3(f) is added (if fftw3
-# is not added, the embedded ooura fft lib is used)
-# - the port uses ffmpeg and libsndfile as dependencies and also depends on possibilty to acquire waf and pkg-config(-lite) in vcpkg.
-# - crt-linkage is handled here, not in the generic waf-configure function because it is controlled via a patch to the aubio wscript
-# Waf seems to have no generic way to switch crt-linkage.
-# - The static build works, but: vcpkg's static ffmpegs build is fake ;), therefore it is still required to make the ffmpeg dlls
-# available in order to run exectables with statically linked aubio.
-
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/aubio-3c230fae309e9ea3298783368dd71bae6172359a)
vcpkg_download_distfile(ARCHIVE
@@ -18,78 +7,14 @@ vcpkg_download_distfile(ARCHIVE
)
vcpkg_extract_source_archive(${ARCHIVE})
-# Pkg-config is equired by aubio to detect ffmpeg and libsndfile
-vcpkg_find_acquire_program(PKG-CONFIG)
-
-# Waf depends on python, so this also installs python3
-vcpkg_acquire_waf()
-
-# Configure pkg-config dir
-get_filename_component(PKG_CONFIG_DIR ${PKG-CONFIG} DIRECTORY)
-# Add pkg-config and vcpkg-bin-dir to environment search path
-set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/debug/bin;${PKG_CONFIG_DIR};$ENV{PATH}")
-# Set pkg-config search-path
-set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/aubio-5.def ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
-# Add waf executable if missing
-if(NOT EXISTS "${SOURCE_PATH}/waf")
- file(COPY "${WAF_DIR}/waf" DESTINATION "${SOURCE_PATH}")
-endif()
-
-# Add arguments for crt linkage and library linkage
-vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
- PATCHES "${CMAKE_CURRENT_LIST_DIR}/crt_lib_linkage.patch"
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=1
)
-
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/aubio-5.def DESTINATION ${SOURCE_PATH})
-
-vcpkg_configure_waf(
- SOURCE_PATH ${SOURCE_PATH}
- OPTIONS
- --library-linkage=${VCPKG_LIBRARY_LINKAGE}
- --crt-linkage=${VCPKG_CRT_LINKAGE}
- --enable-sndfile
- --enable-avcodec
- --disable-docs
- --verbose
- # OPTIONS_DEBUG
- # OPTIONS_RELEASE
- OPTIONS_BUILD
- --library-linkage=${VCPKG_LIBRARY_LINKAGE}
- --verbose
- --notests
- # OPTIONS_BUILD_RELEASE
- # OPTIONS_BUILD_DEBUG
- # TARGETS
-)
-
-# Postinstall cleanup debug
-message(STATUS "Cleaning up build")
-# Remove unused files
-# Debug executable and include folder
-file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
-file(GLOB DEBUG_EXECS ${CURRENT_PACKAGES_DIR}/debug/bin/*)
-file(REMOVE ${DEBUG_EXECS})
-# In release branch move execs to tools
-file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/aubio)
-file(GLOB RELEASE_EXECS ${CURRENT_PACKAGES_DIR}/bin/*.exe)
-file(GLOB RELEASE_EXE_SYMBOLS ${CURRENT_PACKAGES_DIR}/bin/*.pdb)
-FILE(COPY ${RELEASE_EXECS} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/aubio)
-FILE(REMOVE ${RELEASE_EXECS} ${RELEASE_EXE_SYMBOLS})
-
-# Prepare (re-)moving dynamic libs
-file(GLOB DEBUG_DLLS ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll ${CURRENT_PACKAGES_DIR}/debug/lib/*.pdb)
-file(GLOB RELEASE_DLLS ${CURRENT_PACKAGES_DIR}/lib/*.dll ${CURRENT_PACKAGES_DIR}/lib/*.pdb)
-
-if(${VCPKG_LIBRARY_LINKAGE} MATCHES "dynamic")
- # Move dlls
- file(COPY ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
- file(COPY ${RELEASE_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
- file(REMOVE ${DEBUG_DLLS} ${RELEASE_DLLS})
-elseif(${VCPKG_LIBRARY_LINKAGE} MATCHES "static")
- file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
-endif()
+vcpkg_install_cmake()
# Handle copyright and credentials
file(COPY
@@ -100,7 +25,5 @@ file(COPY
DESTINATION
${CURRENT_PACKAGES_DIR}/share/aubio)
+vcpkg_copy_pdbs()
file(RENAME ${CURRENT_PACKAGES_DIR}/share/aubio/COPYING ${CURRENT_PACKAGES_DIR}/share/aubio/copyright)
-
-# TODO
-# Add python script for dynamic symbols export in dynamic linking