Corrade and Magnum on Linux (#3611)

* Corrade and Magnum on Linux

Removed ".exe" extension for executables on Linux.
Removed default feature magnum[windowlesswglapplication] which works
only on Windows.

* Switched to CMAKE_EXECUTABLE_SUFFIX

* [corrade] Remove use of CMAKE_EXECUTABLE_SUFFIX

* [magnum] Avoid usages of CMAKE_EXECUTABLE_SUFFIX
This commit is contained in:
lecopivo 2018-07-04 16:12:51 +02:00 committed by Robert Schumacher
parent 0c2d34331c
commit 7c4e262e50
3 changed files with 25 additions and 19 deletions

View File

@ -7,11 +7,7 @@ vcpkg_from_github(
HEAD_REF master
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
set(BUILD_STATIC 1)
else()
set(BUILD_STATIC 0)
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
# Handle features
set(_COMPONENT_FLAGS "")
@ -45,16 +41,20 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
# Install tools
if("utility" IN_LIST FEATURES)
file(GLOB EXES
${CURRENT_PACKAGES_DIR}/bin/corrade-rc
${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe
)
# Drop a copy of tools
file(COPY ${CURRENT_PACKAGES_DIR}/bin/corrade-rc.exe
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade)
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/corrade)
# Tools require dlls
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/corrade)
file(GLOB_RECURSE TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/*.exe
${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
file(GLOB TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/corrade-rc*
${CURRENT_PACKAGES_DIR}/debug/bin/corrade-rc*)
file(REMOVE ${TO_REMOVE})
endif()
@ -68,7 +68,7 @@ if(NOT FEATURES)
# debug is completely empty, as include and share
# have already been removed.
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL static)
elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# No dlls
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin

View File

@ -2,7 +2,7 @@ Source: magnum
Version: 2018.04-1
Build-Depends: corrade[pluginmanager], corrade[utility]
Description: C++11/C++14 graphics middleware for games and data visualization http://magnum.graphics/
Default-Features: anyimageimporter, anyaudioimporter, anyimageconverter, anysceneimporter, debugtools, gl, meshtools, primitives, scenegraph, shaders, shapes, text, texturetools, trade, sdl2application, windowlesswglapplication
Default-Features: anyimageimporter, anyaudioimporter, anyimageconverter, anysceneimporter, debugtools, gl, meshtools, primitives, scenegraph, shaders, shapes, text, texturetools, trade, sdl2application
Feature: al-info
Description: magnum-al-info utility

View File

@ -53,25 +53,31 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
# Drop a copy of tools
if(NOT VCPKG_CMAKE_SYSTEM_NAME)
set(EXE_SUFFIX .exe)
else()
set(EXE_SUFFIX)
endif()
if(distancefieldconverter IN_LIST FEATURES)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-distancefieldconverter.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-distancefieldconverter${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
endif()
if(fontconverter IN_LIST FEATURES)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-fontconverter.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-fontconverter${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
endif()
if(al-info IN_LIST FEATURES)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-al-info.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-al-info${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
endif()
if(magnuminfo IN_LIST FEATURES)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-info.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
file(COPY ${CURRENT_PACKAGES_DIR}/bin/magnum-info${EXE_SUFFIX} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/magnum)
endif()
# Tools require dlls
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/magnum)
file(GLOB_RECURSE TO_REMOVE
${CURRENT_PACKAGES_DIR}/bin/*.exe
${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
${CURRENT_PACKAGES_DIR}/bin/*${EXE_SUFFIX}
${CURRENT_PACKAGES_DIR}/debug/bin/*${EXE_SUFFIX})
if(TO_REMOVE)
file(REMOVE ${TO_REMOVE})
endif()
@ -79,7 +85,7 @@ endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
# move plugin libs to conventional place