[cmake-developers] [CMake 0012507]: FindRuby.cmake doesn't find system Ruby library

2011-10-10 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://www.cmake.org/Bug/view.php?id=12507 
== 
Reported By:Vadim Zhukov
Assigned To:
== 
Project:CMake
Issue ID:   12507
Category:   Modules
Reproducibility:always
Severity:   tweak
Priority:   normal
Status: new
== 
Date Submitted: 2011-10-10 05:37 EDT
Last Modified:  2011-10-10 05:37 EDT
== 
Summary:FindRuby.cmake doesn't find system Ruby library
Description: 
FindRuby.cmake could not find Ruby library on OpenBSD when the latter is
installed from ports. The problem is connected with the fact that Ruby library
is named rubyXY, not rubyX.Y. Attached a patch that resolves the issue.

Steps to Reproduce: 
Just use find_package(Ruby).
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-10-10 05:37 Vadim Zhukov   New Issue
2011-10-10 05:37 Vadim Zhukov   File Added: patch-Modules_FindRuby_cmake
   
==

--

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] [CMake 0012508]: Cosmetic fix for cmake configure (Tests/FindPackageModeMakefileTest/CMakeLists.txt)

2011-10-10 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://www.cmake.org/Bug/view.php?id=12508 
== 
Reported By:David Coppa
Assigned To:
== 
Project:CMake
Issue ID:   12508
Category:   CMake
Reproducibility:always
Severity:   tweak
Priority:   normal
Status: new
== 
Date Submitted: 2011-10-10 07:00 EDT
Last Modified:  2011-10-10 07:00 EDT
== 
Summary:Cosmetic fix for cmake configure
(Tests/FindPackageModeMakefileTest/CMakeLists.txt)
Description: 

On OpenBSD, during bootstrap for cmake 2.8.6, you have the following output:

...
-- Looking for a Fortran compiler
-- Looking for a Fortran compiler - /usr/local/bin/g77
make: unknown option -- v
usage: make [-BeiknPqrSst] [-D variable] [-d flags] [-f makefile]
[-I directory] [-j max_jobs] [-m directory] [-V variable]
[NAME=value] [target ...]
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
...

That's ugly to see. The attached diff fixes this issue.
I think it's acceptable, since GNU make sends its -v output to stdout.


diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index def8d63..3674f0e 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -7,6 +7,7 @@ if(UNIX  AND  ${CMAKE_GENERATOR} MATCHES Makefile)
   # is AFAIK a GNU make extension. Alex
   execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -v
   OUTPUT_VARIABLE makeVersionOutput
+  ERROR_QUIET
   TIMEOUT 10)
   string(TOUPPER ${makeVersionOutput} MAKE_VERSION_OUTPUT)
   if(${MAKE_VERSION_OUTPUT} MATCHES .*GNU MAKE.*)


== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-10-10 07:00 David CoppaNew Issue
2011-10-10 07:00 David CoppaFile Added: FindPackageModeMakefileTest.diff
   
==

--

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] try_compile does not work for linker flags?

2011-10-10 Thread Brad King

On 10/8/2011 7:40 AM, Stephen Kelly wrote:

Would it break anything if we changed check_cxx_compiler_flag to build a
shared library instead of an executable? Maybe that will make the
try_compile fail as expected. (I'll try add a test for that now)


We cannot make a change like that to such a widely used check.  It will
undoubtedly cause subtle behavior changes for other checks.

You can use the source-tree signature of try_compile to build your own
test project that creates a shared library and tries using that flag.

BTW, the reason the compiler won't warn about -Wl,--no-undefined is
because -Wl, is the part parsed by the compiler.  It then passes the
--no-undefined option to the linker, and the linker is not warning.

-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] Setting the link interface and dependencies in one command

2011-10-10 Thread Brad King

On 10/9/2011 11:35 AM, Alexander Neundorf wrote:

But doesn't this still have the same problem ?

I mean, if LINK_PUBLIC is at the end of a ${FOO_LIBS} variable, everything
put after it will be PUBLIC:
target_link_libraries(Foo LINK_PRIVATE lib1 lib2 ${FOO_LIBS} lib3)

with FOO_LIBS being e.g. LINK_PRIVATE libA LINK_PUBLIC libB.
Or isn't that what you meant ?


Stephen asked the same question and I answered it on 2011-10-07 8:36am EDT:

  http://www.cmake.org/pipermail/cmake-developers/2011-October/002267.html

The answer is yes, but it is less likely to happen unintentionally.

-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] try_compile does not work for linker flags?

2011-10-10 Thread Stephen Kelly
Brad King wrote:

 On 10/8/2011 7:40 AM, Stephen Kelly wrote:
 Would it break anything if we changed check_cxx_compiler_flag to build a
 shared library instead of an executable? Maybe that will make the
 try_compile fail as expected. (I'll try add a test for that now)
 
 We cannot make a change like that to such a widely used check.  It will
 undoubtedly cause subtle behavior changes for other checks.
 
 You can use the source-tree signature of try_compile to build your own
 test project that creates a shared library and tries using that flag.
 
 BTW, the reason the compiler won't warn about -Wl,--no-undefined is
 because -Wl, is the part parsed by the compiler.  It then passes the
 --no-undefined option to the linker, and the linker is not warning.


Yes, I realised all this yesterday too and wrote a new macro 
check_cxx_linker_flags. It required changing try_compile to not use 
add_executable, but optionally to create a shared library. 

It is staged as check-cxx-linker-flags, and seems to work on linux for me. 
(I haven't tried on windows yet)



--

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] [CMake 0012509]: pkg_search_module outputs nothing

2011-10-10 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12509 
== 
Reported By:Ilya K.
Assigned To:
== 
Project:CMake
Issue ID:   12509
Category:   (No Category)
Reproducibility:have not tried
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2011-10-10 21:17 MSD
Last Modified:  2011-10-10 21:17 MSD
== 
Summary:pkg_search_module outputs nothing
Description: 
pkg_search_module macro outputs only checking for one of the modules and
doesn't show any information about library name and version. I do not know is it
bug or not, but pkg_check_modules shows all useful information. Is it possible
to fix this? Thank you.

Steps to Reproduce: 
Just run cmake ./ inside my project [1] and see output.

1. http://qmmp.ylsoftware.com/files/qmmp-0.5.2.tar.bz2
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-10-10 21:17 Ilya K.New Issue
==

--

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] [CMake 0012510]: FindDCMTK does not find MacPorts dcmtk properly

2011-10-10 Thread Mantis Bug Tracker

The following issue has been SUBMITTED. 
== 
http://public.kitware.com/Bug/view.php?id=12510 
== 
Reported By:Torsten Rohlfing
Assigned To:
== 
Project:CMake
Issue ID:   12510
Category:   Modules
Reproducibility:always
Severity:   minor
Priority:   normal
Status: new
== 
Date Submitted: 2011-10-10 17:42 EDT
Last Modified:  2011-10-10 17:42 EDT
== 
Summary:FindDCMTK does not find MacPorts dcmtk properly
Description: 
On MacOS X with MacPorts DCMTK library installed under /opt/local, FindDCMTK()
in cmake 2.8.5 finds DCMTK libraries but not headers.

Steps to Reproduce: 
Configure the following CMake project:

## BEGIN
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(SomeToolkit)

FIND_PACKAGE(DCMTK)
## END

Cmake reports:

-- Could NOT find DCMTK (missing:  DCMTK_config_INCLUDE_DIR
DCMTK_ofstd_INCLUDE_DIR DCMTK_dcmdata_INCLUDE_DIR DCMTK_dcmimgle_INCLUDE_DIR) 

Also curious:

DCMTK_DIR is set to /usr/include/dcmtk, which does not exist; moreover,
there is no trace of dcmtk anywhere in the /usr tree.

I am attaching complete CMakeCache.txt file for references.
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2011-10-10 17:42 Torsten RohlfingNew Issue
2011-10-10 17:42 Torsten RohlfingFile Added: CMakeCache.txt
==

--

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] run tests on 5 machines

2011-10-10 Thread Mihai Sandu
How can I run tests on 5 machines in same time?

This is how I run the tests on a machine:

execute_process (COMMAND ssh user@host ctest -VV -O file.txt -S Test.cmake)

and I want to run this command in the same time on 5 machines.

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

Re: [CMake] run tests on 5 machines

2011-10-10 Thread Eric Noulard
2011/10/10 Mihai Sandu voyage...@gmail.com:
 How can I run tests on 5 machines in same time?
 This is how I run the tests on a machine:

 execute_process (COMMAND ssh user@host ctest -VV -O file.txt -S
 Test.cmake)

 and I want to run this command in the same time on 5 machines.

May be you can try pssh:
http://code.google.com/p/parallel-ssh/

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
--
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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] not found library with package configuration files and changed CMAKE_INSTALL_PREFIX

2011-10-10 Thread Alexander Dahl
Hei hei, 

On Wed, 21 Sep 2011 16:42:37 +0200, Alexander Dahl wrote:
 The foo-targets.cmake file contains foo-shared as imported target,
 and it is this name that must be supplied to TARGET_LINK_LIBRARIES().
 Besides, the DESTINATION clause of INSTALL() should be qualified with
 ARCHIVE/LIBRARY/RUNTIME/..., and EXPORT must precede DESTINATION then.
 
 Did that.

And it only works in Linux (Ubuntu Lucid 10.04 native with CMake 2.8.5
or cross compiling with ptxdist). On Windows XP with VS 2009 and CMake
2.8.5 the following happens:

install(TARGETS ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets
LIBRARY DESTINATION lib)
#install(TARGETS ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets
DESTINATION lib)
install(EXPORT ${PROJECT_NAME}-targets DESTINATION
lib/cmake/${PROJECT_NAME})

With the first line used it gives the following error:

CMake Error at src/CMakeLists.txt:19 (install):
  install Library TARGETS given no DESTINATION!

Commenting in the first line and using the second (removing the LIBRARY
keyword from the line) configure and build works. If someone wants to
reproduce: this is in my forked tree of the iniparser library, you could
get it from GitHub here: https://github.com/LeSpocky/iniparser/tree/work

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***
--
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://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Contribute two new find package implementation.

2011-10-10 Thread Mathias Fröhlich

Hi,

On Friday 07 October 2011, Eric Noulard wrote:
 Ok I understand.
 I'll get in touch with Petr to see if he has time to update its
 contribution if he has not I may offer to take over.
Ok, So I am around and can respond to questions more or less timely but I am 
not monitoring the mailing list.

 find_package(RTI)
would find all of them 1.3, 1516 and 1516e (which is 1516-2010 right?)
This would define
   RTI13_FOUND if 1.3 compliant RTI is found
   RTI1516_FOUND if 1516 compliant RTI is found
   RTI1516e_FOUND ...

 find_package(RTI COMPONENT RTI1516)

 would only search for 1516.

 find_package(RTI COMPONENT RTI13 RTI1516)

 search for 1.3 and 1516 only etc...
Ok, thats fine then.

 Like I said I will contact Petr directly and ask him whether if he wants
 to continue to maintain the CMake FindRTI.cmake, if not I'll take over
 and import your work + the CERTI modification and propose a unified
 version for CMake.
So you are incorporating the contributed files into FindRTI then?
Or do I need to take some actions?

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


Re: [CMake] not found library with package configuration files and changed CMAKE_INSTALL_PREFIX

2011-10-10 Thread Rolf Eike Beer
 Hei hei,

 On Wed, 21 Sep 2011 16:42:37 +0200, Alexander Dahl wrote:
 The foo-targets.cmake file contains foo-shared as imported target,
 and it is this name that must be supplied to TARGET_LINK_LIBRARIES().
 Besides, the DESTINATION clause of INSTALL() should be qualified with
 ARCHIVE/LIBRARY/RUNTIME/..., and EXPORT must precede DESTINATION then.

 Did that.

 And it only works in Linux (Ubuntu Lucid 10.04 native with CMake 2.8.5
 or cross compiling with ptxdist). On Windows XP with VS 2009 and CMake
 2.8.5 the following happens:

 install(TARGETS ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets
 LIBRARY DESTINATION lib)
 #install(TARGETS ${PROJECT_NAME}-shared EXPORT ${PROJECT_NAME}-targets
 DESTINATION lib)
 install(EXPORT ${PROJECT_NAME}-targets DESTINATION
 lib/cmake/${PROJECT_NAME})

 With the first line used it gives the following error:

 CMake Error at src/CMakeLists.txt:19 (install):
   install Library TARGETS given no DESTINATION!

Libraries on Windows behave differently because of the .lib/.dll split.
The details are in the install(TARGETS) documentation.

Greetings,

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


Re: [CMake] Contribute two new find package implementation.

2011-10-10 Thread Mathias Fröhlich

Hi,

On Monday 10 October 2011, Michael Hertling wrote:
 AFAICS from Mathias' FindRTI1516{,E}.cmake modules, the libraries have
 different names, but their respective header files are named the same:

 FIND_LIBRARY(RTI1516_LIBRARY  NAMES rti1516  RTI1516 ...)
 FIND_LIBRARY(RTI1516E_LIBRARY NAMES rti1516e RTI1516E ...)

 FIND_PATH(RTI1516_INCLUDE_DIR  NAMES RTI/RTI1516.h ...)
 FIND_PATH(RTI1516E_INCLUDE_DIR NAMES RTI/RTI1516.h ...)
Yes.

 Therefore, the usage of both libraries for the same binary should be
 quite possible as long as they don't violate the one-definition-rule,
 whereas the inclusion of both headers for the same compilation unit
 will require some trickery, e.g. an intermediate header containing
 configured #include directives with the other headers' full paths.
Yes.
Having different include paths for different object files would be sufficient 
to include all in the same application.
Cmake can do this fine.

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


[CMake] Question about variables, cache, and scope

2011-10-10 Thread Robert Dailey
I have a function that I define in my top-most CMakeLists.txt file (on
Windows using CMake version 2.8.6) called define_project() that calls
add_executable, sets up compile defintions, etc etc.

For each time define_project() is called *anywhere* in the directory
hierarchy, I need to increment a global project_count variable to keep
track of how many projects were created and print that at the very end of
the root CMakeLists.txt file.

So far my attempts at this have been unsuccessful. I tried creating a cache
variable in the root script:

set( project_count 0 CACHE INTERNAL  )

Then inside of my function, I do this:

function( define_project ... )
   math( EXPR count ${project_count}+1 )
   set( project_count ${count} )
endfunction()

However, 'project_count' is always 0 each time that the function is
executed.

How can I make this work?

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

[CMake] CTest print output value

2011-10-10 Thread mohamed sahraoui

Hi ,

I would like to generate a txt report  including  
various informations produced by each test execution. 
my ideas was in a second step to post this cover test onto a cdash portal.


My CMakeLists.txt  produce a well formed CTestTestfile.cmake file with the 
following a classical structure :

ADD_TEST(Phase1_oconnell bin/Linux/toulbar2 
/home/validation/default/oconnell.wcsp -B=0 -v -e:)
SET_TESTS_PROPERTIES(Phase1_oconnell PROPERTIES  PASS_REGULAR_EXPRESSION 
Optimum:  TIMEOUT 100)

i would like to catch the stdout line produced by the test execution

the standard output print :
=

Optimum: 328 in 15 backtracks and 15 nodes and 0 seconds.
end.

=

how can i do to  respectively catch foreach test the following informations ;

${Optimum} 
${backtracks}
${nodes}
${seconds}

my ideas is generate a csv files and post it on the dashboard after post 
processing.




report exemple : cat report.txt
test;optimum;backtracks;nodes;seconds;
Phase1_oconnell;328;15;15;0;


thanks ,

sincerely Mohamed 





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

Re: [CMake] Question about variables, cache, and scope

2011-10-10 Thread Glenn Coombs
Calling a function pushs a new variable scope.  All variables visible in the
callers scope are copied into the new scope but changes by default only
affect the callee scope.  You could try using the PARENT_SCOPE option to the
set command but I'm not sure that will achieve what you want as it only gets
you to the next scope whereas you really want a global variable.

You can use properties instead of variables as those are explicitly scoped.
So something like this:

set_property(GLOBAL PROPERTY project_count 0)

function( define_project ... )
   get_property(old_count GLOBAL PROPERTY project_count)
   math( EXPR new_count ${old_count}+1 )
   set_property(GLOBAL PROPERTY project_count ${new_count}
endfunction()

will probably work.

--
Glenn


On 10 October 2011 17:11, Robert Dailey rcdai...@gmail.com wrote:

 I have a function that I define in my top-most CMakeLists.txt file (on
 Windows using CMake version 2.8.6) called define_project() that calls
 add_executable, sets up compile defintions, etc etc.

 For each time define_project() is called *anywhere* in the directory
 hierarchy, I need to increment a global project_count variable to keep
 track of how many projects were created and print that at the very end of
 the root CMakeLists.txt file.

 So far my attempts at this have been unsuccessful. I tried creating a cache
 variable in the root script:

 set( project_count 0 CACHE INTERNAL  )

 Then inside of my function, I do this:

 function( define_project ... )
math( EXPR count ${project_count}+1 )
set( project_count ${count} )
 endfunction()

 However, 'project_count' is always 0 each time that the function is
 executed.

 How can I make this work?

 -
 Robert Dailey

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

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

Re: [CMake] Question about variables, cache, and scope

2011-10-10 Thread Robert Dailey
Yes, this works perfectly.

It's a bit disappointing that cache variables are, for all intents and
purposes, read-only in functions. The property approach is a bit more
verbose but it functions! I think 'set' needs a new override specifically
for cases like this. Something similar to PARENT_SCOPE, but something like
CACHE_SCOPE, that forces CMake to first check for the existance of a cache
variable with that name, and it would take precedence over any identically
named variable in function scope.

On another note, you'd think this would work too but it doesn't:

set( project_count ${new_count} CACHE INTERNAL FORCE )

Thanks!

-
Robert Dailey


On Mon, Oct 10, 2011 at 2:01 PM, Glenn Coombs glenn.coo...@gmail.comwrote:

 Calling a function pushs a new variable scope.  All variables visible in
 the callers scope are copied into the new scope but changes by default only
 affect the callee scope.  You could try using the PARENT_SCOPE option to the
 set command but I'm not sure that will achieve what you want as it only gets
 you to the next scope whereas you really want a global variable.

 You can use properties instead of variables as those are explicitly
 scoped.  So something like this:

 set_property(GLOBAL PROPERTY project_count 0)

 function( define_project ... )
get_property(old_count GLOBAL PROPERTY project_count)
math( EXPR new_count ${old_count}+1 )
set_property(GLOBAL PROPERTY project_count ${new_count}
 endfunction()

 will probably work.

 --
 Glenn


 On 10 October 2011 17:11, Robert Dailey rcdai...@gmail.com wrote:

 I have a function that I define in my top-most CMakeLists.txt file (on
 Windows using CMake version 2.8.6) called define_project() that calls
 add_executable, sets up compile defintions, etc etc.

 For each time define_project() is called *anywhere* in the directory
 hierarchy, I need to increment a global project_count variable to keep
 track of how many projects were created and print that at the very end of
 the root CMakeLists.txt file.

 So far my attempts at this have been unsuccessful. I tried creating a
 cache variable in the root script:

 set( project_count 0 CACHE INTERNAL  )

 Then inside of my function, I do this:

 function( define_project ... )
math( EXPR count ${project_count}+1 )
set( project_count ${count} )
 endfunction()

 However, 'project_count' is always 0 each time that the function is
 executed.

 How can I make this work?

 -
 Robert Dailey

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



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

Re: [CMake] Question about variables, cache, and scope

2011-10-10 Thread Bill Hoffman

On 10/10/2011 3:52 PM, Robert Dailey wrote:

Yes, this works perfectly.

It's a bit disappointing that cache variables are, for all intents and
purposes, read-only in functions. The property approach is a bit more
verbose but it functions! I think 'set' needs a new override
specifically for cases like this. Something similar to PARENT_SCOPE,
but something like CACHE_SCOPE, that forces CMake to first check for
the existance of a cache variable with that name, and it would take
precedence over any identically named variable in function scope.

On another note, you'd think this would work too but it doesn't:

set( project_count ${new_count} CACHE INTERNAL FORCE )



This works:

set( project_count 0 CACHE INTERNAL )
function( define_project )
   math( EXPR count ${project_count}+1 )
   set( project_count ${count} CACHE INTERNAL )
endfunction()
define_project()
message(${project_count})
define_project()
message(${project_count})
define_project()
message(${project_count})

It prints out
1
2
3

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


[Cmake-commits] CMake branch, next, updated. v2.8.6-1541-g64c1dcc

2011-10-10 Thread Brad King
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  64c1dcccf5c5dfb8a9c1c1bbdf30a205b13efd0d (commit)
   via  32f8437bbfc7141ba4ff9c6dd4311e67c25c2ad2 (commit)
  from  caf1edba845d6a4da73356a662452595cd504873 (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=64c1dcccf5c5dfb8a9c1c1bbdf30a205b13efd0d
commit 64c1dcccf5c5dfb8a9c1c1bbdf30a205b13efd0d
Merge: caf1edb 32f8437
Author: Brad King brad.k...@kitware.com
AuthorDate: Mon Oct 10 09:51:58 2011 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Mon Oct 10 09:51:58 2011 -0400

Merge topic 'ninja-generator-prep' into next

32f8437 Fix line-too-long style violations


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32f8437bbfc7141ba4ff9c6dd4311e67c25c2ad2
commit 32f8437bbfc7141ba4ff9c6dd4311e67c25c2ad2
Author: Brad King brad.k...@kitware.com
AuthorDate: Mon Oct 10 09:44:33 2011 -0400
Commit: Brad King brad.k...@kitware.com
CommitDate: Mon Oct 10 09:46:27 2011 -0400

Fix line-too-long style violations

Commit 8a0eb78f (Constify many getters of cmGlobalGenerator, 2011-03-26)
added const qualifiers to many cmGlobalGenerator methods but left the
resulting lines beyond our style's limit of 79 characters.

diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 96a326c..9f140a9 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -220,7 +220,8 @@ public:
 
   /** Get the manifest of all targets that will be built for each
   configuration.  This is valid during generation only.  */
-  cmTargetManifest const GetTargetManifest() const { return 
this-TargetManifest; }
+  cmTargetManifest const GetTargetManifest() const
+  { return this-TargetManifest; }
 
   /** Get the content of a directory.  Directory listings are loaded
   from disk at most once and cached.  During the generation step
@@ -231,12 +232,12 @@ public:
 
   void AddTarget(cmTargets::value_type v);
 
-  virtual const char* GetAllTargetName()   const { return ALL_BUILD; 
}
+  virtual const char* GetAllTargetName() const { return ALL_BUILD; }
   virtual const char* GetInstallTargetName()   const { return INSTALL; }
   virtual const char* GetInstallLocalTargetName()  const { return 0; }
   virtual const char* GetInstallStripTargetName()  const { return 0; }
   virtual const char* GetPreinstallTargetName()const { return 0; }
-  virtual const char* GetTestTargetName()  const { return RUN_TESTS; 
}
+  virtual const char* GetTestTargetName()const { return RUN_TESTS; }
   virtual const char* GetPackageTargetName()   const { return PACKAGE; }
   virtual const char* GetPackageSourceTargetName() const { return 0; }
   virtual const char* GetEditCacheTargetName() const { return 0; }
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h 
b/Source/cmGlobalUnixMakefileGenerator3.h
index 7c6bbc2..481640b 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -136,18 +136,18 @@ protected:
   // does this generator need a requires step for any of its targets
   bool NeedRequiresStep(cmTarget const);
 
-  // Setup target names
-  virtual const char* GetAllTargetName()   const { return all; }
-  virtual const char* GetInstallTargetName()   const { return install; }
-  virtual const char* GetInstallLocalTargetName()  const { return 
install/local; }
-  virtual const char* GetInstallStripTargetName()  const { return 
install/strip; }
-  virtual const char* GetPreinstallTargetName()const { return 
preinstall; }
-  virtual const char* GetTestTargetName()  const { return test; }
-  virtual const char* GetPackageTargetName()   const { return package; }
-  virtual const char* GetPackageSourceTargetName() const { return 
package_source; }
-  virtual const char* GetEditCacheTargetName() const { return 
edit_cache; }
-  virtual const char* GetRebuildCacheTargetName()  const { return 
rebuild_cache; }
-  virtual const char* GetCleanTargetName() const { return clean; }
+  // Target name hooks for superclass.
+  const char* GetAllTargetName()   const { return all; }
+  const char* GetInstallTargetName()   const { return install; }
+  const char* GetInstallLocalTargetName()  const { return install/local; }
+  const char* GetInstallStripTargetName()  const { return install/strip; }
+  const char* GetPreinstallTargetName()const { return preinstall; }
+  const char* GetTestTargetName()  const { return test; }
+  const char* GetPackageTargetName()   const { return 

[Cmake-commits] CMake branch, next, updated. v2.8.6-1547-g89af01e

2011-10-10 Thread Stephen Kelly
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  89af01e7740440b8ac12a5f983dae93b34911482 (commit)
   via  08271ec7d3184c8a53ae80be9ec0ac6438032cfa (commit)
   via  c83cfd7a01f2fb00ba7d545b0df667c0d43b296f (commit)
   via  48171cefb5bc4a52953b08ade9459584fddc3d0d (commit)
   via  783da62f2ea539fa5baf96bb28f7f6690f748229 (commit)
   via  61c69d3fbbdb0390eb8f27e39a30a21d43ab4169 (commit)
  from  64c1dcccf5c5dfb8a9c1c1bbdf30a205b13efd0d (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=89af01e7740440b8ac12a5f983dae93b34911482
commit 89af01e7740440b8ac12a5f983dae93b34911482
Merge: 64c1dcc 08271ec
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Mon Oct 10 10:39:45 2011 -0400
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Mon Oct 10 10:39:45 2011 -0400

Merge topic 'export-header-tests' into next

08271ec Build each library only once instead of once for each test.
c83cfd7 Remove unused define.
48171ce KWSys Nightly Date Stamp
783da62 KWSys Nightly Date Stamp
61c69d3 KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08271ec7d3184c8a53ae80be9ec0ac6438032cfa
commit 08271ec7d3184c8a53ae80be9ec0ac6438032cfa
Author: Stephen Kelly steve...@gmail.com
AuthorDate: Sun Oct 9 17:41:47 2011 +0200
Commit: Stephen Kelly steve...@gmail.com
CommitDate: Sun Oct 9 17:41:47 2011 +0200

Build each library only once instead of once for each test.

diff --git a/Tests/Module/GenerateExportHeader/CMakeLists.txt 
b/Tests/Module/GenerateExportHeader/CMakeLists.txt
index 7a52c71..4a5b1cb 100644
--- a/Tests/Module/GenerateExportHeader/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/CMakeLists.txt
@@ -55,6 +55,29 @@ else()
   endif()
 endif()
 
+set(DEPS
+  libshared
+  libstatic
+  lib_shared_and_static
+)
+
+foreach(DEP ${DEPS})
+  try_compile(Result ${CMAKE_CURRENT_BINARY_DIR}/${DEP}_build
+${CMAKE_CURRENT_SOURCE_DIR}/${DEP}
+${DEP}
+OUTPUT_VARIABLE Out
+  )
+  if (NOT Result)
+message(OUTPUT: ${Out})
+  endif()
+endforeach()
+
+# The _do_build macro is called from a child scope, where
+# the current source and binary dir are different. Save them here
+# for use in the macro.
+set(TEST_TOP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(TEST_TOP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
 
 # We seem to get race conditions is writing this stuff to the same file at 
least on MinGW
 # So to write to separate source and build directories, we use a count to 
differentiate.
@@ -67,8 +90,6 @@ macro(_do_build Include Library LibrarySource Source)
 int main() { ${Source}; }\n
   )
 
-  file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../${LibrarySource} DESTINATION 
${CMAKE_CURRENT_BINARY_DIR}/test${COUNT})
-
   if (${Library} STREQUAL static_variant)
 set(CONDITIONAL_STATIC_DEFINE 
add_definitions(-DLIBSHARED_AND_STATIC_STATIC_DEFINE)\n)
   endif()
@@ -90,9 +111,10 @@ macro(_do_build Include Library LibrarySource Source)
   add_definitions(${ERROR_FLAG})\n
 endif()\n
 
-add_subdirectory(\${LibrarySource}\)\n
+
include(\${TEST_TOP_BINARY_DIR}/${LibrarySource}_build/Targets.cmake\)\n
 
-include_directories(\${LibrarySource}\ 
\\${CMAKE_CURRENT_BINARY_DIR}/${LibrarySource}\)\n
+include_directories(\${TEST_TOP_SOURCE_DIR}/${LibrarySource}\\n
+\${TEST_TOP_BINARY_DIR}/${LibrarySource}_build\)\n
 
 ${CONDITIONAL_STATIC_DEFINE}
 
diff --git 
a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt 
b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
index d19b6dc..be0387f 100644
--- a/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
+++ b/Tests/Module/GenerateExportHeader/lib_shared_and_static/CMakeLists.txt
@@ -1,4 +1,13 @@
-project(shared_and_static)
+
+cmake_minimum_required(VERSION 2.8)
+
+project(lib_shared_and_static)
+
+include(GenerateExportHeader)
+
+add_compiler_export_flags()
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
 
 set(lib_SRCS
   libshared_and_static.cpp
@@ -10,3 +19,5 @@ add_library(static_variant ${lib_SRCS})
 generate_export_header(shared_variant BASE_NAME libshared_and_static)
 
 set_target_properties(static_variant PROPERTIES COMPILE_FLAGS 
-DLIBSHARED_AND_STATIC_STATIC_DEFINE)
+
+export(TARGETS shared_variant static_variant FILE Targets.cmake)
diff --git a/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt 
b/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt
index 8e4ee2b..e20adb1 100644
--- a/Tests/Module/GenerateExportHeader/libshared/CMakeLists.txt
+++ 

[Cmake-commits] CMake branch, master, updated. v2.8.6-8-gfac6e2e

2011-10-10 Thread KWSys 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  fac6e2ef4448a3dd42c149383468b9b681d3215f (commit)
  from  d1f5a3bff9ebebf1e0df268e31f4853bfd46a8df (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=fac6e2ef4448a3dd42c149383468b9b681d3215f
commit fac6e2ef4448a3dd42c149383468b9b681d3215f
Author: KWSys Robot kwro...@kitware.com
AuthorDate: Tue Oct 11 00:01:08 2011 -0400
Commit: KWSys Robot kwro...@kitware.com
CommitDate: Tue Oct 11 00:09:47 2011 -0400

KWSys Nightly Date Stamp

diff --git a/Source/kwsys/kwsysDateStamp.cmake 
b/Source/kwsys/kwsysDateStamp.cmake
index b22febf..434e6af 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR  2011)
 SET(KWSYS_DATE_STAMP_MONTH 10)
 
 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   10)
+SET(KWSYS_DATE_STAMP_DAY   11)

---

Summary of changes:
 Source/kwsys/kwsysDateStamp.cmake |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


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