2019-05-25 05:42:47 +08:00
set ( MATHGL_VERSION "2.4.3" )
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 "
S H A 5 1 2 e 4 7 f c 8 1 7 1 c e 8 0 c 8 b 3 3 a 8 f 0 3 d 9 3 7 5 b c 0 3 6 4 5 5 d a e 5 3 9 b 4 7 c f 4 e e 9 2 2 f 8 f a 3 6 f 5 a f c f 8 b 3 f 0 6 6 6 9 9 7 7 6 4 e 4 5 3 e b 6 9 8 c 0 e 8 c 0 3 d a 3 6 d d 0 a c 2 b f 7 1 c 1 5 8 e 9 5 3 0 9 b 2 4 7 d 2 7 d e
P A T C H E S
t y p e _ f i x . p a t c h
f i x _ c m a k e l i s t s _ a n d _ c p p . 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
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
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-11-30 09:01:04 +08:00
vcpkg_cmake_config_fixup ( CONFIG_PATH lib/cmake/mathgl )
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 )