diff options
| author | Shelley Lake <jutta.anders@gmx.at> | 2019-04-02 21:55:16 +0200 |
|---|---|---|
| committer | Phil Christensen <philc@microsoft.com> | 2019-04-02 12:55:16 -0700 |
| commit | 280200a95d3c620631022453ba87626b6ded6f34 (patch) | |
| tree | 54d9dab48618c3bd88e5d185161b851d46aad58d | |
| parent | a0415b38a903bb0b51991899e84685e7a3663f61 (diff) | |
| download | vcpkg-280200a95d3c620631022453ba87626b6ded6f34.tar.gz vcpkg-280200a95d3c620631022453ba87626b6ded6f34.zip | |
[osg] static build (#5913)
| -rw-r--r-- | ports/osg/CONTROL | 2 | ||||
| -rw-r--r-- | ports/osg/portfile.cmake | 25 | ||||
| -rw-r--r-- | ports/osg/static.patch | 7 |
3 files changed, 27 insertions, 7 deletions
diff --git a/ports/osg/CONTROL b/ports/osg/CONTROL index 2cca0cdaa..e78458d25 100644 --- a/ports/osg/CONTROL +++ b/ports/osg/CONTROL @@ -1,5 +1,5 @@ Source: osg -Version: 3.6.2 +Version: 3.6.2-1 Description: The OpenSceneGraph is an open source high performance 3D graphics toolkit. Build-Depends: freetype, jasper, openexr, zlib, gdal, giflib, libjpeg-turbo, libpng, tiff diff --git a/ports/osg/portfile.cmake b/ports/osg/portfile.cmake index e72b5807b..98a0ec293 100644 --- a/ports/osg/portfile.cmake +++ b/ports/osg/portfile.cmake @@ -11,10 +11,6 @@ # include(vcpkg_common_functions) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - message(STATUS "Warning: Static building will not support load data through plugins.") - set(VCPKG_LIBRARY_LINKAGE dynamic) -endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH @@ -24,15 +20,24 @@ vcpkg_from_github( HEAD_REF master PATCHES "${CMAKE_CURRENT_LIST_DIR}/collada.patch" + "${CMAKE_CURRENT_LIST_DIR}/static.patch" ) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(OSG_DYNAMIC OFF) +else() + set(OSG_DYNAMIC ON) +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} # PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS -DOSG_USE_UTF8_FILENAME=ON - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 + -DDYNAMIC_OPENSCENEGRAPH=${OSG_DYNAMIC} + -DDYNAMIC_OPENTHREADS=${OSG_DYNAMIC} + -DBUILD_OSG_EXAMPLES=ON + -DBUILD_OSG_APPLICATIONS=ON ) vcpkg_install_cmake() @@ -59,3 +64,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin/osgPlugins-3.6.2/) # Handle copyright file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/osg) file(RENAME ${CURRENT_PACKAGES_DIR}/share/osg/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/osg/copyright) + +#Cleanup +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +endif()
\ No newline at end of file diff --git a/ports/osg/static.patch b/ports/osg/static.patch new file mode 100644 index 000000000..c7278d282 --- /dev/null +++ b/ports/osg/static.patch @@ -0,0 +1,7 @@ +--- a/src/osgPlugins/curl/CMakeLists.txt
++++ b/src/osgPlugins/curl/CMakeLists.txt
+@@ -35,3 +35,3 @@
+ ADD_DEFINITIONS(-DCURL_STATICLIB)
+- SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32 winmm wldap32)
++ SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32 winmm wldap32 crypt32)
+ ENDIF()
|
