Skip to content

Commit 39e3a58

Browse files
committed
fix license dir on macos
1 parent 25fe9f1 commit 39e3a58

File tree

1 file changed

+26
-14
lines changed

1 file changed

+26
-14
lines changed

CMakeLists.txt

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ if(DEFINED SKBUILD_METADATA_DIR)
383383
set(PYLON_LICENSE_DIR "$ENV{PYLON_ROOT}/Licenses")
384384
endif()
385385
elseif(APPLE)
386-
set(PYLON_LICENSE_DIR "/Library/Frameworks/pylon.framework/Resources/licenses")
386+
set(PYLON_LICENSE_DIR "/Library/Frameworks/pylon.framework/Resources")
387387
else() # Linux
388388
if(DEFINED ENV{PYLON_ROOT})
389389
set(PYLON_LICENSE_DIR "$ENV{PYLON_ROOT}/share/pylon/licenses")
@@ -395,21 +395,33 @@ if(DEFINED SKBUILD_METADATA_DIR)
395395

396396

397397
# Install main license if found
398-
if(EXISTS "${PYLON_LICENSE_DIR}/License.txt")
399-
install(FILES "${PYLON_LICENSE_DIR}/License.txt"
400-
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
401-
RENAME "PYLON_LICENSE.txt")
398+
if(APPLE)
399+
# macOS has license.txt (lowercase) in Resources folder
400+
if(EXISTS "${PYLON_LICENSE_DIR}/license.txt")
401+
install(FILES "${PYLON_LICENSE_DIR}/license.txt"
402+
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
403+
RENAME "PYLON_LICENSE.txt")
404+
else()
405+
message(FATAL_ERROR "Pylon license not found at: ${PYLON_LICENSE_DIR}/license.txt")
406+
endif()
402407
else()
403-
message(FATAL_ERROR "Pylon license not found at: ${PYLON_LICENSE_DIR}")
404-
endif()
408+
# Windows and Linux have License.txt (uppercase)
409+
if(EXISTS "${PYLON_LICENSE_DIR}/License.txt")
410+
install(FILES "${PYLON_LICENSE_DIR}/License.txt"
411+
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
412+
RENAME "PYLON_LICENSE.txt")
413+
else()
414+
message(FATAL_ERROR "Pylon license not found at: ${PYLON_LICENSE_DIR}/License.txt")
415+
endif()
405416

406-
# Install third-party licenses if found
407-
if(EXISTS "${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt")
408-
install(FILES "${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt"
409-
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
410-
RENAME "PYLON_THIRD_PARTY_LICENSES.txt")
411-
else()
412-
message(FATAL_ERROR "Pylon third-party license not found at: ${PYLON_LICENSE_DIR}")
417+
# Install third-party licenses if found (Windows and Linux only)
418+
if(EXISTS "${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt")
419+
install(FILES "${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt"
420+
DESTINATION "${SKBUILD_METADATA_DIR}/licenses"
421+
RENAME "PYLON_THIRD_PARTY_LICENSES.txt")
422+
else()
423+
message(FATAL_ERROR "Pylon third-party license not found at: ${PYLON_LICENSE_DIR}/pylon_Third-Party_Licenses.txt")
424+
endif()
413425
endif()
414426
else()
415427
message(WARNING "SKBUILD_METADATA_DIR not defined")

0 commit comments

Comments
 (0)