Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-25 Thread Daniele E. Domenichelli
Hello,

Now that SelectLibraryConfigurations is good enough for me, I updated
FindGTK2.cmake to use it. I pushed my changes in a FindGTK2Debug topic,
does anyone want to review them before I merge the changes to next?

Thanks,

Cheers,
 Daniele
--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-25 Thread Brad King
On 07/25/2013 01:18 PM, Daniele E. Domenichelli wrote:
 Now that SelectLibraryConfigurations is good enough for me, I updated
 FindGTK2.cmake to use it. I pushed my changes in a FindGTK2Debug topic,
 does anyone want to review them before I merge the changes to next?

I just glanced through and the changes all look good to me except one
minor detail.  In this hunk:

+include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)

it is not safe to include a standard module inside a function due to
variable scoping.  Please revise the commit to include the file ahead
of time.  Then go ahead and merge.

Thanks,
-Brad
--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-19 Thread Brad King
On 07/19/2013 06:32 AM, Daniele E. Domenichelli wrote:
 On 18/07/13 21:54, Brad King wrote:
 Please update your topic to fix this and make sure tests pass
 locally before publishing.
 
 Done! Sorry about that!

Great, thanks.

-Brad
--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-18 Thread Brad King
On 07/10/2013 08:53 AM, Brad King wrote:
 Also please update the commit messages to include the explanations
 from your email.  Go ahead and push to Git by following the
 directions at http://www.cmake.org/Wiki/CMake/Git/Develop

Thanks.  Daniele, please also proceed with the merge to 'next':

 http://www.cmake.org/Wiki/CMake/Git/Develop#Merge_a_Topic_for_Testing

Sorry, I should have been more clear about how many of the steps
to follow before.  If you're prepared to check the dashboard for
errors and resolve them by extending the topic the next day then
it is usually safe to merge to 'next' for testing.  Anything that
goes in next can be revised, rewritten, or reverted before it is
later merged to master.

 It looks like this functionality was extracted from FindQt4 but
 FindQt4 was not refactored to use SelectLibraryConfigurations.
 Since then the implementation in FindQt4 has evolved without
 porting the changes.
 
 Clinton, is there any reason not to resolve this duplication?
 Also, it looks like FindQt4 force-caches the _LIBRARY variable.
 Is that necessary instead of just a variable set?

Clinton, can FindQt4 be refactored to use SelectLibraryConfigurations
now?

Thanks,
-Brad
--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-18 Thread Daniele E. Domenichelli
On 18/07/13 16:32, Brad King wrote:
 On 07/10/2013 08:53 AM, Brad King wrote:
 Also please update the commit messages to include the explanations
 from your email.  Go ahead and push to Git by following the
 directions at http://www.cmake.org/Wiki/CMake/Git/Develop
 
 Thanks.  Daniele, please also proceed with the merge to 'next':
 
  http://www.cmake.org/Wiki/CMake/Git/Develop#Merge_a_Topic_for_Testing
 
 Sorry, I should have been more clear about how many of the steps
 to follow before.  If you're prepared to check the dashboard for
 errors and resolve them by extending the topic the next day then
 it is usually safe to merge to 'next' for testing.  Anything that
 goes in next can be revised, rewritten, or reverted before it is
 later merged to master.

Done, thanks. I'm sorry, I thought I had to wait for some review before
merging it.

Regards,
 Daniele


--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-18 Thread Brad King
On 7/18/2013 11:56 AM, Daniele E. Domenichelli wrote:
 On 18/07/13 16:32, Brad King wrote:
 Done, thanks. I'm sorry, I thought I had to wait for some review before
 merging it.

Thanks.  I added a sentence to the Git/Develop wiki instructions to
indicate that one should either merge or request a review with an
explicit post to the list.

-Brad
--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-18 Thread Brad King
On 7/18/2013 11:56 AM, Daniele E. Domenichelli wrote:
 On 18/07/13 16:32, Brad King wrote:
 Thanks.  Daniele, please also proceed with the merge to 'next':
 
 Done, thanks

The continuous build section of the dashboard reveals a test
failure caused by this change:

 http://open.cdash.org/testDetails.php?test=199563898build=2969951

The Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
file needs to be updated with the new expectations since your
change modifies the outputs.

Please update your topic to fix this and make sure tests pass
locally before publishing.

Thanks,
-Brad
--

Powered by www.kitware.com

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

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

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


[cmake-developers] SelectLibraryConfigurations cached/advanced variables

2013-07-09 Thread Daniele E. Domenichelli
Hello,

On 03/07/13 20:21, Brad King wrote:
 The open request's discussion identified some concerns about the
 SelectLibraryConfigurations module, so please start another thread
 to raise the concerns here (or respond to this message and change the
 subject line).


I was discussing with Brad about using SelectLibraryConfigurations in
FindGTK2.cmake, but there are a couple of things that I don't like in
this module:


SelectLibraryConfigurations module currently cache and mark as advanced
the variable ${basename}_LIBRARY.
${basename}_LIBRARY_RELEASE and ${basename}_LIBRARY_DEBUG are usually
cached, because they often come from find_library().
${basename}_LIBRARY on the other hand is always of type
optimized;${${basename}_LIBRARY_RELEASE};debug;${${basename}_LIBRARY_DEBUG}
or just ${basename}_LIBRARY_RELEASE or ${basename}_LIBRARY_DEBUG if
only one version of the library is not found, if both have the same
value, or if configuration types are not supported.


I believe that caching and marking as advanced just
${basename}_LIBRARY_RELEASE and ${basename}_LIBRARY_DEBUG is enough,
just by modifying these two variables, the user has enough control on
finding the library, and having 3 variables is IMO redundant and confusing.
So, is there a reason why ${basename}_LIBRARY is cached?


Another issue is that if one of the libraries (_DEBUG or _RELEASE) is
not set, the value is set to the value of the other one.
FindQt4, from which the macro is extracted, sets the values to
XXX_LIBRARY_{DEBUG,RELEASE}-NOTFOUND instead.
In both cases the XXX_LIBRARY is correct, but IMO using NOTFOUND makes
it easier to understand which one is missing.


I tried to fix these issues, you can find the patches attached.


Regards,
 Daniele
From bdc46bb45b395e0400302e36487dfbe81db69820 Mon Sep 17 00:00:00 2001
From: Daniele E. Domenichelli daniele.domeniche...@iit.it
Date: Mon, 8 Jul 2013 14:37:23 +0200
Subject: [PATCH 1/2] SelectLibraryConfigurations: Do not cache the _LIBRARY
 variable

---
 Modules/SelectLibraryConfigurations.cmake |6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 5bca064..f475d87 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -73,15 +73,11 @@ macro( select_library_configurations basename )
 endif()
 endif()
 
-set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH
-The ${basename} library )
-
 if( ${basename}_LIBRARY )
 set( ${basename}_FOUND TRUE )
 endif()
 
-mark_as_advanced( ${basename}_LIBRARY
-${basename}_LIBRARY_RELEASE
+mark_as_advanced( ${basename}_LIBRARY_RELEASE
 ${basename}_LIBRARY_DEBUG
 )
 endmacro()
-- 
1.7.10.4

From cb9a2c622b21edb18e1d13db73c4d53e244a3bba Mon Sep 17 00:00:00 2001
From: Daniele E. Domenichelli daniele.domeniche...@iit.it
Date: Mon, 8 Jul 2013 17:37:18 +0200
Subject: [PATCH 2/2] SelectLibraryConfigurations: Use -NOTFOUND instead of
 copying the vars

---
 Modules/SelectLibraryConfigurations.cmake |   58 -
 1 file changed, 23 insertions(+), 35 deletions(-)

diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index f475d87..eebaf90 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -31,48 +31,36 @@
 # This macro was adapted from the FindQt4 CMake module and is maintained by Will
 # Dicharry wdicha...@stellarscience.com.
 
-# Utility macro to check if one variable exists while another doesn't, and set
-# one that doesn't exist to the one that exists.
-macro( _set_library_name basename GOOD BAD )
-if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} )
-set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} )
-set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} )
-set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} )
-endif()
-endmacro()
-
 macro( select_library_configurations basename )
-# if only the release version was found, set the debug to be the release
-# version.
-_set_library_name( ${basename} RELEASE DEBUG )
-# if only the debug version was found, set the release value to be the
-# debug value.
-_set_library_name( ${basename} DEBUG RELEASE )
-
-# Set a default case, which will come into effect if
-# -no build type is set and the generator only supports one build type
-#  at a time (i.e. CMAKE_CONFIGURATION_TYPES is false)
-# -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same
-# -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty
-set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
-set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
+if(NOT ${basename}_LIBRARY_RELEASE)
+set(${basename}_LIBRARY_RELEASE 

Re: [cmake-developers] SelectLibraryConfigurations regression (Was: [CMake] CMake 2.8.10-rc2 ready for testing!)

2012-10-21 Thread Rolf Eike Beer
Rolf Eike Beer wrote:
 Brad King wrote:
  On 10/19/2012 01:54 PM, Rolf Eike Beer wrote:
   Doh! Good catch, thanks. Will push it soonish.
  
  I think our emails crossed.  I just pushed it.
 
 Ok, feel free to ignore my branch then. I'll create a new topic to test this
 module soonish, would be good if that could be merged together with your
 fix.

I pushed my test branch now and found another bug: if both the _RELEASE and 
_DEBUG variable were set to the same value, SelectLibraryConfigurations was 
not setting *_LIBRARY and *_LIBRARIES at all. Fix is in my branch (test-
SelectLibraryConfigurations).

Eike
-- 

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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

[cmake-developers] SelectLibraryConfigurations regression (Was: [CMake] CMake 2.8.10-rc2 ready for testing!)

2012-10-19 Thread Thomas Arcila
Hi,

I have just found a regression in latest rc with
SelectLibraryConfigurations module.

Expected output (cmake 2.6.9) from the attached test case is:

-- mylib_LIBRARY_RELEASE mylib
-- mylib_LIBRARY_DEBUG mylibD
-- mylib_LIBRARIES optimized;mylib;debug;mylibD

while cmake 2.6.10-rc2 output is:

-- mylib_LIBRARY_RELEASE mylib
-- mylib_LIBRARY_DEBUG mylibD
-- mylib_LIBRARIES
optimized;LISTS;optimized;mylib_LIBRARY_RELEASE;debug;LISTS;debug;mylib_LIBRARY_DEBUG

You will find attached a patch fixing the issue.

Regards,
Thomas



2012/10/19 David Cole david.c...@kitware.com

 The CMake 2.8.10 release candidate stream continues! You can find the
 source and binaries here:

   http://www.cmake.org/files/v2.8/?C=M;O=D

 This email is also available as blog posts:

   http://www.kitware.com/blog/home/post/401
   http://cmake.blogspot.com/2012/10/cmake-2810-rc2-ready-for-testing.html

 Some of the notable changes in this release are:

  - file(DOWNLOAD now handles https URLs -- the pre-built binaries
 available from Kitware link to OpenSSL
  - support for the latest available versions of Visual Studio (11 /
 2012) and Xcode (4.3, 4.4, 4.5, developer previews)
  - uniform compiler id and version number variables available for
 nearly all known compilers and platforms
  - new way to arrange exported targets that depend on other targets
 into export sets
  - new generator expressions
  - generator expressions available in more contexts, namely in the
 INCLUDE_DIRECTORIES and COMPILE_DEFINITIONS target properties
  - new target properties for PDB_OUTPUT_DIRECTORY and PDB_NAME,
 implemented for Visual Studio 7 and up
  - and, as always, various minor bug fixes

 The bug tracker change log page for this version is at:

   http://public.kitware.com/Bug/changelog_page.php?version_id=100

 Following is the complete list of changes in this rc since the first
 rc. Please try this version of CMake on your projects and report any
 issues to the list or the bug tracker. This release candidate will
 become the final release for 2.8.10 by the end of October unless
 somebody finds and reports a serious issue that needs to be fixed.



 Thanks!



 -Dave



 Changes in CMake 2.8.10-rc2 (since 2.8.10-rc1)
 --
 Alex Neundorf (2):
   Document CMAKE_FIND_PACKAGE_NAME
   Automoc: fix #13572: issue with symbolic links

 Brad King (4):
   cmCTestSVN: Fix compilation with Sun CC 5.1
   if: Document that plain 'NOTFOUND' is a false constant
   string: Clarify regex documentation of '-' behavior
   FortranCInterface: Pass all flags to VERIFY project (#13579)

 David Cole (1):
   NSIS: Fix incorrect uninstall registry key name (#13578)

 Eric NOULARD (3):
   CPACK_XX_ON_ABSOLUTE_INSTALL_DESTINATION is now properly checked
 for ON/OFF
   Document CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY and fix some
 typo.
   Make CPACK_SET_DESTDIR work with archive generator +
 component-based packaging

 Jean-Christophe Fillion-Robin (1):
   CTest: Ensure CTEST_USE_LAUNCHERS behaves nicely in Superbuild setup

 Pere Nubiola i Radigales (1):
   Find PostgreSQL headers on Debian

 Peter Kümmel (4):
   Ninja: also set OBJECT_DIR when compiling
   Ninja: don't pollute current dir when using gui (#13495)
   Ninja: implicit dependency for custom command files
   Fix regression: write compile definitions if any

 Philip Lowman (4):
   FindGTK2: Rollback lib64 changes which broke header file finding
   FindGTK2: #12049 fix detection of header files on multiarch systems
   FindGTK2: #12596 Missing paths for FindGTK2 on NetBSD
   FindGTK2: Update local changelog

 Rolf Eike Beer (6):
   CTest: fix usage of memory checker with spaces in path
   CTest: fix pre and post test commands with spaces
   CTest: add tests that simulate memcheck runs
   CTest: improve memory checker type detection
   CTest: add a test for CTEST_CUSTOM_MEMCHECK_IGNORE
   CTest: add a check with a quoted memory checker

 Stephen Kelly (18):
   GenEx: It is not an error to specify an empty parameter
   GenEx: Return after error reported.
   GenEx: Report actual target name not found, not 0 each time.
   GenEx: Parse comma after colon tokens specially
   GenEx: Validate target and property names.
   GenEx: Ensure that the empty CONFIGURATION can be used conditionally.
   GenEx: Add test for $ with empty parameter.
   GenEx: Add tests for 0 and 1 expressions with literal commas.
   GenEx: Don't use std::vector::at(int).
   Attempt to fix the compile of cmake on Sun CC.
   GenEx: Parse colon after arguments separator colon specially.
   GenEx: Test the use of generator expressions to generate lists.
   GenEx: Fix termination bugs in generator expression parser.
   GenEx: Break if there are no more commas in the container
   GenEx: Add some more asserts to verify code-sanity.
   GenEx: 

Re: [cmake-developers] SelectLibraryConfigurations regression (Was: [CMake] CMake 2.8.10-rc2 ready for testing!)

2012-10-19 Thread Brad King
On 10/19/2012 12:17 PM, Thomas Arcila wrote:
 I have just found a regression in latest rc with SelectLibraryConfigurations 
 module.
 
 You will find attached a patch fixing the issue.

Applied:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cd2ec10

Thanks!
-Brad
--

Powered by www.kitware.com

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

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

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


Re: [cmake-developers] SelectLibraryConfigurations regression (Was: [CMake] CMake 2.8.10-rc2 ready for testing!)

2012-10-19 Thread Rolf Eike Beer
Thomas Arcila wrote:
 Hi,
 
 I have just found a regression in latest rc with
 SelectLibraryConfigurations module.
 
 Expected output (cmake 2.6.9) from the attached test case is:
 
 -- mylib_LIBRARY_RELEASE mylib
 -- mylib_LIBRARY_DEBUG mylibD
 -- mylib_LIBRARIES optimized;mylib;debug;mylibD
 
 while cmake 2.6.10-rc2 output is:
 
 -- mylib_LIBRARY_RELEASE mylib
 -- mylib_LIBRARY_DEBUG mylibD
 -- mylib_LIBRARIES
 optimized;LISTS;optimized;mylib_LIBRARY_RELEASE;debug;LISTS;debug;mylib_LIBR
 ARY_DEBUG
 
 You will find attached a patch fixing the issue.

Doh! Good catch, thanks. Will push it soonish.

Eike
-- 

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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

[cmake-developers] SelectLibraryConfigurations

2012-07-31 Thread Rolf Eike Beer
Hi,

I just did a git grep optimized Modules/Find* to search for any modules that 
add the optimized and debug keywords by hand. We have a module for that: 
SelectLibraryConfigurations.cmake. This has the advantage of e.g. taking care 
for the case that only one of the debug and release library types were found, 
the generator does not support different configurations or simply both 
libraries being identical. Also the library variables are automatically marked 
as advanced. When my latest patch gets merged it will also take care of the 
case when it's not just a library, but a list of libraries to link to.

Anyway, these are the modules that currently do the handling themselves. I 
would welcome if they would either switch to SelectLibraryConfigurations or 
tell me what stops them from doing so.

One thing is that currently the macro automatically sets a _FOUND variable 
which may collide with FPHSA. Maybe we want to introduce a variant of the 
macro that does not do that. I remember that at least in one module I 
explicitely unset the _FOUND variable later to avoid that collision.

-Boost
-Bullet
-Coin3D
-GTK2
-GTest
-HDF5
-OpenSSL
-OpenThreads
-Protobuf
-Qt4
-osg_functions
-wxWidgets
-wxWindows

Greetings,

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

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

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

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