File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,25 +15,20 @@ include(UseCython)
1515
1616# FetchContent_MakeAvailable(gd)
1717
18- find_library (libgd
19- gd
20- REQUIRED
21- )
22- message (STATUS "libgd found at ${libgd} " )
18+ set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR } /cmake"
19+ )
2320
24- find_path (gd_include_path
25- "gd.h"
26- REQUIRED )
27-
28- message (STATUS "gd.h found at ${gd_include_path} " )
21+ find_package (GD
22+ MODULE
23+ REQUIRED
24+ )
2925
3026cython_transpile (py_gd/py_gd.pyx
3127 LANGUAGE C
3228 OUTPUT_VARIABLE py_gd_c )
3329
3430python_add_library (py_gd MODULE "${py_gd_c} " WITH_SOABI )
35- target_link_libraries (py_gd PUBLIC "${libgd} " Python::NumPy )
36- target_include_directories (py_gd PUBLIC "${gd_include_path} " )
31+ target_link_libraries (py_gd PUBLIC GD::GD Python::NumPy )
3732install (TARGETS py_gd DESTINATION py_gd)
3833
3934
Original file line number Diff line number Diff line change 1+
2+ find_path (GD_INCLUDE_DIR
3+ "gd.h"
4+ REQUIRED )
5+
6+ find_library (GD_LIBRARY
7+ gd
8+ REQUIRED
9+ )
10+
11+ message (STATUS "libgd found at ${GD_LIBRARY} , ${GD_INCLUDE_DIR} " )
12+
13+ include (FindPackageHandleStandardArgs )
14+ find_package_handle_standard_args (GD
15+ REQUIRED_VARS
16+ GD_LIBRARY
17+ GD_INCLUDE_DIR
18+ VERSION_VAR GD_VERSION
19+ )
20+
21+ if (GD_FOUND)
22+ set (GD_LIBRARIES "${GD_LIBRARY} " )
23+ set (GD_INCLUDE_DIRS "${GD_INCLUDE_DIR} " )
24+ endif ()
25+
26+ if (GD_FOUND AND NOT TARGET GD::GD)
27+ add_library (GD::GD UNKNOWN IMPORTED )
28+ set_target_properties (GD::GD PROPERTIES
29+ IMPORTED_LOCATION "${GD_LIBRARY} "
30+ INTERFACE_INCLUDE_DIRECTORIES "${GD_INCLUDE_DIR} "
31+ )
32+ endif ()
33+
34+ mark_as_advanced (
35+ GD_INCLUDE_DIR
36+ GD_LIBRARY
37+ )
38+
Original file line number Diff line number Diff line change 1313import sys
1414import os
1515
16- __version__ = "2.3.2 "
16+ __version__ = "2.3.3 "
1717
1818if sys .platform .startswith ('win' ):
1919 # This only works for Anaconda / miniconda
You can’t perform that action at this time.
0 commit comments