[cmake-developers] [PATCH] fix version handling in find_dependency macro

2014-02-22 Thread Alex Merry
The handling of the optional version argument in the find_dependency()
macro is just wrong.  It is only set if ${ARGV1} (rather than ARGV1)
evaluates to true, and otherwise it remains unchanged from whatever its
previous value was (instead of being cleared).

Either of the attached patches fixes this.

Alex
From 57b10901f1f857bde0471f2be4398dace5c36253 Mon Sep 17 00:00:00 2001
From: Alex Merry k...@randomguy3.me.uk
Date: Sat, 22 Feb 2014 13:35:14 +
Subject: [PATCH] Always set version variable of find_dependency macro

If there is no ARGV1, that is fine; version will be made empty, and no
version will be passed to find_package().
---
 Modules/CMakeFindDependencyMacro.cmake | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index 0f1f56d..c0a0ef7 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -29,9 +29,7 @@
 
 macro(find_dependency dep)
   if (NOT ${dep}_FOUND)
-if (${ARGV1})
-  set(version ${ARGV1})
-endif()
+set(version ${ARGV1})
 set(exact_arg)
 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION_EXACT)
   set(exact_arg EXACT)
-- 
1.9.0

From d9da7a712d331e647d94fc12162e2c4df29ca7eb Mon Sep 17 00:00:00 2001
From: Alex Merry k...@randomguy3.me.uk
Date: Sat, 22 Feb 2014 13:35:14 +
Subject: [PATCH] Fix settings of the version variable of find_dependency macro

It should be reset before use, as this is a macro, and the test should
be against ARGV1, not its value.
---
 Modules/CMakeFindDependencyMacro.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Modules/CMakeFindDependencyMacro.cmake b/Modules/CMakeFindDependencyMacro.cmake
index 0f1f56d..6f7dbe8 100644
--- a/Modules/CMakeFindDependencyMacro.cmake
+++ b/Modules/CMakeFindDependencyMacro.cmake
@@ -29,7 +29,8 @@
 
 macro(find_dependency dep)
   if (NOT ${dep}_FOUND)
-if (${ARGV1})
+set(version)
+if (ARGV1)
   set(version ${ARGV1})
 endif()
 set(exact_arg)
-- 
1.9.0

-- 

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] [New Module] FindOpenCL, FindHg

2014-02-22 Thread Rolf Eike Beer
Am Samstag, 8. Februar 2014, 14:28:37 schrieb Matthäus G. Chajdas:
 Hi,
 
 I would like to propose two new modules for inclusion in CMake:
 FindOpenCL to find OpenCL and FindHg for Mercurial (see attached.)
 FindOpenCL is written in similar spirit to FindOpenGL, while FindHg is
 basically the equivalent of FindSubversion for Mercurial.

I reviewd those modules as new, but as I now see there already has been a 
FindHg.cmake. By changing the variable names youu will now break compatibility 
with older CMake releases.

Some of the changes are wrong, e.g. FindHg - FindHG in the first line. One 
thing that I sadly have not seen before is that you have all calls to CMake 
commands in uppercase as the conventions is to have everything in lowercase 
There has been an automatic conversion a while ago and every new code must 
follow the convention from the beginning.

Looking on the rest of the changes you basically have only added the 
Hg_WC_INFO macro. That isn't change enough to drop my and Kitwares copyright 
(of course it is right to add your own).

Finally the inclusion of FPHSA should use CMAKE_CURRENT_LIST_DIR to make sure 
the version shipped with CMake is used and not one the user has in his 
project. I sadly have also overlooked this in both modules. When you have an 
external module this will of course not work, but all modules inside CMake use 
that.

So, I'm very sorry to come up with those things now and not having catched 
them earlier. If you now do

git diff master..next Modules/FindHg.cmake

you can see the differences. If you change the commands to lowercase and use 
the variable names that have been in use before the diff will be much smaller. 
The rest should be the Windows paths and the new macro.

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

Re: [cmake-developers] Recommendations for reducing spurious link dependencies?

2014-02-22 Thread Ben Boeckel
On Fri, Feb 21, 2014 at 19:59:44 -0800, Dave Abrahams wrote:
 Thanks, but as far as I can tell, only static libraries are involved here

Would it be possible to build them as shared for a one-time run? If not,
you may be left with --gc-sections or removing all library linkings
until you get no missing symbols in each library.

--Ben
-- 

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] Run clean before automatically re-running cmake?

2014-02-22 Thread Abe Bachrach
Agreed that it is a bit heavyweight, but the stray files have resulted in
some pretty cryptic issues in the past (targets linking against an old
version of a library that got renamed etc...).

Your idea sounds good... I'll give it a try.

Thanks!
-=Abe

On Fri, Feb 14, 2014 at 8:55 AM, Bill Hoffman bill.hoff...@kitware.comwrote:

 On 2/14/2014 11:00 AM, Abe Bachrach wrote:

 I'd only want to do a full build if one of the CMakeLists.txt has
 changed (cmake needs to get re-run). Otherwise, I'd like to do a normal
 build.

 That seems a bit over kill to me.  I would rather have a few extra files
 than having a complete clean done each time a new file is added or a flag
 is changed in a CMake file.  Here is what you should do

 1. create a list of all the targets in your project
 2. use configure file to save the list, but be tricky so that it saves the
 last version of the file as well.
 3. add a custom command that all your targets depend on.  The custom
 command should depend on the file that is configured.  It will get run only
 when the file changes if you use copy on different.  When the custom
 command runs it should diff the two files and figure out what target went
 away, and then remove it.

 Basically, you should be able to do this all from the CMake language with
 custom commands and a CMake script.

 -Bill


 --

 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://www.cmake.org/mailman/listinfo/cmake

-- 

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://www.cmake.org/mailman/listinfo/cmake

[Cmake-commits] CMake branch, next, updated. v2.8.12.2-1648-ga2aa041

2014-02-22 Thread Matthaus G . Chajdas
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, next has been updated
   via  a2aa041a37ed71cb50bbee001ee8f8ed0d8ab76a (commit)
   via  49f21d8967e2f76b8ee7d5d65855665a76f025e1 (commit)
   via  4e647cf6b5114307ff0e4bc985b53a0c04661623 (commit)
  from  2f164149ce6dfe7c9a5689ef523e9b3c16f69a2f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a2aa041a37ed71cb50bbee001ee8f8ed0d8ab76a
commit a2aa041a37ed71cb50bbee001ee8f8ed0d8ab76a
Merge: 2f16414 49f21d8
Author: Matthaus G. Chajdas cm...@anteru.net
AuthorDate: Sat Feb 22 13:48:51 2014 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Sat Feb 22 13:48:51 2014 -0500

Merge topic 'find-hg-opencl' into next

49f21d89 Add FindOpenCL and FindHg modules.
4e647cf6 CMake Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=49f21d8967e2f76b8ee7d5d65855665a76f025e1
commit 49f21d8967e2f76b8ee7d5d65855665a76f025e1
Author: Matthäus G. Chajdas cm...@anteru.net
AuthorDate: Sat Feb 22 19:46:48 2014 +0100
Commit: Matthäus G. Chajdas cm...@anteru.net
CommitDate: Sat Feb 22 19:46:48 2014 +0100

Add FindOpenCL and FindHg modules.

diff --git a/Help/module/FindOpenCL.rst b/Help/module/FindOpenCL.rst
new file mode 100644
index 000..e87e289
--- /dev/null
+++ b/Help/module/FindOpenCL.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindOpenCL.cmake
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index a1fb33f..6887175 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -1,29 +1,46 @@
 #.rst:
-# FindHg
+# FindHG
 # --
 #
-#
+# Extract information from a mercurial working copy
 #
 # The module defines the following variables:
 #
 # ::
 #
-#HG_EXECUTABLE - path to mercurial command line client (hg)
-#HG_FOUND - true if the command line client was found
-#HG_VERSION_STRING - the version of mercurial found
+#   Hg_EXECUTABLE - path to mercurial command line client
+#   Hg_FOUND - true if the command line client was found
+#   Hg_VERSION_STRING - the version of the mercurial client
+#
+#
+# If the command line client executable is found the following macro is 
defined:
+#
+# ::
+#
+#   Hg_WC_INFO(dir var-prefix)
+#
+# Hg_WC_INFO extracts information of a mercurial working copy
+# at a given location.  This macro defines the following variables:
+#
+# ::
+#
+#   var-prefix_WC_CHANGESET - current changeset
+#   var-prefix_WC_REVISION - current revision
 #
 # Example usage:
 #
 # ::
 #
-#find_package(Hg)
-#if(HG_FOUND)
-#  message(hg found: ${HG_EXECUTABLE})
-#endif()
+#   find_package(Hg)
+#   if(Hg_FOUND)
+# Hg_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+# message(Current revision is ${Project_WC_REVISION})
+# message(Current changeset is ${Project_WC_CHANGESET})
+#   endif()
+#
 
 #=
-# Copyright 2010-2012 Kitware, Inc.
-# Copyright 2012  Rolf Eike Beer e...@sf-mail.de
+# Copyright 2014 Matthaeus G. Chajdas
 #
 # Distributed under the OSI-approved BSD License (the License);
 # see accompanying file Copyright.txt for details.
@@ -35,27 +52,40 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)
 
-find_program(HG_EXECUTABLE
+FIND_PROGRAM(Hg_EXECUTABLE
   NAMES hg
-  PATH_SUFFIXES Mercurial
-  DOC hg command line client
-  )
-mark_as_advanced(HG_EXECUTABLE)
+  PATHS [HKEY_LOCAL_MACHINE\\Software\\TortoiseHG]
+  [HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\TortoiseHG]
+  DOC hg command line client)
+MARK_AS_ADVANCED(Hg_EXECUTABLE)
+
+IF(Hg_EXECUTABLE)
+  EXECUTE_PROCESS(COMMAND ${Hg_EXECUTABLE} --version
+OUTPUT_VARIABLE Hg_VERSION
+ERROR_QUIET
+OUTPUT_STRIP_TRAILING_WHITESPACE)
+  IF(Hg_VERSION MATCHES ^Mercurial Distributed SCM \\(version 
([0-9][^)]*)\\))
+SET(Hg_VERSION_STRING ${CMAKE_MATCH_1})
+  ENDIF()
+  UNSET(Hg_VERSION)
+
+  MACRO(Hg_WC_INFO dir prefix)
+EXECUTE_PROCESS(COMMAND ${Hg_EXECUTABLE} id -i -n
+  WORKING_DIRECTORY ${dir}
+  ERROR_VARIABLE Hg_ERROR
+  OUTPUT_VARIABLE ${prefix}_WC_DATA
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
+IF(NOT ${Hg_error} EQUAL 0)
+  MESSAGE(SEND_ERROR Command \${Hg_EXECUTBALE} id -n\ in directory 
${dir} failed with output:\n${Hg_ERROR})
+ENDIF()
 
-if(HG_EXECUTABLE)
-  execute_process(COMMAND ${HG_EXECUTABLE} --version
-  OUTPUT_VARIABLE hg_version
-  ERROR_QUIET
-  OUTPUT_STRIP_TRAILING_WHITESPACE)
-  if(hg_version MATCHES ^Mercurial Distributed SCM \\(version 
([0-9][^)]*)\\))
-set(HG_VERSION_STRING 

[Cmake-commits] CMake branch, master, updated. v2.8.12.2-1483-g01981d8

2014-02-22 Thread Kitware Robot
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project CMake.

The branch, master has been updated
   via  01981d8e45a60a66f3140a981c0bc1e7fe2ea804 (commit)
  from  4e647cf6b5114307ff0e4bc985b53a0c04661623 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=01981d8e45a60a66f3140a981c0bc1e7fe2ea804
commit 01981d8e45a60a66f3140a981c0bc1e7fe2ea804
Author: Kitware Robot kwro...@kitware.com
AuthorDate: Sun Feb 23 00:01:05 2014 -0500
Commit: Kitware Robot kwro...@kitware.com
CommitDate: Sun Feb 23 00:01:05 2014 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ef128e1..693144a 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 0)
-set(CMake_VERSION_PATCH 20140222)
+set(CMake_VERSION_PATCH 20140223)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits