]> git.lyx.org Git - features.git/blobdiff - src/CMakeLists.txt
cmake: fix .dmg creation
[features.git] / src / CMakeLists.txt
index a8c016b82a1a12755ce21a81b086e05f62e56586..f538d0f6363b04bf8c13241b4b1aaad854ae7f2a 100644 (file)
@@ -76,6 +76,7 @@ if (LYX_DEVEL_VERSION)
        add_definitions(-DDEVEL_VERSION)
 endif()
 
+
 if (LYX_MERGE_FILES)
        if(dont_merge)
                list(REMOVE_ITEM lyx_sources ${dont_merge})
@@ -105,6 +106,7 @@ lyx_find_info_files(LyXUiFiles ${TOP_SRC_DIR}/lib/ui/*)
 
 add_executable(${_lyx}
        ${WIN32_CONSOLE}
+       ${LYX_BUNDLE}
        ${lyx_sources}
        ${lyx_headers}
        ${vld_files}
@@ -113,6 +115,10 @@ add_executable(${_lyx}
        ${lyx_cmake_files}
 )
 
+if(LYX_BUNDLE)
+       set(MACOSX_BUNDLE_STARTUP_COMMAND ${_lyx})
+endif()
+
 lyx_add_gcc_pch(${_lyx})
 
 target_link_libraries(${_lyx}
@@ -122,14 +128,11 @@ target_link_libraries(${_lyx}
        frontend_qt4
        graphics
        support
+       ${LIBINTL_LIBRARIES}
        ${ICONV_LIBRARY}
        ${QT_QTMAIN_LIBRARY}
        ${vld_dll})
 
-if(NOT LYX_EXTERNAL_LIBINTL OR WIN32)
-  target_link_libraries(${_lyx} intl)
-  add_dependencies(${_lyx} intl_target)
-endif()
 
 if(HUNSPELL_FOUND)
        target_link_libraries(${_lyx} ${HUNSPELL_LIBRARY})
@@ -143,7 +146,11 @@ endif()
 
 if(APPLE)
        target_link_libraries(${_lyx} "-bind_at_load")
-       target_link_libraries(${_lyx} "-framework Carbon")
+       if(LYX_COCOA)
+               target_link_libraries(${_lyx} "-framework Cocoa")
+       else()
+               target_link_libraries(${_lyx} "-framework Carbon")
+       endif()
 endif()
 
 if(MINGW)
@@ -152,5 +159,10 @@ endif()
 
 project_source_group("${GROUP_CODE}" lyx_sources lyx_headers)
 
-install(TARGETS ${_lyx} DESTINATION bin)
-
+if(LYX_BUNDLE)
+       install(TARGETS ${_lyx}
+               RUNTIME DESTINATION bin
+               BUNDLE DESTINATION .)
+else()
+       install(TARGETS ${_lyx} DESTINATION bin)
+endif()