[Kst] branches/work/kst/portto4/kst/cmake

Peter Kümmel syntheticpp at gmx.net
Sat Feb 12 17:06:25 CET 2011


SVN commit 1220037 by kuemmel:

horror mixture: mac&cmake

 M  +29 -1     CMakeLists.txt  
 M  +6 -11     modules/KstMacros.cmake  
 M  +1 -1      src/kst/CMakeLists.txt  


--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1220036:1220037
@@ -7,6 +7,7 @@
 
 get_filename_component(kst_dir ${CMAKE_SOURCE_DIR}/.. ABSOLUTE)
 
+
 set(kst_version_major 2)
 set(kst_version_minor 0)
 set(kst_version_patch 3)
@@ -251,8 +252,8 @@
 set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqtgui4 (>= 4.4.3-0)")
 
 
-include(CPack)
 
+
 # Usage
 #
 # Source only .targz, .tar.bz2, .zip:
@@ -275,3 +276,30 @@
 # CPack and Ubuntu
 # Found this:
 # http://www.purplekarrot.net/blog/dputCMake.html
+
+
+if(APPLE)
+	set(contents_dir ${kst_binary_name}.app/Contents)
+	#install(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION  ${contents_dir}/plugins COMPONENT Runtime)
+	install(DIRECTORY "${CMAKE_BINARY_DIR}/plugins"    DESTINATION  ${contents_dir} COMPONENT Runtime)
+	file(WRITE ${CMAKE_BINARY_DIR}/qt.conf "")
+	install(FILES ${CMAKE_BINARY_DIR}/qt.conf DESTINATION ${contents_dir}/Resources COMPONENT Runtime)
+	
+	set(bapp ${CMAKE_BINARY_DIR}/bin/kst2.app)
+	set(bdir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/plugin)
+	install(CODE 
+		"file(GLOB qt_plugins \"\${CMAKE_INSTALL_PREFIX}/${contents_dir}/plugins/imageformats/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+		file(GLOB kst_plugins \"\${CMAKE_BINARY_DIR}/plugins/*${CMAKE_SHARED_MODULE_SUFFIX}\")
+		set(libs \${qt_plugins_disbaled} \${kst_plugins})
+		include(BundleUtilities) 
+		fixup_bundle(\"${bapp}\" \"\${libs}\" \"${bdir}\") "
+		COMPONENT RUNTIME)
+		
+	set(CPACK_BINARY_DRAGNDROP 1)
+	set(CPACK_BINARY_PACKAGEMAKER 0)
+	SET(CPACK_BINARY_STGZ 0)
+	set(CPACK_BINARY_TBZ2 0)
+	set(CPACK_BINARY_TGZ 0)
+endif()
+
+include(CPack)
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1220036:1220037
@@ -65,7 +65,7 @@
 
 macro(kst_set_target_properties)
 	set_property(TARGET ${kst_name} PROPERTY DEBUG_POSTFIX ${kst_debug_postfix})
-	set_target_properties(${kst_name} PROPERTIES VERSION ${kst_version} SOVERSION 2)
+	#set_target_properties(${kst_name} PROPERTIES VERSION ${kst_version} SOVERSION 2)
 endmacro()
 
 
@@ -82,13 +82,7 @@
 macro(kst_install_executable)
 	install(TARGETS ${kst_name} 
 		RUNTIME DESTINATION bin
-		BUNDLE DESTINATION bin)
-	#if(APPLE)
-	#	#TODO does not work
-	#	set(bdir ${CMAKE_INSTALL_PREFIX}/bin ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/plugin)
-	#	set(blib ${CMAKE_INSTALL_PREFIX}/lib/libkstcore.dylib ${CMAKE_INSTALL_PREFIX}/lib/libkstapp.dylib ${CMAKE_INSTALL_PREFIX}/lib/libkstwidgets.dylib ${CMAKE_INSTALL_PREFIX}/lib/libkstmath.dylib)#
-	#	install(CODE "include(BundleUtilities) fixup_bundle(kst \"${blib}\" \"${bdir}\")" COMPONENT RUNTIME)
-	#endif()
+		BUNDLE DESTINATION .)
 endmacro()
 
 
@@ -132,8 +126,8 @@
 
 
 macro(kst_init_plugin dir)
-	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugin)
-	set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugin)
+	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
+	set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
 	include_directories(${CMAKE_BINARY_DIR}/${dir})
 	kst_include_directories(kstcore kstmath kstwidgets)
 	set(kst_plugin_dir ${dir})
@@ -151,7 +145,7 @@
 	kst_files_find(${kst_plugin_dir}/${folder}/${name})
 	add_library(${kst_name} MODULE ${kst_${kst_name}_sources} ${kst_${kst_name}_headers})
 	kst_link(kstcore kstmath kstwidgets)
-	install(TARGETS ${kst_name} LIBRARY DESTINATION plugin)
+	install(TARGETS ${kst_name} LIBRARY DESTINATION plugins)
 	kst_find_install_desktop_file(${kst_plugin_dir}/${folder}/${name})
 	add_dependencies(${kst_binary_name} ${kst_name})
 	kst_flat_source_group(${kst_${kst_name}_headers} ${kst_${kst_name}_sources_not_generated})
@@ -212,6 +206,7 @@
 	set(kst_options)
 endmacro()
 
+
 macro(kst_option _name _description _default _sys)
 	set(_msg OFF)
 	if(${_sys} MATCHES "gcc")
--- branches/work/kst/portto4/kst/cmake/src/kst/CMakeLists.txt #1220036:1220037
@@ -34,7 +34,7 @@
 
 kst_install_executable()
 
-if(UNIX)
+if(UNIX AND NOT APPLE)
 	set(k ${kst_dir}/src/kst)
 	install(FILES ${k}/kstplugin.desktop
 	              ${k}/kstdatasourceplugin.desktop


More information about the Kst mailing list