Please do post your info here as well.<div><br><br><div class="gmail_quote">On Wed, Nov 25, 2009 at 5:01 AM, Filip Wänström <span dir="ltr">&lt;<a href="mailto:filip.wanstrom@tii.se">filip.wanstrom@tii.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Just wanted to add an update: I have managed to create a stand alone<br>
MacOSX OpenSceneGraph app that works. Basically it boils down to<br>
scripting the install_name_tool to create loader_paths that points<br>
correctly. I will create an example of this and will be posting that<br>
to the osg-users mailing list. I will post it here too if that&#39;s ok?<br>
<br>
Best regards<br>
<font color="#888888">/Filip<br>
</font><div><div></div><div class="h5"><br>
<br>
On Tue, Nov 24, 2009 at 3:23 PM, Filip Wänström &lt;<a href="mailto:filip.wanstrom@tii.se">filip.wanstrom@tii.se</a>&gt; wrote:<br>
&gt; Hi my name is Filip Wänström and I&#39;m new to this list.<br>
&gt;<br>
&gt; I have recently(a few months) started to use CMake for all my<br>
&gt; building. I find that it works well in most cases and probably is the<br>
&gt; best alternative on the &quot;market&quot;. Anyway, I like to stay cross<br>
&gt; platform for my projects so I personally develop on a Mac but mostly<br>
&gt; deliver on win32.<br>
&gt;<br>
&gt; Building works fine for me (using Makefile gen for mac and VS for win)<br>
&gt; but I have huge problems with the bundling process. On the Mac I want<br>
&gt; to deliver an app using regular drag and drop as a self contained<br>
&gt; bundle and on windows I want to deliver an installer.<br>
&gt; I have managed to get a win32 installer working using the NSIS<br>
&gt; facilities but it took a lot of extra scripting. On the Mac I have<br>
&gt; been able to create the dragndrop bundle &quot;installer&quot; but it doesn&#39;t<br>
&gt; really work. I assume there are some issues with<br>
&gt; rpath/loader_path/executable_path.<br>
&gt;<br>
&gt; For reference the app is an Openscenegraph app that is dependant on<br>
&gt; quite a few libraries that need to be bundled as dll:s on win and<br>
&gt; dylibs/.so on mac.<br>
&gt;<br>
&gt; The question is: what is the current &quot;best practices approaches&quot; on<br>
&gt; these platforms? I have found no complete examples.<br>
&gt;<br>
&gt;<br>
&gt; Finally: parts of my cmake test case for win32: THis works fine and<br>
&gt; creates a usable app that bundles the osg libs as well as a plugin and<br>
&gt; data. It just doesn&#39;t feel very neat for being user code.<br>
&gt;<br>
&gt;<br>
&gt; #Basic app test (packaging exercise)<br>
&gt; SET(TARGET_BASIC_APP_SRC BasicApp.cpp BasicAppMain.cpp)<br>
&gt; ADD_EXECUTABLE(BasicApp  ${TARGET_BASIC_APP_SRC} )<br>
&gt; TARGET_LINK_LIBRARIES(BasicApp ${MY_COMMON_LIBS})<br>
&gt;<br>
&gt; IF(WIN32 AND NOT UNIX)<br>
&gt;        SET(CPACK_GENERATOR &quot;NSIS&quot;)<br>
&gt;        INSTALL(<br>
&gt;                        TARGETS BasicApp<br>
&gt;                        DESTINATION bin<br>
&gt;                         )<br>
&gt;<br>
&gt;        SET(OSG_DLL_DIR $ENV{OSG_ROOT}\\bin)<br>
&gt;        FILE(TO_CMAKE_PATH ${OSG_DLL_DIR} OSG_DLL_DIR_CPATH)<br>
&gt;        SET(CMAKE_INSTALL_DEBUG_LIBRARIES)<br>
&gt;        INCLUDE(InstallRequiredSystemLibraries)<br>
&gt;        SET(CPACK_PACKAGE_EXECUTABLES &quot;BasicApp&quot; &quot;Basic App&quot;)<br>
&gt;<br>
&gt;        CONFIGURE_FILE(<br>
&gt;                &quot;${CMAKE_MODULE_PATH}/<a href="http://dependencies.cmake.in" target="_blank">dependencies.cmake.in</a>&quot;<br>
&gt;                &quot;${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake&quot;<br>
&gt;                @ONLY<br>
&gt;        )<br>
&gt;        INSTALL(CODE &quot;set(input_file<br>
&gt; \&quot;\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/BasicApp.exe \&quot;)&quot;)<br>
&gt;        INSTALL(SCRIPT &quot;${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake&quot;)<br>
&gt;<br>
&gt;        SET(OSG_PLUGINS_DIR<br>
&gt; &quot;${OSG_DLL_DIR_CPATH}/osgPlugins-${OPENSCENEGRAPH_VERSION}&quot;)<br>
&gt;        MESSAGE(&quot;Installing plugins from: ${OSG_PLUGINS_DIR}&quot;)<br>
&gt;        # Extra plugin installs that the dependency checker can&#39;t find<br>
&gt;        INSTALL(<br>
&gt;                FILES &quot;${OSG_PLUGINS_DIR}/osgdb_obj.dll&quot;<br>
&gt;                DESTINATION bin)<br>
&gt;        # Install data that uses (at runtime) the plugin above<br>
&gt;        INSTALL(FILES<br>
&gt;              &quot;${Dope_SOURCE_DIR}/data/models/clogo.obj&quot;<br>
&gt; &quot;${Dope_SOURCE_DIR}/data/models/clogo.mtl&quot;<br>
&gt;      DESTINATION data/models)<br>
&gt;<br>
&gt;        # Create shortcuts usin NSIS commands<br>
&gt;        SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS &quot; CreateShortCut<br>
&gt; &#39;$INSTDIR\\\\shortcut.lnk&#39; &#39;$INSTDIR\\\\bin\\\\BasicApp.exe&#39;  &quot;)<br>
&gt;<br>
&gt;        # Install vc90 sp1 redist<br>
&gt;        # windows update broke a lot of things so lets add an vcdist<br>
&gt; dependant installer<br>
&gt;        INSTALL(FILES<br>
&gt;              &quot;${Dope_SOURCE_DIR}/external/win32_vc9/win_extras/vcredist_x86.exe&quot;<br>
&gt;      DESTINATION win32_extras/)<br>
&gt;<br>
&gt;        SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS &quot;ExecWait<br>
&gt; &#39;$INSTDIR\\\\win32_extras\\\\vcredist_x86.exe&#39;&quot;)<br>
&gt; ENDIF(WIN32 AND NOT UNIX)<br>
&gt;<br>
&gt;<br>
&gt; # <a href="http://dependcies.cmake.in" target="_blank">dependcies.cmake.in</a> is:<br>
&gt;<br>
&gt; if(NOT DEFINED input_file)<br>
&gt;  message(FATAL_ERROR &quot;input file is not defined&quot;)<br>
&gt; endif(NOT DEFINED input_file)<br>
&gt; message(&quot;Using ${input_file}&quot;)<br>
&gt; INCLUDE(GetPrerequisites)<br>
&gt; GET_PREREQUISITES(${input_file} DEPENDENCIES 1 1 &quot;&quot; &quot;&quot;)<br>
&gt;<br>
&gt; FOREACH(DEPENDENCY ${DEPENDENCIES})<br>
&gt;        MESSAGE(&quot;DEPENDENCY: ${DEPENDENCY}&quot;)<br>
&gt;        GET_FILENAME_COMPONENT(DEPENDENCY_NAME &quot;${DEPENDENCY}&quot; NAME)<br>
&gt;        GET_FILENAME_COMPONENT(DEPENDENCY_ACTUAL &quot;${DEPENDENCY}&quot; REALPATH)<br>
&gt;        MESSAGE(&quot;DEPENDENCY_NAME: ${DEPENDENCY_NAME}&quot;)<br>
&gt;        MESSAGE(&quot;DEPENDENCY_ACTUAL: ${DEPENDENCY_ACTUAL}&quot;)<br>
&gt;        FIND_FILE(${DEPENDENCY_NAME}_REAL_PATH ${DEPENDENCY_NAME} )<br>
&gt;        MESSAGE(&quot;DEPENDENCY_REAL_PATH: ${${DEPENDENCY_NAME}_REAL_PATH}&quot;)<br>
&gt;<br>
&gt;        MESSAGE(&quot;installing into: ${CMAKE_INSTALL_PREFIX}/bin&quot;)<br>
&gt;        FILE(COPY ${${DEPENDENCY_NAME}_REAL_PATH} DESTINATION<br>
&gt; &quot;${CMAKE_INSTALL_PREFIX}/bin&quot;)<br>
&gt;        #INSTALL(FILES &quot;${DEPENDENCY_REAL_PATH}&quot; DESTINATION bin)<br>
&gt; ENDFOREACH()<br>
&gt;<br>
&gt; On the mac, I don&#39;t have any working code yet. I feel that I am close,<br>
&gt; but as it is, the code cannot load the right plugin<br>
&gt;<br>
&gt; IF (APPLE)<br>
&gt;          SET(MACOSX_BUNDLE_INFO_STRING &quot;MACOSX_BUNDLE_INFO_STRING&quot;)<br>
&gt;          SET(MACOSX_BUNDLE_ICON_FILE &quot;&quot;)<br>
&gt;          SET(MACOSX_BUNDLE_GUI_IDENTIFIER &quot;BasicAppGuiId&quot;)<br>
&gt;          SET(MACOSX_BUNDLE_LONG_VERSION_STRING &quot;long ver string&quot;)<br>
&gt;          SET(MACOSX_BUNDLE_BUNDLE_NAME &quot;BasicAPpBundleName&quot;)<br>
&gt;          SET(MACOSX_BUNDLE_SHORT_VERSION_STRING &quot;short ver&quot;)<br>
&gt;<br>
&gt;          # setup the bundle<br>
&gt;          SET(BasicApp_BUNDLE_NAME &quot;BasicApp&quot;)<br>
&gt;          SET_TARGET_PROPERTIES(BasicApp PROPERTIES OUTPUT_NAME<br>
&gt; ${BasicApp_BUNDLE_NAME})<br>
&gt;          SET(BasicApp_BUNDLE_LOCATION &quot;${CMAKE_INSTALL_PREFIX}&quot;)<br>
&gt;          MESSAGE(&quot;ORIGINAL CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}&quot;)<br>
&gt;          # make sure CMAKE_INSTALL_PREFIX ends in /<br>
&gt;          STRING(LENGTH &quot;${CMAKE_INSTALL_PREFIX}&quot; LEN)<br>
&gt;          MATH(EXPR LEN &quot;${LEN} -1&quot; )<br>
&gt;          STRING(SUBSTRING &quot;${CMAKE_INSTALL_PREFIX}&quot; ${LEN} 1 ENDCH)<br>
&gt;          IF(NOT &quot;${ENDCH}&quot; STREQUAL &quot;/&quot;)<br>
&gt;                  SET(CMAKE_INSTALL_PREFIX &quot;${CMAKE_INSTALL_PREFIX}/&quot;)<br>
&gt;          ENDIF(NOT &quot;${ENDCH}&quot; STREQUAL &quot;/&quot;)<br>
&gt;          SET(CMAKE_INSTALL_PREFIX<br>
&gt; &quot;${CMAKE_INSTALL_PREFIX}${BasicApp_BUNDLE_NAME}.app/Contents&quot;)<br>
&gt;<br>
&gt;          MESSAGE(&quot;CHANGED CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}&quot;)<br>
&gt;<br>
&gt;          INSTALL(<br>
&gt;                                TARGETS BasicApp<br>
&gt;                                RUNTIME DESTINATION bin<br>
&gt;                                BUNDLE DESTINATION &quot;.&quot; )<br>
&gt;<br>
&gt;          INSTALL(FILES ${Dope_SOURCE_DIR}/ReadMe.txt DESTINATION &quot;.&quot; )<br>
&gt;<br>
&gt;          SET(BasicAppFullPath &quot;${CMAKE_INSTALL_PREFIX}/MacOS/${BasicApp_BUNDLE_NAME}&quot;)<br>
&gt;          MESSAGE(&quot;BasicAppFullPath: ${BasicAppFullPath}&quot;)<br>
&gt;<br>
&gt;         # INSTALL(CODE &quot;set(input_file \&quot;/MacOS/${BasicApp_BUNDLE_NAME}\&quot;)&quot;)<br>
&gt;         MESSAGE(&quot;INSTALL CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}&quot;)<br>
&gt;         INSTALL(CODE &quot;set(lib_path \&quot;/usr/local/lib\&quot;)&quot;)<br>
&gt;          INSTALL(CODE &quot;set(input_file<br>
&gt;                 \&quot;\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${BasicApp_BUNDLE_NAME}.app/Contents/MacOS/${BasicApp_BUNDLE_NAME}\&quot;)&quot;)<br>
&gt;          INSTALL(SCRIPT<br>
&gt; &quot;${Dope_SOURCE_DIR}/CMakeModules/CMakeIngestOSXBundleLibraries.cmake&quot;)<br>
&gt;<br>
&gt;          INSTALL(FILES<br>
&gt;              &quot;${Dope_SOURCE_DIR}/data/models/clogo.obj&quot;<br>
&gt; &quot;${Dope_SOURCE_DIR}/data/models/clogo.mtl&quot;<br>
&gt;          DESTINATION<br>
&gt; &quot;./${BasicApp_BUNDLE_NAME}.app/Contents/Resources/data/models/&quot;)<br>
&gt;<br>
&gt;        MESSAGE(&quot;OSG VERSION: ${OPENSCENEGRAPH_VERSION}&quot;)<br>
&gt;<br>
&gt;        SET(OSG_PLUGINS_DIR<br>
&gt; &quot;/usr/local/lib/osgPlugins-${OPENSCENEGRAPH_VERSION}&quot;)<br>
&gt;      INSTALL(FILES<br>
&gt;                     &quot;${OSG_PLUGINS_DIR}/osgdb_obj.so&quot;<br>
&gt;          DESTINATION<br>
&gt; &quot;./${BasicApp_BUNDLE_NAME}.app/Contents/PlugIns/osgPlugins-${OPENSCENEGRAPH_VERSION}/&quot;)<br>
&gt;<br>
&gt;          SET(CPACK_GENERATOR &quot;DragNDrop&quot;)<br>
&gt;<br>
&gt; ENDIF(APPLE)<br>
&gt;<br>
&gt; I tried to use code from the cmake 2.8 qt dialog working example<br>
&gt; (among other things, the CMakeIngestOSXBundleLibraries.cmake comes<br>
&gt; from there)<br>
&gt;<br>
&gt; Ok, first post over :)<br>
&gt; /Filip<br>
&gt;<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>