@@ -373,45 +373,43 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/pypylon/
373
373
PATTERN "__pycache__" EXCLUDE
374
374
)
375
375
376
- # Install Pylon license files - get path from pylon target
376
+ # Install Pylon license files
377
377
if (DEFINED SKBUILD_METADATA_DIR )
378
- # Try to get pylon installation directory from the target
379
- get_target_property (PYLON_IMPORTED_LOCATION pylon::pylon IMPORTED_LOCATION )
380
- if (PYLON_IMPORTED_LOCATION )
381
- get_filename_component (PYLON_LIB_DIR ${PYLON_IMPORTED_LOCATION} DIRECTORY )
382
- get_filename_component (PYLON_ROOT_DIR ${PYLON_LIB_DIR} DIRECTORY )
383
- if (WIN32 )
378
+ # Get license directory based on platform
379
+ if (WIN32 )
380
+ if (DEFINED ENV{PYLON_DEV_DIR} )
384
381
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" )
382
+ elseif (DEFINED ENV{PYLON_ROOT} )
383
+ set (PYLON_LICENSE_DIR "$ENV{PYLON_ROOT} /Licenses" )
389
384
endif ()
390
- elseif (DEFINED ENV{PYLON_ROOT} )
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 ()
385
+ elseif (APPLE )
386
+ set (PYLON_LICENSE_DIR "/Library/Frameworks/pylon.framework/Resources/licenses" )
387
+ else () # Linux
388
+ if (DEFINED ENV{PYLON_ROOT} )
396
389
set (PYLON_LICENSE_DIR "$ENV{PYLON_ROOT} /share/pylon/licenses" )
397
390
endif ()
398
391
endif ()
399
-
400
- if (DEFINED PYLON_LICENSE_DIR AND EXISTS "${PYLON_LICENSE_DIR} /License.txt" )
401
- message (STATUS "Installing Pylon license from ${PYLON_LICENSE_DIR} " )
392
+
393
+ # Output license directory for debugging
394
+ message (STATUS "Pylon license directory: ${PYLON_LICENSE_DIR} " )
395
+
396
+
397
+ # Install main license if found
398
+ if (EXISTS "${PYLON_LICENSE_DIR} /License.txt" )
402
399
install (FILES "${PYLON_LICENSE_DIR} /License.txt"
403
400
DESTINATION "${SKBUILD_METADATA_DIR} /licenses"
404
401
RENAME "PYLON_LICENSE.txt" )
405
402
else ()
406
- message (FATAL_ERROR "Pylon license not found at expected location : ${PYLON_LICENSE_DIR} " )
403
+ message (FATAL_ERROR "Pylon license not found at: ${PYLON_LICENSE_DIR} " )
407
404
endif ()
408
-
409
- if (DEFINED PYLON_LICENSE_DIR AND EXISTS "${PYLON_LICENSE_DIR} /pylon_Third-Party_Licenses.txt" )
405
+
406
+ # Install third-party licenses if found
407
+ if (EXISTS "${PYLON_LICENSE_DIR} /pylon_Third-Party_Licenses.txt" )
410
408
install (FILES "${PYLON_LICENSE_DIR} /pylon_Third-Party_Licenses.txt"
411
409
DESTINATION "${SKBUILD_METADATA_DIR} /licenses"
412
410
RENAME "PYLON_THIRD_PARTY_LICENSES.txt" )
413
411
else ()
414
- message (WARNING "Pylon third-party licenses not found at expected location : ${PYLON_LICENSE_DIR} " )
412
+ message (FATAL_ERROR "Pylon third-party license not found at: ${PYLON_LICENSE_DIR} " )
415
413
endif ()
416
414
else ()
417
415
message (WARNING "SKBUILD_METADATA_DIR not defined" )
0 commit comments