Re: [cmake-developers] [PATCH] Bug fix: Dylibs inside .framework folders fails in BundleUtilities.cmake.

2016-02-11 Thread Christian Askeland
The line is now tested in my build system, on three OS'es. Everything looks
OK. New patch follows:

The specific cause is when e.g.

/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgio-2.0.0.dylib

is detected by fixup_bundle. BundleUtilities.cmake/set_bundle_key_values()
interprets this as a framework, thus doing a string replace that creates an
embedded_item that is equal to the original path, i.e. it is not embedded.

The fix is to reuse the framework detection method found in
GetPrerequisite.cmake/gp_item_default_embedded_path(), i.e. first checking
for .dylib
---
 Modules/BundleUtilities.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 45dda40..73ff0af 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -479,7 +479,7 @@ function(set_bundle_key_values keys_var context item
exepath dirs copyflag)

 get_item_rpaths("${resolved_item}" item_rpaths)

-if(item MATCHES "[^/]+\\.framework/")
+if((item NOT MATCHES "\\.dylib$") AND (item MATCHES
"[^/]+\\.framework/"))
   # For frameworks, construct the name under the embedded path from the
   # opening "${item_name}.framework/" to the closing "/${item_name}":
   #
-- 
2.5.4 (Apple Git-61)

On Mon, Feb 8, 2016 at 4:32 PM, Brad King  wrote:

> On 02/07/2016 11:25 AM, Christian Askeland wrote:
> > We could reuse the check from gp_item_default_embedded_path(), instead of
> > looking at the result from that function:
> >
> >  if((item NOT MATCHES "\\.dylib$") AND (item MATCHES
> "[^/]+\\.framework/"))
> >
> > I haven't tested the line above, but can do so tomorrow and post a new
> patch,
> > if it looks reasonable.
>
> Yes, I think that looks good.
>
> Thanks,
> -Brad
>
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] [PATCH] Bug fix: Dylibs inside .framework folders fails in BundleUtilities.cmake.

2016-02-08 Thread Brad King
On 02/07/2016 11:25 AM, Christian Askeland wrote:
> We could reuse the check from gp_item_default_embedded_path(), instead of
> looking at the result from that function:
> 
>  if((item NOT MATCHES "\\.dylib$") AND (item MATCHES "[^/]+\\.framework/"))
> 
> I haven't tested the line above, but can do so tomorrow and post a new patch,
> if it looks reasonable.

Yes, I think that looks good.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] [PATCH] Bug fix: Dylibs inside .framework folders fails in BundleUtilities.cmake.

2016-02-07 Thread Christian Askeland

> On 5. feb. 2016, at 16.22, Brad King  wrote:
> 
> On 02/04/2016 01:34 PM, Christian Askeland wrote:
>> The specific cause is when e.g.
>> 
>> /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgio-2.0.0.dylib
>> 
>> is detected by fixup_bundle. BundleUtilities.cmake/set_bundle_key_values()
>> interprets this as a framework, thus doing a string replace that creates an
>> embedded_item that is equal to the original path, i.e. it is not embedded.
>> 
>> The fix is to rely on the correct framework detection in
>> GetPrerequisite.cmake/gp_item_default_embedded_path() instead.
> [snip]
>> -if(item MATCHES "[^/]+\\.framework/")
>> +# Use default_embedded_path from gp_item_default_embedded_path() to 
>> query whether the item is a framework
>> +if(default_embedded_path MATCHES "/Frameworks")
> 
> If the project uses gp_item_default_embedded_path_override then
> we cannot rely on the value from gp_item_default_embedded_path.

Good point, I didn't see that one.

> Is there another way to detect whether the item is actually the
> main framework library itself or just something else inside one?
> 

We could reuse the check from gp_item_default_embedded_path(), instead of 
looking at the result from that function:

 if((item NOT MATCHES "\\.dylib$") AND (item MATCHES "[^/]+\\.framework/"))

I haven't tested the line above, but can do so tomorrow and post a new patch, 
if it looks reasonable.

> Thanks,
> -Brad
> 


-Christian
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] [PATCH] Bug fix: Dylibs inside .framework folders fails in BundleUtilities.cmake.

2016-02-04 Thread Christian Askeland
The specific cause is when e.g.

/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgio-2.0.0.dylib

is detected by fixup_bundle. BundleUtilities.cmake/set_bundle_key_values()
interprets this as a framework, thus doing a string replace that creates an
embedded_item that is equal to the original path, i.e. it is not embedded.

The fix is to rely on the correct framework detection in
GetPrerequisite.cmake/gp_item_default_embedded_path() instead.

---
 Modules/BundleUtilities.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 45dda40..0a92251 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -479,7 +479,8 @@ function(set_bundle_key_values keys_var context item
exepath dirs copyflag)

 get_item_rpaths("${resolved_item}" item_rpaths)

-if(item MATCHES "[^/]+\\.framework/")
+# Use default_embedded_path from gp_item_default_embedded_path() to
query whether the item is a framework
+if(default_embedded_path MATCHES "/Frameworks")
   # For frameworks, construct the name under the embedded path from the
   # opening "${item_name}.framework/" to the closing "/${item_name}":
   #
-- 
2.5.4 (Apple Git-61)
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers