diff --git a/CMakeLists.txt b/CMakeLists.txt index c9293d7..c35a234 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ elseif (UNIX) endif() # Set USE_CPACK option. -set(USE_CPACK OFF) +set(USE_CPACK ON) # Install the application for the target platform. if (WIN32) diff --git a/cmake/buildMacOS.cmake b/cmake/buildMacOS.cmake index ebd085e..4c79045 100644 --- a/cmake/buildMacOS.cmake +++ b/cmake/buildMacOS.cmake @@ -1,5 +1,3 @@ -message(STATUS "Building on macOS") - # Set macOS specific resources. set(PLIST_MACOS "package/macos/Info.plist") set(ICNS_MACOS "package/macos/app.icns") diff --git a/cmake/buildUbuntu.cmake b/cmake/buildUbuntu.cmake index 37cf310..430fc3c 100644 --- a/cmake/buildUbuntu.cmake +++ b/cmake/buildUbuntu.cmake @@ -1,5 +1,3 @@ -message(STATUS "Building on Unix") - # Add the executable target. add_executable(${CMAKE_PROJECT_NAME} ${Implementation_FILES} diff --git a/cmake/buildWindows.cmake b/cmake/buildWindows.cmake index c57d58b..41c83c0 100644 --- a/cmake/buildWindows.cmake +++ b/cmake/buildWindows.cmake @@ -1,5 +1,3 @@ -message(STATUS "Building on Windows") - # Set windows specific resources. set(RESOURCE_WIN32 "res/resources.rc") diff --git a/cmake/installMacOS.cmake b/cmake/installMacOS.cmake index e69de29..50a5fee 100644 --- a/cmake/installMacOS.cmake +++ b/cmake/installMacOS.cmake @@ -0,0 +1,9 @@ +# Set the install prefix. +if (NOT USE_CPACK) + set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/deploy/macos" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) +else() + set(CMAKE_INSTALL_PREFIX "" CACHE PATH "Install path prefix, prepended onto install directories." FORCE) +endif() + +# Install the executable to the temporary directory +install(DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIR}/${CMAKE_PROJECT_NAME}.app" DESTINATION "${CMAKE_INSTALL_PREFIX}/Applications") diff --git a/cmake/packageMacOS.cmake b/cmake/packageMacOS.cmake index f3cd2e2..36082ed 100644 --- a/cmake/packageMacOS.cmake +++ b/cmake/packageMacOS.cmake @@ -7,13 +7,10 @@ set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION}) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_DESCRIPTION}") set(CPACK_PACKAGE_VENDOR ${CMAKE_PROJECT_NAME}) set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}) -set(CPACK_PACKAGE_DIRECTORY "${CMAKE_SOURCE_DIR}/package/macos") +set(CPACK_PACKAGE_DIRECTORY "${CMAKE_SOURCE_DIR}/setup/macos") # Set package generator to Apple Disk Image. set(CPACK_GENERATOR DragNDrop) # Include the CPack module. include(CPack) - -# Install the executable to the temporary directory -install(DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIR}/${CMAKE_PROJECT_NAME}.app" DESTINATION /Applications)