Skip to content

Commit

Permalink
Use CMAKE_OSX_ARCHITECTURES in package name for Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
smistad committed Aug 17, 2023
1 parent 601dc12 commit e96c4d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.12) # 3.15
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version")
if(APPLE)
message(STATUS "APPLE DETECTED. Set CMAKE_OSX_ARCHITECTURES to arm64 to build for Apple Silicon")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version")
endif()
project(fastpathology)

set(VERSION_MAJOR 1)
Expand Down
6 changes: 5 additions & 1 deletion cmake/Package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ elseif(APPLE)
# Create APP Bundle
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_NAME "FastPathology")
set(CPACK_PACKAGE_FILE_NAME "fastpathology_macos${CMAKE_OSX_DEPLOYMENT_TARGET}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
if(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(CPACK_PACKAGE_FILE_NAME "fastpathology_macos${CMAKE_OSX_DEPLOYMENT_TARGET}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_${CMAKE_OSX_ARCHITECTURES}")
else()
set(CPACK_PACKAGE_FILE_NAME "fastpathology_macos${CMAKE_OSX_DEPLOYMENT_TARGET}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_x86_64")
endif()
set(CPACK_BUNDLE_ICON "${PROJECT_SOURCE_DIR}/data/Icons/fastpathology_logo_large.icns")
configure_file(
"${PROJECT_SOURCE_DIR}/misc/Info.plist.in"
Expand Down

0 comments on commit e96c4d9

Please sign in to comment.