diff --git a/ports/glbinding/portfile.cmake b/ports/glbinding/portfile.cmake index 5b928445fb..ada070089b 100644 --- a/ports/glbinding/portfile.cmake +++ b/ports/glbinding/portfile.cmake @@ -8,9 +8,6 @@ include(${CMAKE_TRIPLET_FILE}) include(vcpkg_common_functions) -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(FATAL_ERROR "Portfile not yet modified for building glbinding statically") -endif() vcpkg_download_distfile(ARCHIVE URLS "https://github.com/cginternals/glbinding/archive/v2.1.1.zip" @@ -18,14 +15,7 @@ vcpkg_download_distfile(ARCHIVE SHA512 66b21853a4f4760b7b22cafd5211958769c513e83be999018fe79cf56a9271e0e28566caaa2286393f54ac2154d564a68d12159598d03c965adf6756f3753f11 ) vcpkg_extract_source_archive(${ARCHIVE}) - -vcpkg_configure_cmake( - SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1 - # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 -) - +vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/glbinding-2.1.1) vcpkg_build_cmake() vcpkg_install_cmake() @@ -39,10 +29,13 @@ file(READ ${CURRENT_PACKAGES_DIR}/debug/cmake/glbinding/glbinding-export-debug.c string(REPLACE "\${IMPORT_PREFIX}" "\${IMPORT_PREFIX}/debug" GLBINDING_DEBUG_MODULE "${GLBINDING_DEBUG_MODULE}") file(WRITE ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-export-debug.cmake "${GLBINDING_DEBUG_MODULE}") file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding-config.cmake ${CURRENT_PACKAGES_DIR}/share/glbinding/glbinding-config.cmake) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) -file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) -file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/glbinding-config.cmake) +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) + file(RENAME ${CURRENT_PACKAGES_DIR}/glbinding.dll ${CURRENT_PACKAGES_DIR}/bin/glbinding.dll) + file(RENAME ${CURRENT_PACKAGES_DIR}/debug/glbindingd.dll ${CURRENT_PACKAGES_DIR}/debug/bin/glbindingd.dll) +endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/cmake) file(RENAME ${CURRENT_PACKAGES_DIR}/data ${CURRENT_PACKAGES_DIR}/share/data) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/data) diff --git a/ports/range-v3/CONTROL b/ports/range-v3/CONTROL index 712e295d74..aa8ad164de 100644 --- a/ports/range-v3/CONTROL +++ b/ports/range-v3/CONTROL @@ -1,3 +1,3 @@ Source: range-v3 -Version: 0.0.0-2 +Version: 20150729-vcpkg2 Description: Range library for C++11/14/17. diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index 03b69e510f..f956bc8daa 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -30,16 +30,35 @@ function(vcpkg_configure_cmake) endif() if(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=ON) + elseif(DEFINED VCPKG_LIBRARY_LINKAGE AND VCPKG_LIBRARY_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS -DBUILD_SHARED_LIBS=OFF) endif() + list(APPEND _csc_OPTIONS "-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc" "-DCMAKE_C_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8" ) - + if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic) + list(APPEND _csc_OPTIONS_DEBUG + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_C_FLAGS_RELEASE=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1" + ) + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" + "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" + ) + elseif(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static) + list(APPEND _csc_OPTIONS_DEBUG + "-DCMAKE_CXX_FLAGS_DEBUG=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" + "-DCMAKE_C_FLAGS_RELEASE=/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1" + ) + list(APPEND _csc_OPTIONS_RELEASE + "-DCMAKE_CXX_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" + "-DCMAKE_C_FLAGS_RELEASE=/MT /O2 /Oi /Gy /DNDEBUG /Zi" + ) + endif() list(APPEND _csc_OPTIONS_RELEASE - "-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" - "-DCMAKE_C_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi" "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF" )