[cmake-developers] [PATCH] FindProtobuf: check version

2016-02-11 Thread Antonio Perez Barrero
Check found libraries version to match user required version.

Protobuf compiler executable version is checked to be aligned with found
libraries, raising a warning message otherwise.
---
 Modules/FindProtobuf.cmake | 59 +++---
 1 file changed, 56 insertions(+), 3 deletions(-)

diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 02aca1c..b3fcd23 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -15,6 +15,8 @@
 # ``PROTOBUF_IMPORT_DIRS``
 #   List of additional directories to be searched for
 #   imported .proto files.
+# ``PROTOBUF_DEBUG``
+#   Show debug messages.
 #
 # Defines the following variables:
 #
@@ -302,10 +304,61 @@ find_program(PROTOBUF_PROTOC_EXECUTABLE
 )
 mark_as_advanced(PROTOBUF_PROTOC_EXECUTABLE)
 
+if(PROTOBUF_DEBUG)
+message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+"requested version of Google Protobuf is ${Protobuf_FIND_VERSION}")
+endif()
+
+if(PROTOBUF_INCLUDE_DIR)
+  set(_PROTOBUF_COMMON_HEADER 
${PROTOBUF_INCLUDE_DIR}/google/protobuf/stubs/common.h)
+
+  if(PROTOBUF_DEBUG)
+message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+   "location of common.h: ${_PROTOBUF_COMMON_HEADER}")
+  endif()
+
+  set(PROTOBUF_VERSION "")
+  set(PROTOBUF_LIB_VERSION "")
+  file(STRINGS ${_PROTOBUF_COMMON_HEADER} _PROTOBUF_COMMON_H_CONTENTS REGEX 
"#define[ \t]+GOOGLE_PROTOBUF_VERSION[ \t]+")
+  if(_PROTOBUF_COMMON_H_CONTENTS MATCHES "#define[ 
\t]+GOOGLE_PROTOBUF_VERSION[ \t]+([0-9]+)")
+  set(PROTOBUF_LIB_VERSION "${CMAKE_MATCH_1}")
+  endif()
+  unset(_PROTOBUF_COMMON_H_CONTENTS)
+
+  math(EXPR _PROTOBUF_MAJOR_VERSION "${PROTOBUF_LIB_VERSION} / 100")
+  math(EXPR _PROTOBUF_MINOR_VERSION "${PROTOBUF_LIB_VERSION} / 1000 % 1000")
+  math(EXPR _PROTOBUF_SUBMINOR_VERSION "${PROTOBUF_LIB_VERSION} % 1000")
+  set(PROTOBUF_VERSION 
"${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}")
+
+  if(PROTOBUF_DEBUG)
+message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+"${_PROTOBUF_COMMON_HEADER} reveals protobuf ${PROTOBUF_VERSION}")
+  endif()
 
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf DEFAULT_MSG
-PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
+  # Check Protobuf compiler version to be aligned with libraries version
+  execute_process(COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} --version
+  OUTPUT_VARIABLE _PROTOBUF_PROTOC_EXECUTABLE_VERSION)
+
+  if("${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" MATCHES "libprotoc ([0-9\.]+)")
+set(_PROTOBUF_PROTOC_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+  endif()
+
+  if(PROTOBUF_DEBUG)
+message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+"${PROTOBUF_PROTOC_EXECUTABLE} reveals version 
${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}")
+  endif()
+
+  if(NOT "${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}" VERSION_EQUAL 
"${PROTOBUF_VERSION}")
+  message(WARNING "Protobuf compiler version 
${_PROTOBUF_PROTOC_EXECUTABLE_VERSION}"
+  " doesn't match library version ${PROTOBUF_VERSION}")
+  endif()
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Protobuf
+REQUIRED_VARS PROTOBUF_LIBRARIES PROTOBUF_INCLUDE_DIR
+VERSION_VAR PROTOBUF_VERSION
+)
 
 if(PROTOBUF_FOUND)
 set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR})
-- 
1.9.1

-- 

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] CMake Windows 10 Store App

2016-02-11 Thread Gilles Khouzam
Hi Roman,

The solution produced by CMake will be able to produce the appxupload bundle 
through Visual Studio. If you select your app project, in the build->Store menu 
you can create the app bundles.

Are you looking to automate that?

-Original Message-
From: cmake-developers [mailto:cmake-developers-boun...@cmake.org] On Behalf Of 
Roman Wüger
Sent: Thursday, February 11, 2016 06:48
To: CMake Developer MailingList 
Subject: [cmake-developers] CMake Windows 10 Store App

Hello,

I use CMAKE_SYSTEM_NAME:STRING=WindowsStore and CMAKE_SYSTEM_VERSION=10.0 to 
build an universal app. However, does CMake also support *.appxupload and such 
bundles? And if so, how?

Thanks in advance
Best regards
Roman
-- 

Powered by 
https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=FXx2mNGG3j9z%2bIk5kJQlm78idyf8obOU7EPpJkSsIhE%3d

Please keep messages on-topic and check the CMake FAQ at: 
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.cmake.org%2fWiki%2fCMake_FAQ&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=FQaCHxP1kLgqbwI19FaYOh%2bHRt5gvYK8kFPPQh2shGg%3d

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

CMake Support: 
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fcmake.org%2fcmake%2fhelp%2fsupport.html&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=We1QJxq9SOTpxQ7lw0toN7hshEn3LEHjtZe9L%2bJL3jk%3d
CMake Consulting: 
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fcmake.org%2fcmake%2fhelp%2fconsulting.html&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=wzZUA0UiSCU0t8qxlJ2E35urkr3j7SqE5Z8C6%2bvQvN4%3d
CMake Training Courses: 
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fcmake.org%2fcmake%2fhelp%2ftraining.html&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=mlFgqO6k%2bcuKIHYUJ4ntzEYZNkNu2T1vN0W5PbEPPBQ%3d

Visit other Kitware open-source projects at 
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.kitware.com%2fopensource%2fopensource.html&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=Wrj57Y7RjmaLn7UnNkQp0aMqMOyDdXry%2bRl5VcC1GHk%3d

Follow this link to subscribe/unsubscribe:
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fpublic.kitware.com%2fmailman%2flistinfo%2fcmake-developers&data=01%7c01%7cgilles.khouzam%40microsoft.com%7c3416bedca35349e6977308d332f26dce%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=q8Z56SvLk7vRlXZBm%2f%2fwHfpUQLY72nSMBWjahttOqjU%3d
-- 

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] 15954: Ninja generated superbuilds do not reinstall dependent projects

2016-02-11 Thread Brad King
On 02/11/2016 03:35 PM, Taylor Braun-Jones wrote:
> I'm curious about bug 15954[1]. I'm having the same issue and I'd expect
> that many others would be running to the issue too since the Ninja
> generator and the ExternalProjects module have become quite popular.
> Could I get confirmation that it's a real bug and a quick pointer on
> where to look to fix it?
> 
> [1] https://cmake.org/Bug/view.php?id=15954

Actually I think that may have been fixed by:

 Ninja: Always re-run custom commands that have symbolic dependencies
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3477b26f

which is in 3.5.0-rc2.  Please try that version to check.

-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


[cmake-developers] 15954: Ninja generated superbuilds do not reinstall dependent projects

2016-02-11 Thread Taylor Braun-Jones
I'm curious about bug 15954[1]. I'm having the same issue and I'd expect
that many others would be running to the issue too since the Ninja
generator and the ExternalProjects module have become quite popular. Could
I get confirmation that it's a real bug and a quick pointer on where to
look to fix it?

Thanks,
Taylor

[1] https://cmake.org/Bug/view.php?id=15954
-- 

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] [CMake 0015971]: CMake alias resolution appears to be inconsistently applied

2016-02-11 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://public.kitware.com/Bug/view.php?id=15971 
== 
Reported By:Marcus D. Hanwell
Assigned To:Robert Maynard
== 
Project:CMake
Issue ID:   15971
Category:   CMake
Reproducibility:always
Severity:   minor
Priority:   normal
Status: assigned
== 
Date Submitted: 2016-02-11 14:52 EST
Last Modified:  2016-02-11 14:52 EST
== 
Summary:CMake alias resolution appears to be inconsistently
applied
Description: 
The Tomviz project extends ParaView, and uses a number of imported targets. Some
of these come from VTK, others come from ParaView. When migrating to Qt 5 we hit
a strange bug where the Qt 5 interface library aliases were not getting expanded
unless we explicitly added them to the target_link_libraries line. Printing them
out all the libraries were found, but the link line had -lQt5::Help etc. It
looks like the Qt5::Widgets alias was the only one resolved.

If I switch the order of finding ParaView and finding Qt5 around everything
worked. If I find ParaView first, then Qt 5 it fails at linking, unless I add
all of the libraries to the target_link_libraries, in which case it resolved
them and the link step succeeded. This seems very inconsistent to me, perhaps it
is intended for for reason due to the order in which you resolve aliases? It
took something that was fairly resilient to call order previously and made it
more brittle in our project.

Additional Information: 
https://github.com/OpenChemistry/tomviz/commit/525336b3e94170ec2e2c463894de034d539898cc
shows the commit I am hoping will make this consistent everywhere. If aliases
make this strict ordering necessary that was not evident to me.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-02-11 14:52 Marcus D. HanwellNew Issue
2016-02-11 14:52 Marcus D. HanwellStatus   new => assigned 
2016-02-11 14:52 Marcus D. HanwellAssigned To   => Robert Maynard  
==

-- 

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] [CMake 0015970]: CMake changes order of include directories when a directory is specified both as a SYSTEM and non-SYSTEM include

2016-02-11 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
https://cmake.org/Bug/view.php?id=15970 
== 
Reported By:jbohren
Assigned To:
== 
Project:CMake
Issue ID:   15970
Category:   CMake
Reproducibility:always
Severity:   major
Priority:   normal
Status: new
== 
Date Submitted: 2016-02-11 13:44 EST
Last Modified:  2016-02-11 13:44 EST
== 
Summary:CMake changes order of include directories when a
directory is specified both as a SYSTEM and non-SYSTEM include
Description: 
I ran into a problem recently where a package I was building set a SYSTEM
include directory which was already a non-SYSTEM include directory imported from
a dependency. When this happened, CMake dropped the non-SYSTEM directory in
favor of the SYSTEM one, causing my build to fail.

According to GCC [1], it gives precedence to non-SYSTEM include directories, and
specifying both for the same path produces a warning.

[1] https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
> All directories named by -isystem are searched after all directories named by
-I, no matter what their order was on the command line. If the same directory is
named by both -I and -isystem, the -I option is ignored. GCC provides an
informative message when this occurs if -v is used.

With CMake, if both are specified, it drops the non-SYSTEM include and fails
silently. For example, when building this project with any recent version of
CMake on Linux, the build command is:

```bash
/usr/bin/c++  -isystem /path/to/overlay/devel/include  -I/opt/ros/indigo/include
 -o CMakeFiles/foo.dir/foo.cpp.o -c /home/jbohren/scratch/isystem/foo.cpp
```

But with the three `incude_directory` options given in `CMakeLists.txt`, I would
expect it to read:

```bash
/usr/bin/c++  -I/path/to/overlay/devel/include  -I/opt/ros/indigo/include 
-isystem /path/to/overlay/devel/include  -o CMakeFiles/foo.dir/foo.cpp.o -c
/home/jbohren/scratch/isystem/foo.cpp
```

Even the following would maintain the order of the search paths, since the
non-SYSTEM directories are all scanned before the SYSTEM ones:


```bash
/usr/bin/c++  -I/path/to/overlay/devel/include  -I/opt/ros/indigo/include  -o
CMakeFiles/foo.dir/foo.cpp.o -c /home/jbohren/scratch/isystem/foo.cpp
```


Steps to Reproduce: 
Build this trivial CMake project to observe the effect:
https://github.com/jbohren/isystem
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-02-11 13:44 jbohrenNew Issue
==

-- 

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]: Fix compiler warnings (clang from trunk)

2016-02-11 Thread Brad King
On 02/11/2016 12:01 PM, Tobias Hunger wrote:
> Just a small patch to fix a couple of compiler warnings that drove me crazy.

Thanks, applied:

 cmListFileCache: Fix warning about inconsistent use of class/struct
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e1ea1df0

-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


[cmake-developers] [PATCH]: Fix compiler warnings (clang from trunk)

2016-02-11 Thread Tobias Hunger
Just a small patch to fix a couple of compiler warnings that drove me crazy.
From 82f8ccb9afe7b07d42a772025498bb63f42f296c Mon Sep 17 00:00:00 2001
From: Tobias Hunger 
Date: Thu, 11 Feb 2016 17:47:42 +0100
Subject: [PATCH 01/43] cmListFileCache: Fix warnings during build

Fix warning about inconsistent use of class/struct in 
cmListFileCache.
---
 Source/cmListFileCache.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 03e0abe..4d3055f 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -58,8 +58,9 @@ struct cmListFileArgument
   long Line;
 };
 
-struct cmListFileContext
+class cmListFileContext
 {
+public:
   std::string Name;
   std::string FilePath;
   long Line;
-- 
2.7.1

-- 

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] CMake Windows 10 Store App

2016-02-11 Thread Roman Wüger
Hello,

I use CMAKE_SYSTEM_NAME:STRING=WindowsStore and CMAKE_SYSTEM_VERSION=10.0 to 
build an universal app. However, does CMake also support *.appxupload and such 
bundles? And if so, how?

Thanks in advance
Best regards
Roman
-- 

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] FindProtobuf: prevent redundant PROTOBUF_LIBRARIES

2016-02-11 Thread Brad King
On 02/11/2016 03:24 AM, Antonio Perez Barrero wrote:
> Before this change, the variable PROTOBUF_LIBRARIES might get redundant
> value for debug and optimized configurations, e.g.
> 'optimized;/usr/lib/libprotobuf.so;debug;/usr/lib/libprotobuf.so'

Thanks, applied with minor updates:

 FindProtobuf: prevent redundant PROTOBUF_LIBRARIES
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51b0501a

-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-11 Thread Brad King
On 02/11/2016 08:15 AM, Christian Askeland wrote:
> New patch follows:

Thanks, applied:

 BundleUtilities: Fix treatment of .dylib inside .framework folders
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e422f738

-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-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

[cmake-developers] [PATCH] FindProtobuf: prevent redundant PROTOBUF_LIBRARIES

2016-02-11 Thread Antonio Perez Barrero
Before this change, the variable PROTOBUF_LIBRARIES might get redundant
value for debug and optimized configurations, e.g.
'optimized;/usr/lib/libprotobuf.so;debug;/usr/lib/libprotobuf.so'
---
 Modules/FindProtobuf.cmake | 39 +++
 1 file changed, 19 insertions(+), 20 deletions(-)

diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index 2f13b09..02aca1c 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -213,28 +213,27 @@ endif()
 # Internal function: search for normal library as well as a debug one
 #if the debug one is specified also include debug/optimized keywords
 #in *_LIBRARIES variable
+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations)
+
 function(_protobuf_find_libraries name filename)
-   find_library(${name}_LIBRARY
-   NAMES ${filename}
-   PATHS 
${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
-   mark_as_advanced(${name}_LIBRARY)
-
-   find_library(${name}_LIBRARY_DEBUG
-   NAMES ${filename}
-   PATHS ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
-   mark_as_advanced(${name}_LIBRARY_DEBUG)
-
-   if(NOT ${name}_LIBRARY_DEBUG)
-  # There is no debug library
-  set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY} PARENT_SCOPE)
-  set(${name}_LIBRARIES ${${name}_LIBRARY} PARENT_SCOPE)
+   if(${name}_LIBRARY)
+   set(${name}_LIBRARIES "${${name}_LIBRARY}" PARENT_SCOPE)
else()
-  # There IS a debug library
-  set(${name}_LIBRARIES
-  optimized ${${name}_LIBRARY}
-  debug ${${name}_LIBRARY_DEBUG}
-  PARENT_SCOPE
-  )
+   find_library(${name}_LIBRARY_RELEASE
+   NAMES ${filename}
+   PATHS 
${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Release)
+   mark_as_advanced(${name}_LIBRARY_RELEASE)
+
+   find_library(${name}_LIBRARY_DEBUG
+   NAMES ${filename}
+   PATHS 
${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/${_PROTOBUF_ARCH_DIR}Debug)
+   mark_as_advanced(${name}_LIBRARY_DEBUG)
+
+   select_library_configurations(${name})
+   set(${name}_LIBRARY_RELEASE ${${name}_LIBRARY_RELEASE} PARENT_SCOPE)
+   set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY_DEBUG} PARENT_SCOPE)
+   set(${name}_LIBRARY ${${name}_LIBRARY} PARENT_SCOPE)
+   set(${name}_LIBRARIES ${${name}_LIBRARIES} PARENT_SCOPE)
endif()
 endfunction()
 
-- 
1.9.1

-- 

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