Am 15.05.2011 um 15:21 schrieb kuem...@lyx.org:

> Author: kuemmel
> Date: Sun May 15 15:21:18 2011
> New Revision: 38765
> URL: http://www.lyx.org/trac/changeset/38765
> 
> Log:
> cmake: build a .dmg file on Mac,  looks not as nice as the official installer 
> but it runs

Peter, what is the required environment for that?
I cannot get it working with Qt 4.6.2, is it too old?

> 
> Added:
>   lyx-devel/trunk/development/cmake/dmg   (contents, props changed)
> Modified:
>   lyx-devel/trunk/CMakeLists.txt
>   lyx-devel/trunk/src/CMakeLists.txt
>   lyx-devel/trunk/src/client/CMakeLists.txt
>   lyx-devel/trunk/src/tex2lyx/CMakeLists.txt
> 
> Modified: lyx-devel/trunk/CMakeLists.txt
> ==============================================================================
> --- lyx-devel/trunk/CMakeLists.txt    Sun May 15 13:24:40 2011        (r38764)
> +++ lyx-devel/trunk/CMakeLists.txt    Sun May 15 15:21:18 2011        (r38765)
> @@ -57,6 +57,8 @@

...

> +# APPLE specific
> +LYX_OPTION(DMG                   "Build as Mac bundle, needed for .dmg  
> (experimental) " OFF GCC)
> +LYX_OPTION(COCOA                 "Use Cocoa on Mac" OFF GCC)
> 

...

> -if (LYX_INSTALL_PREFIX)
> +if(LYX_DMG)
> +    set(bundle_dir ${TOP_BINARY_DIR}/bin)
> +     set(LYX_CPACK 1)
> +     set(LYX_BUNDLE MACOSX_BUNDLE)
> +     set(LYX_INSTALL_PREFIX LyX2.1 CACHE STRING "LyX bundle install prefix" 
> FORCE)
> +     set(LYX_DATA_SUBDIR LyX.app/Contents/Resources/ CACHE STRING "Bundle 
> Contents dir" FORCE)
> +     message(STATUS)
> +     message(STATUS "Bundle creation is enabled.")
> +     message(STATUS "It is experimental, to increase turn around speed use:")
> +     message(STATUS "    cmake -DLYX_MERGE_FILES=1 -DLYX_NO_OPTIMIZE=1 
> -DLYX_INSTALL=1 -DLYX_DMG=1 ../trunk")
> +     message(STATUS "or use the shell script 'developent/cmake/dmg'")
> +     message(STATUS)
> +endif()
> +
> +
...

> +
> +
> +if(LYX_DMG)
> +     set(CPACK_PACKAGE_NAME LyX)
> +     set(CPACK_GENERATOR DragNDrop)
> +     
> +     # We start from bin/lyx.app, all is build into the final bundle folder
> +     # On Mac the paths to required shared libraries are hardcoded in the
> +     # binary/library. This is fixed by the macro 'fixup_bundle' 
> +     # Hardcoded pathes to libraries are resolved automatically
> +
> +     
> +     set(app          ${bundle_dir}/LyX.app)
> +     set(contents_dir LyX.app/Contents/)
> +     install(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION 
> ${bundle_dir}/${contents_dir}/plugins COMPONENT Runtime)
> +     
> +     message(STATUS "Qt Plugins: ${QT_PLUGINS_DIR}/imageformats DESTINATION 
> ${bundle_dir}/${contents_dir}/plugins")
> +     
> +     install(CODE 
> +             "file(GLOB qt_plugins 
> \"${bundle_dir}/${contents_dir}/plugins/imageformats/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
> +             include(BundleUtilities)
> +             fixup_bundle(\"${app}\" \"\${qt_plugins}\" \"${dir}\") "
> +             COMPONENT RUNTIME)

Here it fails.

PhaseScriptExecution "CMake PostBuild Rules" 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/lyx.build/Debug/install.build/Script-101874D20101874D20101874.sh
...
/opt/local/bin/cmake -DBUILD_TYPE=Debug -P cmake_install.cmake
-- Install configuration: "Debug"
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/LyX2.1/LyX.app/Contents/Resources/bind/./aqua.bind
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/LyX2.1/LyX.app/Contents/Resources/bind/./broadway.bind
...
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqgif.dylib
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqico.dylib
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqjpeg.dylib
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqmng.dylib
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqsvg.dylib
-- Installing: 
/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqtiff.dylib
-- fixup_bundle
--   app='/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app'
--   
libs='/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqgif.dylib;/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqico.dylib;/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqjpeg.dylib;/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqmng.dylib;/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqsvg.dylib;/Users/stephan/cvs/lyx/lyx-build/cmake/lyx-devel/bin/LyX.app/Contents//plugins/imageformats/libqtiff.dylib'
--   dirs=''
-- warning: *NOT* handled - .app directory case...
CMake Error at /opt/local/share/cmake-2.8/Modules/BundleUtilities.cmake:627 
(message):
  error: fixup_bundle: not a valid bundle
Call Stack (most recent call first):
  cmake_install.cmake:1835 (fixup_bundle)


make: *** [install_buildpart_0] Error 1


> +     
> +     file(WRITE ${CMAKE_BINARY_DIR}/qt.conf "")
> +     install(FILES ${CMAKE_BINARY_DIR}/qt.conf DESTINATION 
> ${contents_dir}/Resources COMPONENT Runtime)
> +     
> +endif()
> +



> Modified: lyx-devel/trunk/src/CMakeLists.txt
> ==============================================================================
> --- lyx-devel/trunk/src/CMakeLists.txt        Sun May 15 13:24:40 2011        
> (r38764)
> +++ lyx-devel/trunk/src/CMakeLists.txt        Sun May 15 15:21:18 2011        
> (r38765)
> @@ -106,6 +106,7 @@
> 
> add_executable(${_lyx}
>       ${WIN32_CONSOLE}
> +     ${LYX_BUNDLE}
>       ${lyx_sources}
>       ${lyx_headers}
>       ${vld_files}
> @@ -114,6 +115,10 @@
>       ${lyx_cmake_files}
> )
> 
> +if(LYX_BUNDLE)
> +     set(MACOSX_BUNDLE_STRATUP_COMMAND ${_lyx})
> +endif()
> +
> 

Isn't this a typo? MACOSX_BUNDLE_STARTUP_COMMAND?

Stephan

Reply via email to