From d0557c38d9b3606d00d3f085ca11b29f0ea8a88e Mon Sep 17 00:00:00 2001 From: "James.Makela" Date: Fri, 7 Jun 2024 20:24:53 -0700 Subject: [PATCH 1/2] Cleanup the CMakeLists.txt file a bit. --- py_gnome/CMakeLists.txt | 43 ++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/py_gnome/CMakeLists.txt b/py_gnome/CMakeLists.txt index aeb2ffde5..78c07be83 100644 --- a/py_gnome/CMakeLists.txt +++ b/py_gnome/CMakeLists.txt @@ -104,21 +104,35 @@ target_include_directories(lib_gnome PUBLIC lib_gnome) install(TARGETS lib_gnome LIBRARY DESTINATION gnome/cy_gnome) -foreach(ext IN LISTS EXT_NAMES) +set(CY_EXT_SOURCE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}/gnome/cy_gnome +) +set(CY_EXT_BINARY_DIR + ${CMAKE_CURRENT_BINARY_DIR}/gnome/cy_gnome +) + +# cython can't create the output .cpp file if the underlying directory +# doesn't exist. +if(NOT EXISTS ${CY_EXT_BINARY_DIR}) + message("Creating output directory '${CY_EXT_BINARY_DIR}'") + file(MAKE_DIRECTORY "${CY_EXT_BINARY_DIR}") +endif() + +foreach(ext IN LISTS EXT_NAMES) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/gnome/cy_gnome/${ext}.cpp" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/gnome/cy_gnome/${ext}.pyx" + OUTPUT "${CY_EXT_BINARY_DIR}/${ext}.cpp" + DEPENDS "${CY_EXT_SOURCE_DIR}/${ext}.pyx" VERBATIM COMMAND "${CYTHON}" --cplus -3 - "${CMAKE_CURRENT_SOURCE_DIR}/gnome/cy_gnome/${ext}.pyx" + "${CY_EXT_SOURCE_DIR}/${ext}.pyx" --output-file - "${CMAKE_CURRENT_BINARY_DIR}/gnome/cy_gnome/${ext}.cpp" + "${CY_EXT_BINARY_DIR}/${ext}.cpp" ) python_add_library( ${ext} - MODULE "${CMAKE_CURRENT_BINARY_DIR}/gnome/cy_gnome/${ext}.cpp" + MODULE "${CY_EXT_BINARY_DIR}/${ext}.cpp" WITH_SOABI ) @@ -140,6 +154,13 @@ endforeach() # Extension: cy_point_in_polygon # +set(GEO_SOURCE_DIR + ${CMAKE_CURRENT_SOURCE_DIR}/gnome/utilities/geometry +) +set(GEO_BINARY_DIR + ${CMAKE_CURRENT_BINARY_DIR}/gnome/utilities/geometry +) + # Now we make the c_point_in_polygon.c file into a library # This will have to do until we figure out how to make a .pyx extension with # additional .c files @@ -156,18 +177,18 @@ install(TARGETS point_in_polygon DESTINATION gnome/utilities/geometry) # now we make the cy_point_in_polygon extension add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/gnome/utilities/geometry/cy_point_in_polygon.c" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/gnome/utilities/geometry/cy_point_in_polygon.pyx" + OUTPUT "${GEO_BINARY_DIR}/cy_point_in_polygon.c" + DEPENDS "${GEO_SOURCE_DIR}/cy_point_in_polygon.pyx" VERBATIM COMMAND "${CYTHON}" -3 -v - "${CMAKE_CURRENT_SOURCE_DIR}/gnome/utilities/geometry/cy_point_in_polygon.pyx" + "${GEO_SOURCE_DIR}/cy_point_in_polygon.pyx" --output-file - "${CMAKE_CURRENT_BINARY_DIR}/gnome/utilities/geometry/cy_point_in_polygon.c" + "${GEO_BINARY_DIR}/cy_point_in_polygon.c" ) python_add_library( cy_point_in_polygon - MODULE "${CMAKE_CURRENT_BINARY_DIR}/gnome/utilities/geometry/cy_point_in_polygon.c" + MODULE "${GEO_BINARY_DIR}/cy_point_in_polygon.c" WITH_SOABI ) From b7670bdb2fe3c92fea65ee7212d1dc415480d171 Mon Sep 17 00:00:00 2001 From: "James.Makela" Date: Mon, 10 Jun 2024 13:10:52 -0700 Subject: [PATCH 2/2] New release (1.1.10) --- py_gnome/gnome/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py_gnome/gnome/__init__.py b/py_gnome/gnome/__init__.py index 8eb37e46a..f52103312 100644 --- a/py_gnome/gnome/__init__.py +++ b/py_gnome/gnome/__init__.py @@ -22,7 +22,7 @@ # just so it will be in the namespace. from .gnomeobject import GnomeId, AddLogger -__version__ = '1.1.9' +__version__ = '1.1.10' if os.name == 'nt':