Skip to content

Commit 88a63be

Browse files
committed
provide include dirs to swig in macos
1 parent c713aa7 commit 88a63be

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

CMakeLists.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,11 @@ function(add_swig_python_module module_name swig_file)
299299
set_property(SOURCE ${swig_file} APPEND_STRING PROPERTY SWIG_FLAGS " -I${INCLUDE_DIR}")
300300
endforeach()
301301
message(STATUS "Added pylon include directories to SWIG for ${module_name}: ${PYLON_INCLUDE_DIRS}")
302+
else()
303+
# Fallback: manually add common pylon framework include paths
304+
set_property(SOURCE ${swig_file} APPEND_STRING PROPERTY SWIG_FLAGS " -I/Library/Frameworks/pylon.framework/Headers")
305+
set_property(SOURCE ${swig_file} APPEND_STRING PROPERTY SWIG_FLAGS " -I/Library/Frameworks/pylon.framework/Headers/GenICam")
306+
message(STATUS "Added fallback pylon include directories to SWIG for ${module_name}")
302307
endif()
303308
endif()
304309

@@ -375,9 +380,21 @@ if(DEFINED SKBUILD_METADATA_DIR)
375380
if(PYLON_IMPORTED_LOCATION)
376381
get_filename_component(PYLON_LIB_DIR ${PYLON_IMPORTED_LOCATION} DIRECTORY)
377382
get_filename_component(PYLON_ROOT_DIR ${PYLON_LIB_DIR} DIRECTORY)
378-
set(PYLON_LICENSE_DIR "${PYLON_ROOT_DIR}/share/pylon/licenses")
383+
if(WIN32)
384+
set(PYLON_LICENSE_DIR "$ENV{PYLON_DEV_DIR}/../licenses")
385+
elseif(APPLE)
386+
set(PYLON_LICENSE_DIR "/Library/Frameworks/pylon.framework/Resources/licenses")
387+
else()
388+
set(PYLON_LICENSE_DIR "${PYLON_ROOT_DIR}/share/pylon/licenses")
389+
endif()
379390
elseif(DEFINED ENV{PYLON_ROOT})
380-
set(PYLON_LICENSE_DIR "$ENV{PYLON_ROOT}/share/pylon/licenses")
391+
if(WIN32)
392+
set(PYLON_LICENSE_DIR "$ENV{PYLON_DEV_DIR}/../licenses")
393+
elseif(APPLE)
394+
set(PYLON_LICENSE_DIR "/Library/Frameworks/pylon.framework/Resources/licenses")
395+
else()
396+
set(PYLON_LICENSE_DIR "$ENV{PYLON_ROOT}/share/pylon/licenses")
397+
endif()
381398
endif()
382399

383400
if(DEFINED PYLON_LICENSE_DIR AND EXISTS "${PYLON_LICENSE_DIR}/License.txt")
@@ -386,15 +403,15 @@ if(DEFINED SKBUILD_METADATA_DIR)
386403
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
387404
RENAME "PYLON_LICENSE.txt")
388405
else()
389-
message(WARNING "Pylon license not found at expected location")
406+
message(FATAL_ERROR "Pylon license not found at expected location: ${PYLON_LICENSE_DIR}")
390407
endif()
391408

392409
if(DEFINED PYLON_LICENSE_DIR AND EXISTS "${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt")
393410
install(FILES "${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt"
394411
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
395412
RENAME "PYLON_THIRD_PARTY_LICENSES.txt")
396413
else()
397-
message(WARNING "Pylon third-party licenses not found at expected location")
414+
message(WARNING "Pylon third-party licenses not found at expected location: ${PYLON_LICENSE_DIR}")
398415
endif()
399416
else()
400417
message(WARNING "SKBUILD_METADATA_DIR not defined")

0 commit comments

Comments
 (0)