From 0c4ec3d3174bad950f9d5995d8cb8f20c0254f4e Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Sun, 14 Jun 2015 22:04:15 -0400 Subject: [PATCH] basic cpack configuration --- CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2c0d34..96ff245 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ set (My_Project_Author "Somebody") set (My_Project_Revised_Date "2015-06-05") set (My_Project_Version_Major 1) set (My_Project_Version_Minor 0) -set (My_Project_Version_Patch 0) +set (My_Project_Version_Patch 1) set (My_Project_Version "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}") @@ -54,6 +54,38 @@ configure_file ( ) +# ======================= +# Configure for Target OS +# ======================= + +# OS X Machines +if (APPLE) + + # Configure backwards-compatible support (if your project allows it) + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.4" CACHE STRING "Deployment target for OSX" FORCE) + + # Compile for x86_64 and i386. ppc no longer supported + if(CMAKE_BUILD_TYPE MATCHES "Release") + SET (CMAKE_OSX_ARCHITECTURES x86_64;i386) + endif(CMAKE_BUILD_TYPE MATCHES "Release") + + # Use PackageMaker for installers? + # set (CPACK_GENERATOR PackageMaker) + set (CPACK_GENERATOR ZIP) + + +endif (APPLE) + +# Windows Machines +if (WIN32) + + # Use NSIS to generate installers? + # set (CPACK_GENERATOR NSIS) + set (CPACK_GENERATOR ZIP) + +endif (WIN32) + + # ============= # Build Targets # ============= @@ -149,4 +181,18 @@ endif() # Build Installer with CPack # ========================== -# You're on your own here +# You're largely on your own here + +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/README.md ${PROJECT_SOURCE_DIR}/LICENSE.txt + DESTINATION . +) + +set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "${My_Project_Description}") +set (CPACK_PACKAGE_VENDOR "${My_Project_Author}") +set (CPACK_PACKAGE_VERSION "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}") +set (CPACK_PACKAGE_VERSION_MAJOR "${My_Project_Version_Major}") +set (CPACK_PACKAGE_VERSION_MINOR "${My_Project_Version_Minor}") +set (CPACK_PACKAGE_VERSION_PATCH "My_Project_Version_Patch") + + +include (CPack) -- 2.40.0