2021-12-29 07:11:14 +08:00
set ( MATHGL_VERSION "2.5" )
2019-05-25 05:42:47 +08:00
2020-06-27 06:06:30 +08:00
vcpkg_from_sourceforge (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O m a t h g l / m a t h g l
R E F m a t h g l % 2 0 $ { M A T H G L _ V E R S I O N }
F I L E N A M E " m a t h g l - $ { M A T H G L _ V E R S I O N } . t a r . g z "
2021-12-29 07:11:14 +08:00
S H A 5 1 2 1 f e 2 7 9 6 2 f f e f 8 d 7 1 2 7 c 4 e 1 2 9 4 d 7 3 5 e 5 d a 4 d d 2 d 6 4 7 3 9 7 f 0 9 7 0 5 c 3 c a 8 6 0 f 9 0 b d 0 6 f d 4 4 7 f f 6 1 4 e 5 8 4 f 3 d 2 b 8 7 4 a 0 2 2 6 2 c 5 5 1 8 b e 3 7 d 5 9 e 9 e 0 a 8 3 8 d d 5 b 8 b 6 4 f d 7 7 e f 9 d
2020-06-27 06:06:30 +08:00
P A T C H E S
f i x _ c m a k e l i s t s _ a n d _ c p p . p a t c h
2021-12-29 07:11:14 +08:00
f i x _ a t t r i b u t e . p a t c h
f i x _ d e f a u l t _ g r a p h _ i n i t . p a t c h
f i x _ m g l D a t a L i s t . p a t c h
f i x _ a r m a _ s p r i n t f . p a t c h
2019-05-25 05:42:47 +08:00
)
2019-10-08 03:25:09 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2021-12-29 07:11:14 +08:00
F E A T U R E S
2019-10-08 03:25:09 +08:00
h d f 5 e n a b l e - h d f 5
f l t k e n a b l e - f l t k
g i f e n a b l e - g i f
2021-12-29 07:11:14 +08:00
a r m a e n a b l e - a r m a
2019-10-08 03:25:09 +08:00
p n g e n a b l e - p n g
z l i b e n a b l e - z l i b
j p e g e n a b l e - j p e g
g s l e n a b l e - g s l
o p e n g l e n a b l e - o p e n g l
g l u t e n a b l e - g l u t
w x e n a b l e - w x
q t 5 e n a b l e - q t 5
)
2019-05-25 05:42:47 +08:00
2021-11-30 09:01:04 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2019-10-08 03:25:09 +08:00
O P T I O N S $ { F E A T U R E _ O P T I O N S }
2019-05-25 05:42:47 +08:00
)
2021-11-30 09:01:04 +08:00
vcpkg_cmake_install ( )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
2019-05-25 05:42:47 +08:00
if ( NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
2021-11-30 09:01:04 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH cmake )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/mathgl2-config.cmake" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/mathgl2-config.cmake" )
2019-05-25 05:42:47 +08:00
else ( )
2021-12-29 07:11:14 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/mathgl2 )
2019-05-25 05:42:47 +08:00
endif ( )
2021-11-30 09:01:04 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )
2019-05-25 05:42:47 +08:00
#somehow the native CMAKE_EXECUTABLE_SUFFIX does not work, so here we emulate it
if ( CMAKE_HOST_WIN32 )
set ( EXECUTABLE_SUFFIX ".exe" )
else ( )
set ( EXECUTABLE_SUFFIX "" )
endif ( )
2021-11-30 09:01:04 +08:00
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/mgllab${EXECUTABLE_SUFFIX}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/mglview${EXECUTABLE_SUFFIX}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/mglconv${EXECUTABLE_SUFFIX}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/mgltask${EXECUTABLE_SUFFIX}" )
file ( REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/udav${EXECUTABLE_SUFFIX}" )
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/mathgl/" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/mglconv${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/mathgl/mglconv${EXECUTABLE_SUFFIX}" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/mgltask${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/mathgl/mgltask${EXECUTABLE_SUFFIX}" )
if ( EXISTS "${CURRENT_PACKAGES_DIR}/bin/mgllab${EXECUTABLE_SUFFIX}" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/mgllab${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/mathgl/mgllab${EXECUTABLE_SUFFIX}" )
2019-09-13 04:31:04 +08:00
endif ( )
2021-11-30 09:01:04 +08:00
if ( "EXISTS ${CURRENT_PACKAGES_DIR}/bin/mglview${EXECUTABLE_SUFFIX}" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/mglview${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/mathgl/mglview${EXECUTABLE_SUFFIX}" )
2019-09-13 04:31:04 +08:00
endif ( )
2021-11-30 09:01:04 +08:00
if ( EXISTS "${CURRENT_PACKAGES_DIR}/bin/udav${EXECUTABLE_SUFFIX}" )
file ( RENAME "${CURRENT_PACKAGES_DIR}/bin/udav${EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/mathgl/udav${EXECUTABLE_SUFFIX}" )
2019-10-08 03:25:09 +08:00
endif ( )
2019-09-13 04:31:04 +08:00
2021-11-30 09:01:04 +08:00
vcpkg_copy_tool_dependencies ( "${CURRENT_PACKAGES_DIR}/tools/mathgl" )
2019-05-25 05:42:47 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
2021-11-30 09:01:04 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2019-05-25 05:42:47 +08:00
endif ( )
2021-11-30 09:01:04 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mgl2/config.h" "#define MGL_INSTALL_DIR \" ${ CURRENT_PACKAGES_DIR } \"" "" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mgl2/config.h" "#define MGL_FONT_PATH \" ${ CURRENT_PACKAGES_DIR } /fonts\ "" "" ) # there is no fonts folder
file ( INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/mathgl" RENAME copyright )