Marco (or in his continued absence, any other OSX developer),

1)
After reading for a few minutes about app bundles on wikipedia, I am thinking 
we can
eliminate the copy of the *.kiface file which is up at the directory where the 
*.app files
exist.

Do you agree?

If so, please look at this patch as a proposed strategy for all but the 
kicad.app.  This
only deals with pcbnew.app as a trial balloon.  The trick is to build the 
*.kiface module
down in the bundle right out of the get go.  I am curious if it gets copied 
properly
during the install.  I have no way to test that since this is OSX CMake 
specific behaviour.


2)
For the kicad.app/Contents/MacOS/ directory, I would suggest we install 
symlinks with
these names

_pcbnew.kiface, _eeschema.kiface, _cvpcb.kiface to the real deals up and over 
in the

pcbnew.app/Contents/MacOS directory equivalents.

I don't know how to do this with CMake yet.  But we should try it manually 
first.  This
will leave us with one copy of each *.kiface binary.

I think I know how to create the symlinks in the build directory copy of the 
bundle, so I
wonder if during install these would get transformed to actual full copies.

The difficulty is that the ${KIFACE_BIN} variable does not get expanded before 
the
install() steps are actually done.  In fact it looks like it happens inside the 
install()
steps.  So there's no way to get an expanded variable during installation.

So let's hope setting up the symlinks in the build dir will get carried into 
the install dir.

Dick

=== modified file 'pcbnew/CMakeLists.txt'
--- pcbnew/CMakeLists.txt	2014-04-19 18:47:20 +0000
+++ pcbnew/CMakeLists.txt	2014-04-24 15:05:28 +0000
@@ -589,17 +589,15 @@
         DESTINATION ${KICAD_BIN}
         COMPONENT binary
         )
-    install( TARGETS pcbnew_kiface
-        DESTINATION ${KICAD_BIN}
-        COMPONENT binary
-        )
-
     if( APPLE )
-        # copies kiface into the bundle
-        add_custom_target( _pcbnew_kiface_copy ALL
-            COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/pcbnew/_pcbnew.kiface "${CMAKE_BINARY_DIR}/pcbnew/pcbnew.app/Contents/MacOS/"
-            DEPENDS pcbnew_kiface
-            COMMENT "Copying kiface into pcbnew"
+        # puts the kiface into the pcbnew.app bundle
+        set_target_properties( pcbnew_kiface PROPERTIES
+            LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pcbnew.app/Contents/MacOS/
+            )
+    else()
+        install( TARGETS pcbnew_kiface
+            DESTINATION ${KICAD_BIN}
+            COMPONENT binary
             )
     endif()
 

_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to