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
2023-06-14 11:11:37 +08:00
R E F " m a t h g l % 2 0 8 . 0 "
2023-01-07 16:59:30 +08:00
F I L E N A M E " m a t h g l - $ { V E R S I O N } . t a r . g z "
S H A 5 1 2 1 f f 3 0 2 3 f 1 b b d 7 b f d 8 4 2 0 2 7 7 7 a 0 1 6 6 a 8 d 4 2 5 5 a 0 2 0 a 0 7 f 3 6 5 0 b 9 8 5 8 9 2 9 3 4 5 b c 8 a 2 c e e a 4 d b 1 5 5 d 2 c 9 3 b a 3 2 b 7 6 2 d 2 3 0 4 4 7 4 2 7 6 2 9 0 a 9 e d a c 9 9 f d a 7 0 f b 4 b 5 b c 1 2 9 8 2 c 2
2020-06-27 06:06:30 +08:00
P A T C H E S
2023-01-07 16:59:30 +08:00
c m a k e - c o n f i g . p a t c h
d e p e n d e n c i e s . p a t c h
l i n k a g e . p a t c h
e n a b l e - e x a m p l e s . p a t c h
f i x - e x a m p l e s . p a t c h
f i x - c r o s s - b u i l d s . p a t c h
f i x - f o r m a t - s p e c i f i e r s . p a t c h
f i x - g l u t . p a t c h
f i x - m g l l a b . p a t c h
2023-04-27 12:05:37 +08:00
i n c l u d e _ f u n c t i o n a l . p a t c h
2023-04-27 03:13:02 +08:00
f i x - i n c l u d e - p r o p e r t y . p a t c h
2023-06-08 00:36:42 +08:00
f i x _ l i n k _ g s l . p a t c h
2019-05-25 05:42:47 +08:00
)
2023-01-07 16:59:30 +08:00
file ( REMOVE_RECURSE "${SOURCE_PATH}/addons/getopt" )
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
2023-01-07 16:59:30 +08:00
a r m a e n a b l e - a r m a
e x a m p l e s e n a b l e - e x a m p l e s
2019-10-08 03:25:09 +08:00
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
2023-01-07 16:59:30 +08:00
g l u t e n a b l e - g l u t
2019-10-08 03:25:09 +08:00
g s l e n a b l e - g s l
2023-01-07 16:59:30 +08:00
h d f 5 e n a b l e - h d f 5
j p e g e n a b l e - j p e g
2019-10-08 03:25:09 +08:00
o p e n g l e n a b l e - o p e n g l
2023-01-07 16:59:30 +08:00
p n g e n a b l e - p n g
2019-10-08 03:25:09 +08:00
q t 5 e n a b l e - q t 5
2023-01-07 16:59:30 +08:00
w x e n a b l e - w x
z l i b e n a b l e - z l i b
2019-10-08 03:25:09 +08:00
)
2019-05-25 05:42:47 +08:00
2023-01-07 16:59:30 +08:00
if ( VCPKG_TARGET_IS_OSX )
list ( APPEND FEATURE_OPTIONS
- D e n a b l e - o p e n m p = O F F
- D e n a b l e - p t h r e a d = O N
)
endif ( )
if ( VCPKG_CROSSCOMPILING )
list ( APPEND FEATURE_OPTIONS "-DMAKE_BIN_EXECUTABLE=${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}/make_bin${VCPKG_HOST_EXECUTABLE_SUFFIX}" )
endif ( )
2021-11-30 09:01:04 +08:00
vcpkg_cmake_configure (
2023-01-07 16:59:30 +08:00
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
O P T I O N S
$ { F E A T U R E _ O P T I O N S }
" - D C M A K E _ P R O J E C T _ I N C L U D E = $ { C M A K E _ C U R R E N T _ L I S T _ D I R } / c m a k e - p r o j e c t - i n c l u d e . c m a k e "
- D M a t h G L _ I N S T A L L _ C M A K E _ D I R : S T R I N G = s h a r e / m a t h g l 2
- D C M A K E _ C X X _ S T A N D A R D = 1 1 # minimum for armadillo on osx
- D C M A K E _ D I S A B L E _ F I N D _ P A C K A G E _ I n t l = 1
- D C M A K E _ P O L I C Y _ D E F A U L T _ C M P 0 1 2 7 = N E W # cmake_dependent_option condition syntax
2019-05-25 05:42:47 +08:00
)
2021-11-30 09:01:04 +08:00
vcpkg_cmake_install ( )
2019-05-25 05:42:47 +08:00
2023-01-07 16:59:30 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mgl2/dllexport.h" "#ifdef MGL_STATIC_DEFINE" "#if 1" )
2019-05-25 05:42:47 +08:00
else ( )
2023-01-07 16:59:30 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mgl2/dllexport.h" "#ifdef MGL_STATIC_DEFINE" "#if 0" )
2019-05-25 05:42:47 +08:00
endif ( )
2023-01-07 16:59:30 +08:00
# MathGL exports proper CMake config under the MathGL2Config.cmake filename, and
# a find_path/find_library based package under the mathgl2-config.cmake filename.
# The latter doesn't support multi-config or static linkage requirements, and
# the variable names don't match the package names, i.e. it is unusable.
if ( VCPKG_TARGET_IS_WINDOWS )
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 ( )
2023-01-07 16:59:30 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/cmake" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake" )
2019-05-25 05:42:47 +08:00
endif ( )
2023-01-07 16:59:30 +08:00
vcpkg_cmake_config_fixup ( PACKAGE_NAME mathgl2 )
2019-05-25 05:42:47 +08:00
2023-01-07 16:59:30 +08:00
file ( REMOVE_RECURSE
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / s h a r e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / i n c l u d e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / a p p l i c a t i o n s "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / m i m e "
" $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / p i x m a p s "
)
set ( tools mglconv mgltask )
if ( NOT VCPKG_CROSSCOMPILING )
list ( APPEND tools make_bin )
2019-09-13 04:31:04 +08:00
endif ( )
2023-01-07 16:59:30 +08:00
if ( enable-fltk )
list ( APPEND tools mglview mgllab )
2019-10-08 03:25:09 +08:00
endif ( )
2023-01-07 16:59:30 +08:00
if ( enable-qt5 )
list ( APPEND tools mglview udav )
2019-05-25 05:42:47 +08:00
endif ( )
2023-01-07 16:59:30 +08:00
list ( REMOVE_DUPLICATES tools )
vcpkg_copy_tools ( TOOL_NAMES ${ tools } AUTO_CLEAN )
2019-05-25 05:42:47 +08:00
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 } \"" "" )
2024-06-20 05:07:05 +08:00
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mgl2/config.h" "#define MGL_FONT_PATH\t\" ${ CURRENT_PACKAGES_DIR } /fonts\ "" "" IGNORE_UNCHANGED ) # there is no fonts folder
vcpkg_replace_string ( "${CURRENT_PACKAGES_DIR}/include/mgl2/config.h" "#define MGL_FONT_PATH\t\" ${ CURRENT_PACKAGES_DIR } /share/mathgl/fonts\ "" "" IGNORE_UNCHANGED )
2021-11-30 09:01:04 +08:00
2023-01-07 16:59:30 +08:00
file ( INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" )
2023-04-27 12:05:37 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/COPYING" )