Giter Site home page Giter Site logo

cmake-bundle-macos's Introduction

About

Portable sample app using CMake and CPack.

The app uses two dynamic libraries, one of them using yet another library:

PortableApp
  libLibOne.dylib
  libLibTwo.dylib
    libLibThree.dylib

Tags: CMake, CPack, MacOS X bundle, .dmg, portable app.

Building

mkdir build
cd build
cmake ..
cpack -G DragNDrop

Contacts

You are welcome to contact me at ivan.onyshchenko (at) gmail.com in case you have any questions, comments, suggestions or need help building, designing or implementing your product.

cmake-bundle-macos's People

Contributors

ionyshch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cmake-bundle-macos's Issues

Build instruction tweak

Hello, nice project!

For me the existing build instructions did not quite work but the following seems to have:

mkdir build
cd build
cmake ..
cd ..             # this line is added
cpack -G DragNDrop

Trying the bundle generator, fails

The DragnDrop generator is somewhat limited (only a single exe)

But using the bundle generator fails.

Diff:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 039cfa7..0d4eed0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ target_link_libraries(LibTwo LibThree)
 
 set(APP_NAME PortableApp)
 
-add_executable(${APP_NAME} MACOSX_BUNDLE main.cpp)
+add_executable(${APP_NAME} main.cpp)
 target_link_libraries(${APP_NAME} LibOne LibTwo)
 
 add_custom_target(Docs SOURCES README.md .gitignore LICENSE)
@@ -31,5 +31,15 @@ set(DIRS ${CMAKE_BINARY_DIR})
 install(CODE "include(BundleUtilities)
     fixup_bundle(\"${APPS}\" \"\" \"${DIRS}\")")
 
-set(CPACK_GENERATOR "DRAGNDROP")
+set(CPACK_GENERATOR "Bundle")
+set(CPACK_VERBATIM_VARIABLES true)
+set(CPACK_PACKAGE_VERSION_MAJOR 0)
+set(CPACK_PACKAGE_VERSION_MINOR 2)
+set(CPACK_PACKAGE_VERSION_PATCH 0)
+set(CPACK_PACKAGE_NAME "${APP_NAME}")
+set(CPACK_PACKAGE_VENDOR "HKU")
+set(CPACK_BUNDLE_NAME "${APP_NAME}")
+

error

cpack -G Bundle -V .
CPack: Enable Verbose
CPack Verbose: Read CPack config file: 
CPack Verbose: Read CPack configuration file: /Users/ect/src/cmake-bundle-macos/build/CPackConfig.cmake
CPack Verbose: Specified generator: Bundle
CPack Verbose: Use generator: cmCPackBundleGenerator
CPack Verbose: For project: PortableApp
CPack: Create package using Bundle
CPack Verbose: Read description file: /usr/local/Cellar/cmake/3.19.7/share/cmake/Templates/CPack.GenericDescription.txt
CPack Verbose: [Bundle] requested component grouping = ALL_COMPONENTS_IN_ONE
CPack Verbose: Remove toplevel directory: /Users/ect/src/cmake-bundle-macos/build/_CPack_Packages/Darwin/Bundle
CPack: Install projects
CPack: - Run preinstall target for: PortableApp
CPack: - Install project: PortableApp []
CPack Verbose: Install configuration: ""
CPack Verbose: Installing: /Users/ect/src/cmake-bundle-macos/build/_CPack_Packages/Darwin/Bundle/PortableApp-0.2.0-Darwin/PortableApp.app/Contents/Resources/bin/PortableApp
CPack Verbose: fixup_bundle
CPack Verbose:   app='/Users/ect/src/cmake-bundle-macos/build/_CPack_Packages/Darwin/Bundle/PortableApp-0.2.0-Darwin/PortableApp.app/Contents/Resources/PortableApp.app'
CPack Verbose:   libs=''
CPack Verbose:   dirs='/Users/ect/src/cmake-bundle-macos/build'
CPack Verbose:   ignoreItems=''
CPack Verbose: warning: *NOT* handled - directory/file does not exist...
CMake Error at /usr/local/Cellar/cmake/3.19.7/share/cmake/Modules/BundleUtilities.cmake:993 (message):
  error: fixup_bundle: not a valid bundle
Call Stack (most recent call first):
  /Users/ect/src/cmake-bundle-macos/build/cmake_install.cmake:55 (fixup_bundle)

It copies everything to the Resources dir.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.