Re: [CMake] Install multiple components using CPack

2013-11-13 Thread Alexander Broekhuis
Hi,


2013/11/11 Mark Stijnman mark.stijn...@gmail.com

 On Tue, Nov 5, 2013 at 12:11 PM, Alexander Broekhuis


 The easiest way I know is to use CPACK_COMPONENTS_ALL, which is what I
 use to package subsets of my components.


I now solved it using CPACK_INSTALL_CMAKE_PROJECTS and populating it with
all components to be installed. Not sure how CPACK_COMPONENTS_ALL is
different, but will take a look.


 I don't currently use grouping, but if I would, I would create
 something like an add_component_to_group(compname, groupname)
 function, that you can call for every component when you first define
 it (or add a GROUP parameter it to my define_package_component()
 function). In addition to setting
 PACK_COMPONENT_${compname_uppercase}_GROUP to ${groupname}, it should
 append ${compname} to a (global) package_group_${groupname}_components
 list variable. Then populate the CPACK_COMPONENTS_ALL list by
 iterating over your list of required groups, and for each group name,
 append ${package_group_${groupname}_components}.


In my custom Macros I do more or less the same. I append all components to
a cached internal variable. Then later on I create the CPack configuration
with this information. I guess you mean the same when talking about a
global variable? Or is there a different more simpler way without using the
cache?

I use the following:
set(CPACK_INSTALL_CMAKE_PROJECTS)
foreach(component ${INSTALL_BUNDLES})
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS @PROJECT_BINARY_DIR@;Apache
Celix;${component};/)
endforeach(component)
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS @PROJECT_BINARY_DIR@;Apache
Celix;framework;/)

CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/cmake/templates/CPackConfig-Installation.in
CPackConfig-Installation.cmake @ONLY)






 Hope that gives you some ideas to start from,


Yes it dit, it also gave me the idea that my solution is in the right
direction and that CMake/CPack doesn't support groups in its configuration.
Thanks!



 regards Mark




-- 
Met vriendelijke groet,

Alexander Broekhuis
--

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

Re: [CMake] ExternalData on unmounted Windows shares?

2013-11-13 Thread Magnus Therning
On Tue, Nov 12, 2013 at 5:09 PM, Brad King brad.k...@kitware.com wrote:
 On 11/12/2013 08:43 AM, Magnus Therning wrote:
 Is there some way to point to an unmounted Windows share?

 Add to ExternalData_URL_TEMPLATES the entry

  file:share.host/foo/bar/%(algo)/%(hash)

That still fails on the real path I have to use in the project.  Are
there any known issues with  hidden shares (name ending in $), or with
paths containing spaces?

The path that fails contains both :(

 Since it is accessible through filesystem APIs you could also
 set ExternalData_OBJECT_STORES to

  c:/some/local/store;//share.host/foo/bar

 That tells ExternalData to use objects found in the local store
 or the network path directly without downloading.  If an object
 is not found in either path, then the url templates will be
 searched for the object and it will be downloaded to the local
 store (first entry in ExternalData_OBJECT_STORES).

That's what I was testing and wrote about in another response on this thread:

- It's not possible to set only ExternalData_OBJECT_STORES, one has to
set ExternalData_URL_TEMPLATES too.
- I'd like to not have to map the drive (other users of the project
would then have to free up a specific drive letter) and
ExternalData_OBJECT_STORES don't seem to handle paths of the form
//share.host/foo/bar.

/M

-- 
Magnus Therning  OpenPGP: 0xAB4DFBA4
email: mag...@therning.org   jabber: mag...@therning.org
twitter: magthe   http://therning.org/magnus
--

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] Git Doesn't to Pull with ExternalProject_Add

2013-11-13 Thread Constantine Zakkaroff

Hello ALL,

I have a SuperBuild project (using CMake 2.8.12 on Windows Vista x64) 
depending on some other project cloned from a git repository. However 
I've noticed the cloner repository doesn't get updated when I rebuild 
the project.


Is it right to expect the repository to be updated automatically? Or 
does it need to be done manually?


Here's how the call to ExternalProject_Add looks in my project:

   ExternalProject_Add(${proj}
 GIT_REPOSITORY ${${proj}_REPOSITORY}
 GIT_TAG ${${proj}_GIT_TAG}
 SOURCE_DIR ${proj}
 BINARY_DIR ${proj}-build
 CMAKE_GENERATOR ${gen}
 CMAKE_ARGS
   -Wno-dev
   --no-warn-unused-cli
   ${COMMON_EXTERNAL_PROJECT_ARGS}
   ${${proj}_CMAKE_OPTIONS}
 INSTALL_COMMAND 
 DEPENDS ${${proj}_DEPENDENCIES}
   )

Many thanks,
Constantine
--

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


Re: [CMake] Git Doesn't to Pull with ExternalProject_Add

2013-11-13 Thread Daniele E. Domenichelli
Hello Constantine,

I'm investigating the same issue right in this moment...

On 13/11/13 10:19, Constantine Zakkaroff wrote:
 I have a SuperBuild project (using CMake 2.8.12 on Windows Vista x64) 
 depending on some other project cloned from a git repository. However 
 I've noticed the cloner repository doesn't get updated when I rebuild 
 the project.
 
 Is it right to expect the repository to be updated automatically? Or 
 does it need to be done manually?

How do you set ${proj}_GIT_TAG? If it a tag or a commit hash it should
work, therefore if you change it in your superbuild, your repository
should be updated.

Unfortunately it doesn't work for branches. Therefore if you set it to
master it will work for the clone, but it won't work for the updates,
because the branch master is your local branch not the remote one
(origin/master)

Perhaps this should be fixed somehow, either the documentation of the
module to explicitly state this, or the module itself to pull from the
remote branch if GIT_TAG is a branch.


Cheers,
 Daniele

--

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] Wiki update needed: CMake/Tutorials/How to create a ProjectConfig.cmake file

2013-11-13 Thread Johannes Zarl
Hi,

I noticed that the tutorial for creating ProjectConfig files[1] in the wiki is 
not really up to date anymore. To be precise, the CMakePackageConfigHelpers 
cmake module is not mentioned on the page.

The main author of the tutorial goes by the username Themiwi.

@Themiwi: if you are reading this: could drop me a quick note whether you have 
the time to update the wiki page or not?

Thanks,
  Johannes


[1] CMake/Tutorials/How to create a ProjectConfig.cmake file: 
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
--

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


Re: [CMake] Unicode path wrecks havoc with VS2013 generator

2013-11-13 Thread Nagy-Egri Máté Ferenc
I have tried to open the solution by the IDE itself, but that fails to load the 
solution also. It report the same error while trying to load the projects 
inside.


Shall I rebuild CMake with the mentioned patch to make it work, or can I hope 
of a patch that solves this problem?






Feladó: clin...@elemtech.com
Elküldve: ‎szombat‎, ‎2013‎. ‎november‎ ‎9‎. ‎7‎:‎14
Címzett: cmake@cmake.org







- Original Message -
 On 11/8/2013 4:48 AM, Nagy-Egri Máté Ferenc wrote:
  Hi!
 
  I have the following issue, which I do not know whether it is an issue
  of CMake or Visual Studio. When I try to generate a Visual Studio
  project under a path that contains unicode characters, VS fails to
  compile the simple test file and thus CMake terminates project
  generation. Visual Studio does have some issues with projects under
  unicode paths, but generally things work. (For eg. the C++AMP call tree
  generator breaks, therefore no C++AMP project can be built in such
  paths) I develop all my applications in my Skydrive folder which is
  under the Users folder, and since my name holds unicode characters, I
  have no control over mw home folder under Win 8 if I have a Live-ID user
  in the OS. This is what happens:
 Clearly you need to change your name.  :)
 
 Can you create a simple project from the IDE in that directory and get
 it to work?
 
 If you run CMake with --debug-trycompile, can you load the solution in
 the CMakeTmp directory from the IDE?
 

This problem can also be reproduced with English as the current language.
Just pick a character between 128 and 256 to include in the name of the build 
directory.
For example, buildñ, and run cmake in there pointing to any source tree.

For me, the Visual Studio 9 2008 generator works fine and the project file 
reports an encoding of Windows-1252.
It fails with the the Visual Studio 10 generator where the project file reports 
a utf-8 encoding, but it really isn't utf-8.
So I get errors like this:
 C:\...\cmake\buildñ\CMakeFiles\CMakeTmp\cmTryCompileExec926
91608.vcxproj(56,110):
 error MSB4025: The project file could not be loaded.  Invalid character in
 the given encoding.  Line 56, position 110.

Modifying cmVisualStudio10TargetGenerator.cxx to set the encoding of the visual 
studio file to Windows-1252 instead of utf-8 fixes the problem for me.

Clint
--

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

Re: [CMake] Unicode path wrecks havoc with VS2013 generator

2013-11-13 Thread clinton
- Original Message -

 I have tried to open the solution by the IDE itself, but that fails to load
 the solution also. It report the same error while trying to load the
 projects inside.

 Shall I rebuild CMake with the mentioned patch to make it work, or can I hope
 of a patch that solves this problem?

You can manually edit the visual studio project file to replace utf-8 with 
Windows-1252 (or whatever is appropriate for your language) and load the 
project in visual studio. 

If that works, can you please modify cmVisualStudio10TargetGenerator.cxx to 
change from utf-8 to Windows-1252 to see if you can build the rest of your 
project. 
Let us know so we can include a fix. 

Clint 

 Feladó: clin...@elemtech.com
 Elküldve: ‎szombat‎, ‎2013‎. ‎november‎ ‎9‎. ‎7‎:‎14
 Címzett: cmake@cmake.org

 - Original Message -
  On 11/8/2013 4:48 AM, Nagy-Egri Máté Ferenc wrote:
   Hi!
  
   I have the following issue, which I do not know whether it is an issue
   of CMake or Visual Studio. When I try to generate a Visual Studio
   project under a path that contains unicode characters, VS fails to
   compile the simple test file and thus CMake terminates project
   generation. Visual Studio does have some issues with projects under
   unicode paths, but generally things work. (For eg. the C++AMP call tree
   generator breaks, therefore no C++AMP project can be built in such
   paths) I develop all my applications in my Skydrive folder which is
   under the Users folder, and since my name holds unicode characters, I
   have no control over mw home folder under Win 8 if I have a Live-ID user
   in the OS. This is what happens:
  Clearly you need to change your name. :)
 
  Can you create a simple project from the IDE in that directory and get
  it to work?
 
  If you run CMake with --debug-trycompile, can you load the solution in
  the CMakeTmp directory from the IDE?
 

 This problem can also be reproduced with English as the current language.
 Just pick a character between 128 and 256 to include in the name of the build
 directory.
 For example, buildñ, and run cmake in there pointing to any source tree.

 For me, the Visual Studio 9 2008 generator works fine and the project file
 reports an encoding of Windows-1252.
 It fails with the the Visual Studio 10 generator where the project file
 reports a utf-8 encoding, but it really isn't utf-8.
 So I get errors like this:
 C:\...\cmake\buildñ\CMakeFiles\CMakeTmp\cmTryCompileExec926
 91608.vcxproj(56,110):
 error MSB4025: The project file could not be loaded. Invalid character in
 the given encoding. Line 56, position 110.

 Modifying cmVisualStudio10TargetGenerator.cxx to set the encoding of the
 visual studio file to Windows-1252 instead of utf-8 fixes the problem for
 me.

 Clint
 --

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

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] Modern CMake with Qt and Boost

2013-11-13 Thread Stephen Kelly

Hello,

Last week I gave a talk at a C++ conference in Germany about 'modern CMake', 
which is approximately 'CMake with usage requirements'.

I wrote a blog post with the slides and explanation here:

 http://www.kdab.com/modern-cmake-with-qt-and-boost/

Thanks,

Steve.


--

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


Re: [CMake] Unicode path wrecks havoc with VS2013 generator

2013-11-13 Thread Nagy-Egri Máté Ferenc
I have changed the encoding as you suggested and the project compiled fine:


1-- Build started: Project: cmTryCompileExec747919577, Configuration: 
Debug Win32 --
1  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
1  Copyright (C) Microsoft Corporation.  All rights reserved.
1  
1  cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D 
CMAKE_INTDIR=\Debug\ /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t 
/Zc:forScope /FocmTryCompileExec747919577.dir\Debug\\ 
/FdcmTryCompileExec747919577.dir\Debug\vc120.pdb /Gd /TC /analyze- 
/errorReport:prompt testCCompiler.c
1  
1  testCCompiler.c
1  cmTryCompileExec747919577.vcxproj - 
C:\Users\MátéFerenc\SkyDrive\Develop\Active\GridRipper\VS2013\CMakeFiles\CMakeTmp\Debug\cmTryCompileExec747919577.exe
== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==



If you could issue a patch (2.8.12.2 if I’m not mistaken) that would correct 
this bug, that would simply rock.


Cheers,

Máté


ps.: Anyone has an idea what causes this issue with UTF-8? As far as I saw from 
the sources, the project files are concatenated from instances of std:: string. 
Wouldn’t std:: wstring solve the problem? Or using the ICU library perhaps? 
(I’m fine as long as the patch fixes my problems, the question is just out of 
curiosity)




Feladó: clin...@elemtech.com
Elküldve: ‎szerda‎, ‎2013‎. ‎november‎ ‎13‎. ‎15‎:‎23
Címzett: cmake@cmake.org











I have tried to open the solution by the IDE itself, but that fails to load the 
solution also. It report the same error while trying to load the projects 
inside.




Shall I rebuild CMake with the mentioned patch to make it work, or can I hope 
of a patch that solves this problem?

You can manually edit the visual studio project file to replace utf-8 with 
Windows-1252 (or whatever is appropriate for your language) and load the 
project in visual studio.




If that works, can you please modify cmVisualStudio10TargetGenerator.cxx to 
change from utf-8 to Windows-1252 to see if you can build the rest of your 
project.

Let us know so we can include a fix.




Clint










Feladó: clin...@elemtech.com
Elküldve: ‎szombat‎, ‎2013‎. ‎november‎ ‎9‎. ‎7‎:‎14
Címzett: cmake@cmake.org









- Original Message -
 On 11/8/2013 4:48 AM, Nagy-Egri Máté Ferenc wrote:
  Hi!
 
  I have the following issue, which I do not know whether it is an issue
  of CMake or Visual Studio. When I try to generate a Visual Studio
  project under a path that contains unicode characters, VS fails to
  compile the simple test file and thus CMake terminates project
  generation. Visual Studio does have some issues with projects under
  unicode paths, but generally things work. (For eg. the C++AMP call tree
  generator breaks, therefore no C++AMP project can be built in such
  paths) I develop all my applications in my Skydrive folder which is
  under the Users folder, and since my name holds unicode characters, I
  have no control over mw home folder under Win 8 if I have a Live-ID user
  in the OS. This is what happens:
 Clearly you need to change your name.  :)
 
 Can you create a simple project from the IDE in that directory and get
 it to work?
 
 If you run CMake with --debug-trycompile, can you load the solution in
 the CMakeTmp directory from the IDE?
 



This problem can also be reproduced with English as the current language.
Just pick a character between 128 and 256 to include in the name of the build 
directory.
For example, buildñ, and run cmake in there pointing to any source tree.



For me, the Visual Studio 9 2008 generator works fine and the project file 
reports an encoding of Windows-1252.
It fails with the the Visual Studio 10 generator where the project file reports 
a utf-8 encoding, but it really isn't utf-8.
So I get errors like this:
 C:\...\cmake\buildñ\CMakeFiles\CMakeTmp\cmTryCompileExec926
91608.vcxproj(56,110):
 error MSB4025: The project file could not be loaded.  Invalid character in
 the given encoding.  Line 56, position 110.



Modifying cmVisualStudio10TargetGenerator.cxx to set the encoding of the visual 
studio file to Windows-1252 instead of utf-8 fixes the problem for me.



Clint
--



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 

Re: [CMake] ExternalData on unmounted Windows shares?

2013-11-13 Thread Brad King
On 11/13/2013 03:59 AM, Magnus Therning wrote:
 On Tue, Nov 12, 2013 at 5:09 PM, Brad King brad.k...@kitware.com wrote:
 Add to ExternalData_URL_TEMPLATES the entry

  file:share.host/foo/bar/%(algo)/%(hash)
 
 That still fails on the real path I have to use in the project.  Are
 there any known issues with  hidden shares (name ending in $), or with
 paths containing spaces?
 
 The path that fails contains both :(

I just tried network paths containing both spaces and a $ at the end
or in the middle.  It works just fine for me in either variable.

 - It's not possible to set only ExternalData_OBJECT_STORES, one has to
 set ExternalData_URL_TEMPLATES too.

Back when this module was part of another project and not ported to
CMake upstream we did not have ExternalData_OBJECT_STORES and always
used a store in the build tree.  That is why ExternalData_URL_TEMPLATES
is required to be set.  When the ExternalData_OBJECT_STORES capability
was created no one thought to lift the ExternalData_URL_TEMPLATES
requirement because the projects using the module all set it anyway.

It is easy enough to lift that restriction:

 ExternalData: Allow local stores without any URL templates
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8eb20eea

 - I'd like to not have to map the drive (other users of the project
 would then have to free up a specific drive letter) and
 ExternalData_OBJECT_STORES don't seem to handle paths of the form
 //share.host/foo/bar.

As I report above they work just fine for me.  Please provide
a sample CMakeLists.txt file and instructions for setting up a
network share that demonstrates the failure.  Include the error
messages you expect us to see when reproducing it.

What CMake build system generator (-G) are you using?

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


[CMake] Fixup Bundle Problem when using multiple executables

2013-11-13 Thread Fabian Saccilotto

Dear CMake Users,

we are using CMake as build system for an application which is made from 
several subapplications for ease of development (Windows 7 + Visual 
Studio 2010).


In order to make the setup of a project for the developer easier, we use 
the fixup_bundle macro from BundleUtilities via the INSTALL project.
It searches the libraries needed of an executable in given locations and 
copies them to the output folder.
If there are several executables to fixup in the same folder, errors 
occur while resolving the dependencies.


With CMake we are able to build a global meta-solution with all the 
subprojects in it, what allows the developer to have all the sources in 
one solution and run standalone subprojects and tests from there.
All Output is directed to the same location which is under the root 
application directory appended with the configuration name (Debug, 
Release etc).

(Note: The subprojects are also used in other applications)

Meta-Solution:
- LibraryA
- LibraryA_Standalone (Standalone and Library differ in symbols 
which are exported and target to build)

- LibraryA_Test
- LibraryB
- LibraryB_Standalone
- LibraryB_Test
- Full_Application (Depends on LibraryA and LibraryB)
- INSTALL (calls LibraryA's and LibraryB's install_cmake)

The information to fix up the executables resides in the subprojects 
which install the fixup script with the according executable and 
directories.


THE PROBLEM:
When building the install project for a subproject, the fixup_bundle 
macro searches for all other executables in the current directory and 
tries to fix them. Because not all paths are given with each subproject 
not all libraries can be resolved. see Line 420 of BundleUtilities.cmake


# But do fixups on all executables in the bundle:
#
get_bundle_all_executables(${bundle} exes)

I temporarily fixed this using only the given executable here and 
ignoring others.


I would be interested in the following things:
- why are other executables search for?
- is there a better way to do what I want?

Thank you for your replies

Kind regards

Fabian Saccilotto
--

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


Re: [CMake] Unicode path wrecks havoc with VS2013 generator

2013-11-13 Thread Clinton Stimpson
On Wednesday, November 13, 2013 03:12:13 PM Nagy-Egri Máté Ferenc wrote:
 I have changed the encoding as you suggested and the project compiled fine:
 
 
 1-- Build started: Project: cmTryCompileExec747919577, Configuration:
 Debug Win32 --
 1  Microsoft (R) C/C++ Optimizing Compiler Version
 18.00.21005.1 for x86 1  Copyright (C) Microsoft Corporation.  All rights
 reserved.
 1  
 1  cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
 CMAKE_INTDIR=\Debug\ /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
 /Zc:wchar_t /Zc:forScope /FocmTryCompileExec747919577.dir\Debug\\
 /FdcmTryCompileExec747919577.dir\Debug\vc120.pdb /Gd /TC /analyze-
 /errorReport:prompt testCCompiler.c
 1
 1  testCCompiler.c
 1  cmTryCompileExec747919577.vcxproj -
 C:\Users\MátéFerenc\SkyDrive\Develop\Active\GridRipper\VS2013\CMakeFiles\CM
 akeTmp\Debug\cmTryCompileExec747919577.exe
 == Build: 1 succeeded, 0
 failed, 0 up-to-date, 0 skipped == 
 
 
 If you could issue a patch (2.8.12.2 if I’m not mistaken) that would correct
 this bug, that would simply rock.

A 2.8.12.2 will only be created if there was a serious regression in 2.8.12 or 
2.8.12.1.

Your problem is not a regression.

 
 
 Cheers,
 
 Máté
 
 
 ps.: Anyone has an idea what causes this issue with UTF-8?

CMake wrote the project file with the Windows-1252 encoding, so it isn't really 
a utf-8 file.

 As far as I saw
 from the sources, the project files are concatenated from instances of
 std:: string. Wouldn’t std:: wstring solve the problem?

No.  Both std::string and std::wstring have no concept of a built in encoding.
One could choose to use std::string to store either utf-8 or Windows-1252 or 
any other encoding.
One could choose to use std::wstring to store UTF-16, UTF-32 or any other 
encoding.

Clint

 Or using the ICU
 library perhaps? (I’m fine as long as the patch fixes my problems, the
 question is just out of curiosity)
 
 
 
 
 Feladó: clin...@elemtech.com
 Elküldve: ‎szerda‎, ‎2013‎. ‎november‎ ‎13‎. ‎15‎:‎23
 Címzett: cmake@cmake.org
 
 
 
 
 
 
 
 
 
 
 
 I have tried to open the solution by the IDE itself, but that fails to load
 the solution also. It report the same error while trying to load the
 projects inside.
 
 
 
 
 Shall I rebuild CMake with the mentioned patch to make it work, or can I
 hope of a patch that solves this problem?
 
 You can manually edit the visual studio project file to replace utf-8 with
 Windows-1252 (or whatever is appropriate for your language) and load the
 project in visual studio.
 
 
 
 
 If that works, can you please modify cmVisualStudio10TargetGenerator.cxx to
 change from utf-8 to Windows-1252 to see if you can build the rest of
 your project.
 
 Let us know so we can include a fix.
 
 
 
 
 Clint
 
 
 
 
 
 
 
 
 
 
 Feladó: clin...@elemtech.com
 Elküldve: ‎szombat‎, ‎2013‎. ‎november‎ ‎9‎. ‎7‎:‎14
 Címzett: cmake@cmake.org
 
 
 
 
 
 
 
 
 
 - Original Message -
 
  On 11/8/2013 4:48 AM, Nagy-Egri Máté Ferenc wrote:
  
   Hi!
  
  
  
   I have the following issue, which I do not know whether it is an issue
   of CMake or Visual Studio. When I try to generate a Visual Studio
   project under a path that contains unicode characters, VS fails to
   compile the simple test file and thus CMake terminates project
   generation. Visual Studio does have some issues with projects under
   unicode paths, but generally things work. (For eg. the C++AMP call tree
   generator breaks, therefore no C++AMP project can be built in such
   paths) I develop all my applications in my Skydrive folder which is
   under the Users folder, and since my name holds unicode characters, I
   have no control over mw home folder under Win 8 if I have a Live-ID
   user
   in the OS. This is what happens:
  
  Clearly you need to change your name.  :)
  
  Can you create a simple project from the IDE in that directory and get
  it to work?
  
  If you run CMake with --debug-trycompile, can you load the solution in
  the CMakeTmp directory from the IDE?
  
 
 
 
 
 This problem can also be reproduced with English as the current language.
 Just pick a character between 128 and 256 to include in the name of the
 build directory.
 For example, buildñ, and run cmake in there pointing to
 any source tree. 
 
 
 For me, the Visual Studio 9 2008 generator works fine and the project file
 reports an encoding of Windows-1252.
 It fails with the the Visual Studio
 10 generator where the project file reports a utf-8 encoding, but it really
 isn't utf-8. So I get errors like this:
  C:\...\cmake\buildñ\CMakeFiles\CMakeTmp\cmTryCompileExec926
 91608.vcxproj(56,110):
  error MSB4025: The project file could not be loaded.  Invalid character in
 the given encoding.  Line 56, position 110.
 
 
 
 Modifying cmVisualStudio10TargetGenerator.cxx to set the encoding of the
 visual studio file to Windows-1252 instead of utf-8 fixes the problem for
 me.
 
 
 
 Clint
 --
 
 
 
 Powered by www.kitware.com
 
 
 
 Please keep messages 

Re: [CMake] Unicode path wrecks havoc with VS2013 generator

2013-11-13 Thread Clinton Stimpson
On Wednesday, November 13, 2013 03:12:13 PM Nagy-Egri Máté Ferenc wrote:
 I have changed the encoding as you suggested and the project compiled fine:
 
 
 1-- Build started: Project: cmTryCompileExec747919577, Configuration:
 Debug Win32 --
 1  Microsoft (R) C/C++ Optimizing Compiler Version
 18.00.21005.1 for x86 1  Copyright (C) Microsoft Corporation.  All rights
 reserved.
 1  
 1  cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D
 CMAKE_INTDIR=\Debug\ /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise
 /Zc:wchar_t /Zc:forScope /FocmTryCompileExec747919577.dir\Debug\\
 /FdcmTryCompileExec747919577.dir\Debug\vc120.pdb /Gd /TC /analyze-
 /errorReport:prompt testCCompiler.c
 1
 1  testCCompiler.c
 1  cmTryCompileExec747919577.vcxproj -
 C:\Users\MátéFerenc\SkyDrive\Develop\Active\GridRipper\VS2013\CMakeFiles\CM
 akeTmp\Debug\cmTryCompileExec747919577.exe
 == Build: 1 succeeded, 0
 failed, 0 up-to-date, 0 skipped == 
 
 
 If you could issue a patch (2.8.12.2 if I’m not mistaken) that would correct
 this bug, that would simply rock.

Here is the fix for a future release.
http://cmake.org/gitweb?p=cmake.git;a=commit;h=efe3a5dd

Clint
--

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] Specifying whether a library is C or C++

2013-11-13 Thread Aggelos Kolaitis
Hey CMake list,

I have kind of a problem with CMake (but I guess it's the strange way
I'm using it :p).

I use CMake to have a simple and consistent build system for my
cross-platform library. My library is written in C, but it also has an
optional wrapper C++ interface.

During the generation of makefiles, the user can choose whether or not
to build the C++ interface, and so I choose the appropriate language
for my library. The thing is, CMake will always fail if there is no
g++, even if the user disables the C++ interface. The code in
CMakeLists.txt looks like this(see the full file in context at [1])

[code]

# I don't add 'C' as the language, because I get build errors with g++
project(PROJECT_NAME)

# Option to build c++ interface
option(BUILD_CXX Build the C++ interface ON)

# Default c files
set(SOURCES list_of_c_sources.c)

# Add c++ interface if needed
if (BUILD_CXX)
set(CXX_SOURCES list_of_cxx_sources.cxx)
set_source_files_properties( CXX_SOURCES PROPERTIES LANGUAGE CXX )
set(SOURCES ${SOURCES} ${CXX_SOURCES})
endif(BUILD_CXX)

[/code]

When I try to generate makefiles with: `cmake -DBUILD_CXX=OFF .`,
the generation fails if it can't find a c++ compiler, even though it
isn't needed

I hope the *problem* is clear here, but I'm willing to provide more
information if needed. Thanks in advance.

-- Aggelos Kolaitis

[1]: 
https://bitbucket.org/sdlu/sdlu/src/79338d0f19b24c5997b87b5c318faf76627be50a/CMakeLists.txt?at=master
--

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


Re: [CMake] Specifying whether a library is C or C++

2013-11-13 Thread Nils Gladitz

On 13.11.2013 18:15, Aggelos Kolaitis wrote:

# I don't add 'C' as the language, because I get build errors with g++
project(PROJECT_NAME)


Maybe
project(PROJECT_NAME C)
and a conditional
enable_language(CXX)
would work?

Nils
--

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] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hello,

I've been using several install (CODE EXECUTE_PROCESS ...) constructs in my 
top-level CMakeLists.txt file. However, I've been unable to capture/operate on 
any exit status of the embedded command. Unfortunately, documentation/searches 
haven't turned up any useful pointers. The closest I've come is a pointer in 
the following thread:
http://www.cmake.org/pipermail/cmake/2011-July/045475.html 
However, I've not been able to sufficiently read between the lines to get this 
working.

Does anyone have any thoughts on how to get something like the following 
working:

   install (CODE EXECUTE_PROCESS (
  COMMAND ant ...
  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
  ERROR_VARIABLE _err
   )
   If (${_err})
  MESSAGE( FATAL_ERROR \err: ${_err}\)
   endif ())

Thanks!
-David


--

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


Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Kornel Benko
Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck 
dav...@netacquire.com
 Hello,
 
 I've been using several install (CODE EXECUTE_PROCESS ...) constructs in 
 my top-level CMakeLists.txt file. However, I've been unable to 
 capture/operate on any exit status of the embedded command. Unfortunately, 
 documentation/searches haven't turned up any useful pointers. The closest 
 I've come is a pointer in the following thread:
 http://www.cmake.org/pipermail/cmake/2011-July/045475.html 
 However, I've not been able to sufficiently read between the lines to get 
 this working.
 
 Does anyone have any thoughts on how to get something like the following 
 working:
 
install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   ERROR_VARIABLE _err

Didn't you mean 'RESULT_VARIABLE' here?

)
If (${_err})
   MESSAGE( FATAL_ERROR \err: ${_err}\)
endif ())
 
 Thanks!
 -David
 
Kornel


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

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

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Kornel,
 
On Wednesday, November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote:
 Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck 
 dav...@netacquire.com
 Hello,
 
 I've been using several install (CODE EXECUTE_PROCESS ...)
 constructs
 in my top-level CMakeLists.txt file. However, I've been unable to 
 capture/operate on any exit status of the embedded command.
 Unfortunately, documentation/searches haven't turned up any useful 
 pointers. The closest I've come is a pointer in the following thread:
 http://www.cmake.org/pipermail/cmake/2011-July/045475.html However, 
 I've not been able to sufficiently read between the lines to get this 
 working.
 
 Does anyone have any thoughts on how to get something like the 
 following working:
 
install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   ERROR_VARIABLE _err
 
 Didn't you mean 'RESULT_VARIABLE' here?

No, I really do mean ERROR_VARIABLE (unless, of course, this variable does not 
include the non-zero exit status of the EXECUTE_PROCESS command?).

BTW, I'm still curious about the (dual 'code') construct generally. 
Specifically, if I do the following I never see the fatal error message (so I'm 
wondering if there's still something wrong regarding the scoping of the message 
command)?
 
   install (CODE EXECUTE_PROCESS (
  COMMAND ant ...
  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
  ERROR_VARIABLE _err
   )
   MESSAGE( FATAL_ERROR \err: ${_err}\)

BTW, the following doesn't work either (each of the variables is empty):

   install (CODE EXECUTE_PROCESS (
  COMMAND ant ...
  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  RESULT_VARIABLE _res
   )
   Install (CODE MESSAGE( STATUS \out: ${_out}, err: ${_err}, res: 
${_res}...\))

-David

)
If (${_err})
   MESSAGE( FATAL_ERROR \err: ${_err}\)
endif ())
 Thanks!
 -David
 
   Kornel
--

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


Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Jean-Christophe Fillion-Robin
Hi David,


You could look at the generated file named cmake_install.cmake to have a
better idea of what could be wrong ...

As a side note, there is also an issue with command like
install(CODE|SCRIPT ... there are always executed first in a given
directory. See [1] (Note that I couldn't find a issue in the tracker
referencing that problem ... will create one if no body find it)

Hth
Jc

[1]
https://github.com/Slicer/Slicer/blob/95f48d89d0806cd30b0cf58b20b7790163cec1c8/CMake/SlicerCPack.cmake#L81-86


On Wed, Nov 13, 2013 at 1:41 PM, David Hauck dav...@netacquire.com wrote:

 Hi Kornel,

 On Wednesday, November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote:
  Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck
  dav...@netacquire.com
  Hello,
 
  I've been using several install (CODE EXECUTE_PROCESS ...)
  constructs
  in my top-level CMakeLists.txt file. However, I've been unable to
  capture/operate on any exit status of the embedded command.
  Unfortunately, documentation/searches haven't turned up any useful
  pointers. The closest I've come is a pointer in the following thread:
  http://www.cmake.org/pipermail/cmake/2011-July/045475.html However,
  I've not been able to sufficiently read between the lines to get this
  working.
 
  Does anyone have any thoughts on how to get something like the
  following working:
 
 install (CODE EXECUTE_PROCESS (
COMMAND ant ...
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
ERROR_VARIABLE _err
 
  Didn't you mean 'RESULT_VARIABLE' here?

 No, I really do mean ERROR_VARIABLE (unless, of course, this variable does
 not include the non-zero exit status of the EXECUTE_PROCESS command?).

 BTW, I'm still curious about the (dual 'code') construct generally.
 Specifically, if I do the following I never see the fatal error message (so
 I'm wondering if there's still something wrong regarding the scoping of the
 message command)?

install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   ERROR_VARIABLE _err
)
MESSAGE( FATAL_ERROR \err: ${_err}\)

 BTW, the following doesn't work either (each of the variables is empty):

install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   OUTPUT_VARIABLE _out
   ERROR_VARIABLE _err
   RESULT_VARIABLE _res
)
Install (CODE MESSAGE( STATUS \out: ${_out}, err: ${_err}, res:
 ${_res}...\))

 -David

 )
 If (${_err})
MESSAGE( FATAL_ERROR \err: ${_err}\)
 endif ())
  Thanks!
  -David
 
Kornel
 --

 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




-- 
+1 919 869 8849
--

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

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Kornel Benko
Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David Hauck 
dav...@netacquire.com
 Hi Kornel,
  
 On Wednesday, November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote:
  Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck 
  dav...@netacquire.com
  Hello,
  
  I've been using several install (CODE EXECUTE_PROCESS ...)
  constructs
  in my top-level CMakeLists.txt file. However, I've been unable to 
  capture/operate on any exit status of the embedded command.
  Unfortunately, documentation/searches haven't turned up any useful 
  pointers. The closest I've come is a pointer in the following thread:
  http://www.cmake.org/pipermail/cmake/2011-July/045475.html However, 
  I've not been able to sufficiently read between the lines to get this 
  working.
  
  Does anyone have any thoughts on how to get something like the 
  following working:
  
 install (CODE EXECUTE_PROCESS (
COMMAND ant ...
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
ERROR_VARIABLE _err
  
  Didn't you mean 'RESULT_VARIABLE' here?
 
 No, I really do mean ERROR_VARIABLE (unless, of course, this variable does 
 not include the non-zero exit status of the EXECUTE_PROCESS command?).

If you run 'cmake --help-command execute_process', you see:
...
If RESULT_VARIABLE is given the variable will be set to contain the
result of running the processes.  This will be an integer return code
from the last child or a string describing an error condition.
...
So, if this is not 0, then you have an error condition.

 BTW, I'm still curious about the (dual 'code') construct generally.
 Specifically, if I do the following I never see the fatal error message
 (so I'm wondering if there's still something wrong regarding the scoping of 
 the message command)?
  
install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   ERROR_VARIABLE _err
)
MESSAGE( FATAL_ERROR \err: ${_err}\)

Never did this. When do you want to see the message?
As I understand your code, only in call of cmake, e.g. at configuration time.

Kornel

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

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

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Jean-christophe,
 
On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote:
 Hi David,
 
 You could look at the generated file named cmake_install.cmake to
 have a better idea of what could be wrong ...

Well, this just has the following:

IF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL 
Unspecified)
  EXECUTE_PROCESS (
  COMMAND ant ...
  WORKING_DIRECTORY /home/david/src/java
  #OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  #RESULT_VARIABLE _res
   )
   MESSAGE( FATAL_ERROR err: )
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL 
Unspecified)

IF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL 
Unspecified)
  MESSAGE(out: , err: , res: ...)
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL 
Unspecified)

So it looks like the variable(s) is(are) being expanded (in the first case) 
prior to running the 'ant' command. Any ideas why this might be?

Thanks,
-David

PS: I'm surprised that this isn't something that many, many CMake authors 
need/require (i.e., the ability to terminate or otherwise operate on the 
results of an install code... sequence). Especially given the availability of 
the error, output, and result variable arguments to the execute_process 
command. What is the proper syntax/pattern for this?

 As a side note, there is also an issue with command like
 install(CODE|SCRIPT ... there are always executed first in a given
 directory. See [1] (Note that I couldn't find a issue in the tracker
 referencing that problem ... will create one if no body find it)
 
 
 Hth
 Jc
 
 [1]
 https://github.com/Slicer/Slicer/blob/95f48d89d0806cd30b0cf58b20b77901
 63 cec1c8/CMake/SlicerCPack.cmake#L81-86
 
 On Wed, Nov 13, 2013 at 1:41 PM, David Hauck dav...@netacquire.com
 wrote:
   Hi Kornel,
 
   On Wednesday, November 13, 2013 10:26 AM, cmake- boun...@cmake.org
 wrote: Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David
 Hauck  dav...@netacquire.comHello,  I've 
 been using
 several install (CODE EXECUTE_PROCESS ...) constructsin my
 top-level CMakeLists.txt file. However, I've been unable to   
 capture/operate on any exit status of the embedded command.   
 Unfortunately, documentation/searches haven't turned up any useful
 pointers. The closest I've come is a pointer in the following thread:
http://www.cmake.org/pipermail/cmake/2011-July/045475.html However,
I've not been able to sufficiently read between the lines to get
 this   working.Does anyone have any thoughts on how to get
 something like the following working: install (CODE
 EXECUTE_PROCESS (   COMMAND ant ...   
 WORKING_DIRECTORY
 ${PROJECT_SOURCE_DIR}/java   ERROR_VARIABLE _errDidn't
 you mean 'RESULT_VARIABLE' here?
 
   No, I really do mean ERROR_VARIABLE (unless, of course, this variable
 does not include the non-zero exit status of the EXECUTE_PROCESS
 command?).
 
   BTW, I'm still curious about the (dual 'code') construct generally.
 Specifically, if I do the following I never see the fatal error
 message (so I'm wondering if there's still something wrong regarding
 the scoping of the message command)?
 
  install (CODE EXECUTE_PROCESS (
 COMMAND ant ...
 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
 ERROR_VARIABLE _err
 
  )
  MESSAGE( FATAL_ERROR \err: ${_err}\)
 
   BTW, the following doesn't work either (each of the variables is empty):
 
  install (CODE EXECUTE_PROCESS (
 COMMAND ant ...
 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
 
 OUTPUT_VARIABLE _out
 ERROR_VARIABLE _err
 RESULT_VARIABLE _res
  )
  Install (CODE MESSAGE( STATUS \out: ${_out}, err: ${_err},
 res: ${_res}...\))
 
   -David
 
   )
   If (${_err})
  MESSAGE( FATAL_ERROR \err: ${_err}\)
   endif ())
Thanks!
-David
   
  Kornel
--

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


Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Kornel,

On Wednesday, November 13, 2013 11:08 AM, cmake-boun...@cmake.org wrote:
 Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David Hauck 
 dav...@netacquire.com
 Hi Kornel,
 
 On Wednesday, November 13, 2013 10:26 AM, cmake-
 boun...@cmake.org wrote:
 Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck 
 dav...@netacquire.com
 Hello,
 
 I've been using several install (CODE EXECUTE_PROCESS ...)
 constructs
 in my top-level CMakeLists.txt file. However, I've been unable to 
 capture/operate on any exit status of the embedded command.
 Unfortunately, documentation/searches haven't turned up any useful 
 pointers. The closest I've come is a pointer in the following thread:
 http://www.cmake.org/pipermail/cmake/2011-July/045475.html However, 
 I've not been able to sufficiently read between the lines to get 
 this working.
 
 Does anyone have any thoughts on how to get something like the 
 following working:
 
install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   ERROR_VARIABLE _err
 
 Didn't you mean 'RESULT_VARIABLE' here?
 
 No, I really do mean ERROR_VARIABLE (unless, of course, this variable 
 does
 not include the non-zero exit status of the EXECUTE_PROCESS command?).
 
 If you run 'cmake --help-command execute_process', you see: ... If 
 RESULT_VARIABLE is given the variable will be set to contain the 
 result of running the processes.  This will be an integer return code 
 from the last child or a string describing an error condition. ... So, 
 if this is not 0, then you have an error condition.

Yes, I see this. I also assumed that the ERROR_VARIABLE would be returning 
non-zero text as well in this case. I will change to using RESULT_VARIABLE, 
but, in both cases, it seems that I'm referencing the variable incorrectly 
(either syntactically or in the incorrect context) since this/these is/are 
always empty.
 
 BTW, I'm still curious about the (dual 'code') construct generally.
 Specifically, if I do the following I never see the fatal error 
 message (so I'm wondering if there's still something wrong regarding 
 the scoping of the message command)?
 
install (CODE EXECUTE_PROCESS (
   COMMAND ant ...
   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
   ERROR_VARIABLE _err
)
MESSAGE( FATAL_ERROR \err: ${_err}\)
 
 Never did this. When do you want to see the message?

Ideally, I want to be able to test for the result of this variable (either 
ERROR_VARIABLE or RESULT_VARIABLE) after the execute_process command completes 
(during 'make install') to determine its result and to terminate (with error 
message) when the command fails.

Thanks,
-David

 As I understand your code, only in call of cmake, e.g. at configuration time.
 
   Kornel
--

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


Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Jean-Christophe Fillion-Robin
Hi David,

You need to escape the $ sign otherwise the _err, _out and _res
variables are resolved to an empty string.

Here is an example of what you could do:

-8---8--
cmake_minimum_required(VERSION 2.8.9)

install(CODE execute_process (
  COMMAND ${CMAKE_COMMAND} -E echo \Hello\
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  RESULT_VARIABLE _res
  )
   )
install(CODE message( STATUS \out: \${_out}, err: \${_err}, res:
\${_res}...\))
-8---8--

Hth
Jc


On Wed, Nov 13, 2013 at 2:29 PM, David Hauck dav...@netacquire.com wrote:

 Hi Kornel,

 On Wednesday, November 13, 2013 11:08 AM, cmake-boun...@cmake.org wrote:
  Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David Hauck
  dav...@netacquire.com
  Hi Kornel,
 
  On Wednesday, November 13, 2013 10:26 AM, cmake-
  boun...@cmake.org wrote:
  Am Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck
  dav...@netacquire.com
  Hello,
 
  I've been using several install (CODE EXECUTE_PROCESS ...)
  constructs
  in my top-level CMakeLists.txt file. However, I've been unable to
  capture/operate on any exit status of the embedded command.
  Unfortunately, documentation/searches haven't turned up any useful
  pointers. The closest I've come is a pointer in the following thread:
  http://www.cmake.org/pipermail/cmake/2011-July/045475.html However,
  I've not been able to sufficiently read between the lines to get
  this working.
 
  Does anyone have any thoughts on how to get something like the
  following working:
 
 install (CODE EXECUTE_PROCESS (
COMMAND ant ...
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
ERROR_VARIABLE _err
 
  Didn't you mean 'RESULT_VARIABLE' here?
 
  No, I really do mean ERROR_VARIABLE (unless, of course, this variable
  does
  not include the non-zero exit status of the EXECUTE_PROCESS command?).
 
  If you run 'cmake --help-command execute_process', you see: ... If
  RESULT_VARIABLE is given the variable will be set to contain the
  result of running the processes.  This will be an integer return code
  from the last child or a string describing an error condition. ... So,
  if this is not 0, then you have an error condition.

 Yes, I see this. I also assumed that the ERROR_VARIABLE would be returning
 non-zero text as well in this case. I will change to using RESULT_VARIABLE,
 but, in both cases, it seems that I'm referencing the variable incorrectly
 (either syntactically or in the incorrect context) since this/these is/are
 always empty.

  BTW, I'm still curious about the (dual 'code') construct generally.
  Specifically, if I do the following I never see the fatal error
  message (so I'm wondering if there's still something wrong regarding
  the scoping of the message command)?
 
 install (CODE EXECUTE_PROCESS (
COMMAND ant ...
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
ERROR_VARIABLE _err
 )
 MESSAGE( FATAL_ERROR \err: ${_err}\)
 
  Never did this. When do you want to see the message?

 Ideally, I want to be able to test for the result of this variable (either
 ERROR_VARIABLE or RESULT_VARIABLE) after the execute_process command
 completes (during 'make install') to determine its result and to terminate
 (with error message) when the command fails.

 Thanks,
 -David

  As I understand your code, only in call of cmake, e.g. at configuration
 time.
 
Kornel
 --

 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




-- 
+1 919 869 8849
--

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

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Jean-christophe,
 
On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote:
 Hi David,
 
 You need to escape the $ sign otherwise the _err, _out and _res
 variables are resolved to an empty string.
 
 Here is an example of what you could do:
 -8---8--
 cmake_minimum_required(VERSION 2.8.9)
 
 install(CODE execute_process (
   COMMAND ${CMAKE_COMMAND} -E echo \Hello\
   OUTPUT_VARIABLE _out
   ERROR_VARIABLE _err
   RESULT_VARIABLE _res
   )
)
 install(CODE message( STATUS \out: \${_out}, err: \${_err}, res:
 \${_res}...\)) -8---8--

Aha! This was probably obvious to you and Kornel, but it escaped me ;). 
Brilliant, this is working fine now.

Thanks to both of you for your help,
-David
 
 Hth
 Jc
 
 On Wed, Nov 13, 2013 at 2:29 PM, David Hauck dav...@netacquire.com
 wrote:
   Hi Kornel,
 
   On Wednesday, November 13, 2013 11:08 AM, cmake- boun...@cmake.org
 wrote: Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David
 Hauck  dav...@netacquire.comHi Kornel,  On 
 Wednesday,
 November 13, 2013 10:26 AM, cmake- boun...@cmake.org wrote:   Am
 Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck  
 dav...@netacquire.comHello,  I've been using 
 several
 install (CODE EXECUTE_PROCESS ...) constructs  in 
 my
 top-level CMakeLists.txt file. However, I've been unable to   
 capture/operate on any exit status of the embedded command.   
 Unfortunately, documentation/searches haven't turned up any useful
 pointers. The closest I've come is a pointer in the following thread:
http://www.cmake.org/pipermail/cmake/2011- July/045475.html
 However,   I've not been able to sufficiently read between the lines
 to get this working.   Does anyone have any 
 thoughts on
 how to get something like the  following working: 

 install (CODE EXECUTE_PROCESS ( COMMAND ant ...  
   
 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java ERROR_VARIABLE
 _errDidn't you mean 'RESULT_VARIABLE' here?No, I
 really do mean ERROR_VARIABLE (unless, of course, this variabledoes
not include the non-zero exit status of the EXECUTE_PROCESS
 command?).If you run 'cmake --help-command execute_process', you
 see: ... IfRESULT_VARIABLE is given the variable will be set to
 contain theresult of running the processes.  This will be an integer
 return codefrom the last child or a string describing an error
 condition. ... So, if this is not 0, then you have an error
 condition.
 
   Yes, I see this. I also assumed that the ERROR_VARIABLE would be
 returning non-zero text as well in this case. I will change to using
 RESULT_VARIABLE, but, in both cases, it seems that I'm referencing the
 variable incorrectly (either syntactically or in the incorrect
 context) since this/these is/are always empty.
 
BTW, I'm still curious about the (dual 'code') construct generally.
Specifically, if I do the following I never see the fatal error  
 
 message (so I'm wondering if there's still something wrong regarding  
 the scoping of the message command)?install (CODE
 EXECUTE_PROCESS (   COMMAND ant ...   
 WORKING_DIRECTORY
 ${PROJECT_SOURCE_DIR}/java   ERROR_VARIABLE _err) 

 MESSAGE( FATAL_ERROR \err: ${_err}\)Never did this. When 
 do you
 want to see the message?
 
   Ideally, I want to be able to test for the result of this variable
 (either ERROR_VARIABLE or RESULT_VARIABLE) after the execute_process
 command completes (during 'make install') to determine its result and
 to terminate (with error message) when the command fails.
 
   Thanks,
   -David
 
As I understand your code, only in call of cmake, e.g. at
 configuration time.
   
  Kornel
--

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


Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
On Wednesday, November 13, 2013 11:42 AM, David Hauck wrote:
 Hi Jean-christophe,
 
 On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote:
 Hi David,
 
 You need to escape the $ sign otherwise the _err, _out and _res
 variables are resolved to an empty string.
 
 Here is an example of what you could do:
 -8---8--
 cmake_minimum_required(VERSION 2.8.9)
 
 install(CODE execute_process (
   COMMAND ${CMAKE_COMMAND} -E echo \Hello\
   OUTPUT_VARIABLE _out
   ERROR_VARIABLE _err
   RESULT_VARIABLE _res
   )
)
 install(CODE message( STATUS \out: \${_out}, err: \${_err}, res:
 \${_res}...\)) -8---8--
 
 Aha! This was probably obvious to you and Kornel, but it escaped me ;).
 Brilliant, this is working fine now.

One last item here: I'm now able to see the resulting variable values in the 
message command output, but I'd now like to enclose this in an 'if' command. 
Something like:

install(CODE execute_process (
  COMMAND ${CMAKE_COMMAND} -E echo \Hello\
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  RESULT_VARIABLE _res
  )
   )
If (NOT \${_res} EQUAL 0) # escaping here has not effect one way or the 
other...
   install(CODE message( FATAL_ERROR \out: \${_out}, err: \${_err}, res: 
\${_res}\))
endif ()
 
However, the resulting cmake_install.cmake has the following (meaning the fatal 
error message will always be executed regardless of the value of '_res):

IF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL 
Unspecified)
  MESSAGE( FATAL_ERROR out: ${_out}, err: ${_err}, res: ${_res}...)
ENDIF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL 
Unspecified)

Is there a way to do this?

-David

 Thanks to both of you for your help,
 -David
 
 Hth
 Jc
 
 On Wed, Nov 13, 2013 at 2:29 PM, David Hauck dav...@netacquire.com
 wrote:
  Hi Kornel,
 
  On Wednesday, November 13, 2013 11:08 AM, cmake- boun...@cmake.org
 wrote:Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David
 Hauck dav...@netacquire.comHi Kornel,  On 
 Wednesday,
 November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote:   Am
 Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck 
 dav...@netacquire.com   Hello,  I've been using
 several install (CODE EXECUTE_PROCESS ...)constructs 
  in
 my top-level CMakeLists.txt file. However, I've been unable to   
 capture/operate on any exit status of the embedded command.  
 Unfortunately, documentation/searches haven't turned up any useful   
 pointers. The closest I've come is a pointer in the following thread:
   http://www.cmake.org/pipermail/cmake/2011- July/045475.html
 However,  I've not been able to sufficiently read between the
 lines to get  this working.   Does anyone have 
 any
 thoughts on how to get something like the following working:
   install (CODE EXECUTE_PROCESS (  COMMAND ant
 ...   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java   
 ERROR_VARIABLE _errDidn't you mean 'RESULT_VARIABLE' here?
 No, I really do mean ERROR_VARIABLE (unless, of course, this
 variable  does  not include the non-zero exit status of the
 EXECUTE_PROCESS command?).   If you run 'cmake --help-command
 execute_process', you see: ... If RESULT_VARIABLE is given the
 variable will be set to contain the   result of running the processes.
  This will be an integer return code  from the last child or a 
 string
 describing an error condition. ... So,if this is not 0, then you
 have an error condition.
 
  Yes, I see this. I also assumed that the ERROR_VARIABLE would be
 returning non-zero text as well in this case. I will change to using
 RESULT_VARIABLE, but, in both cases, it seems that I'm referencing
 the variable incorrectly (either syntactically or in the incorrect
 context) since this/these is/are always empty.
 
   BTW, I'm still curious about the (dual 'code') construct generally.
   Specifically, if I do the following I never see the fatal error  
 
 message (so I'm wondering if there's still something wrong regarding
   the scoping of the message command)?   install 
 (CODE
 EXECUTE_PROCESS (  COMMAND ant ... WORKING_DIRECTORY
 ${PROJECT_SOURCE_DIR}/java  ERROR_VARIABLE _err) 
 
 MESSAGE( FATAL_ERROR \err: ${_err}\)   Never did this. When 
 do
 you want to see the message?
 
  Ideally, I want to be able to test for the result of this variable
 (either ERROR_VARIABLE or RESULT_VARIABLE) after the execute_process
 command completes (during 'make install') to determine its result
 and to terminate (with error message) when the command fails.
 
  Thanks,
  -David
 
   As I understand your code, only in call of cmake, e.g. at
 configuration time.
  
 

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread Jean-Christophe Fillion-Robin
Hi,

You also need to add the if statement into the CODE parameter, for
example something like this ...

install(CODE If (NOT \${_res} EQUAL 0)
  message( FATAL_ERROR \out: \${_out}, err: \${_err}, res: \${_res}\)
  endif()
)

To keep things simpler, you could also look at INSTALL(SCRIPT ...) it
would allow you to avoid escaping. You would just need to configure the
script using configure_file.

Hth
Jc


On Wed, Nov 13, 2013 at 2:57 PM, David Hauck dav...@netacquire.com wrote:

 On Wednesday, November 13, 2013 11:42 AM, David Hauck wrote:
  Hi Jean-christophe,
 
  On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote:
  Hi David,
 
  You need to escape the $ sign otherwise the _err, _out and _res
  variables are resolved to an empty string.
 
  Here is an example of what you could do:
  -8---8--
  cmake_minimum_required(VERSION 2.8.9)
 
  install(CODE execute_process (
COMMAND ${CMAKE_COMMAND} -E echo \Hello\
OUTPUT_VARIABLE _out
ERROR_VARIABLE _err
RESULT_VARIABLE _res
)
 )
  install(CODE message( STATUS \out: \${_out}, err: \${_err}, res:
  \${_res}...\)) -8---8--
 
  Aha! This was probably obvious to you and Kornel, but it escaped me ;).
  Brilliant, this is working fine now.

 One last item here: I'm now able to see the resulting variable values in
 the message command output, but I'd now like to enclose this in an 'if'
 command. Something like:

 install(CODE execute_process (
   COMMAND ${CMAKE_COMMAND} -E echo \Hello\
   OUTPUT_VARIABLE _out
   ERROR_VARIABLE _err
   RESULT_VARIABLE _res
   )
)
 If (NOT \${_res} EQUAL 0) # escaping here has not effect one way or the
 other...
install(CODE message( FATAL_ERROR \out: \${_out}, err: \${_err}, res:
 \${_res}\))
 endif ()

 However, the resulting cmake_install.cmake has the following (meaning the
 fatal error message will always be executed regardless of the value of
 '_res):

 IF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL
 Unspecified)
   MESSAGE( FATAL_ERROR out: ${_out}, err: ${_err}, res: ${_res}...)
 ENDIF(NOT CMAKE_INSTALL_COMPONENT OR ${CMAKE_INSTALL_COMPONENT} STREQUAL
 Unspecified)

 Is there a way to do this?

 -David

  Thanks to both of you for your help,
  -David
 
  Hth
  Jc
 
  On Wed, Nov 13, 2013 at 2:29 PM, David Hauck dav...@netacquire.com
  wrote:
   Hi Kornel,
 
   On Wednesday, November 13, 2013 11:08 AM, cmake- boun...@cmake.org
  wrote:Am Mittwoch, 13. November 2013 um 18:41:03, schrieb David
  Hauck dav...@netacquire.comHi Kornel,   
   On Wednesday,
  November 13, 2013 10:26 AM, cmake-boun...@cmake.org wrote:
   Am
  Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck 
  dav...@netacquire.com   Hello,  I've been
 using
  several install (CODE EXECUTE_PROCESS ...)constructs
in
  my top-level CMakeLists.txt file. However, I've been unable to   
  capture/operate on any exit status of the embedded command.  
  Unfortunately, documentation/searches haven't turned up any useful   
  pointers. The closest I've come is a pointer in the following thread:
http://www.cmake.org/pipermail/cmake/2011- July/045475.html
  However,  I've not been able to sufficiently read between the
  lines to get  this working.   Does anyone
 have any
  thoughts on how to get something like the following working:
install (CODE EXECUTE_PROCESS (  COMMAND
 ant
  ...   WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java   
  ERROR_VARIABLE _errDidn't you mean 'RESULT_VARIABLE' here?
  No, I really do mean ERROR_VARIABLE (unless, of course,
 this
  variable  does  not include the non-zero exit status of
 the
  EXECUTE_PROCESS command?).   If you run 'cmake --help-command
  execute_process', you see: ... If RESULT_VARIABLE is given the
  variable will be set to contain the   result of running the processes.
   This will be an integer return code  from the last child or a
 string
  describing an error condition. ... So,if this is not 0, then
 you
  have an error condition.
 
   Yes, I see this. I also assumed that the ERROR_VARIABLE would be
  returning non-zero text as well in this case. I will change to using
  RESULT_VARIABLE, but, in both cases, it seems that I'm referencing
  the variable incorrectly (either syntactically or in the incorrect
  context) since this/these is/are always empty.
 
BTW, I'm still curious about the (dual 'code') construct
 generally.
Specifically, if I do the following I never see the fatal error
  
  message (so I'm wondering if there's still something wrong regarding
the scoping of the message command)?   
  install (CODE
  EXECUTE_PROCESS (  COMMAND ant ...
 WORKING_DIRECTORY
  ${PROJECT_SOURCE_DIR}/java  

Re: [CMake] INSTALL CODE Error Results and Termination

2013-11-13 Thread David Hauck
Hi Jean-christophe,
 
On chris.filli...@kitware.com], Jean-Christophe Fillion-Robin wrote:
 Hi,
 
 You also need to add the if statement into the CODE parameter, for
 example something like this ...
 
 install(CODE If (NOT \${_res} EQUAL 0)
   message( FATAL_ERROR \out: \${_out}, err: \${_err}, res:
 \${_res}\)
 
   endif()
 )

Perfect, thx (just fixed up the double-quote escaping a bit and things worked 
fine).

 To keep things simpler, you could also look at INSTALL(SCRIPT ...)
 it would allow you to avoid escaping. You would just need to configure
 the script using configure_file.

Hmmm, OK, I'll look into reviewing this to see how things differ.

Thanks,
-David
 
 Hth
 Jc
 
 On Wed, Nov 13, 2013 at 2:57 PM, David Hauck dav...@netacquire.com
 wrote:
   On Wednesday, November 13, 2013 11:42 AM, David Hauck wrote: Hi
 Jean-christophe,  On chris.filli...@kitware.com], 
 Jean-Christophe
 Fillion-Robin wrote:
 
Hi David,   You need to escape the $ sign otherwise the
 _err, _out and _res  variables are resolved to an empty string.
  Here is an example of what you could do: 
 -8---8--
 cmake_minimum_required(VERSION 2.8.9)install(CODE
 execute_process (   COMMAND ${CMAKE_COMMAND} -E echo \Hello\
  OUTPUT_VARIABLE _out  ERROR_VARIABLE _err  
 RESULT_VARIABLE _res ) )  install(CODE 
 message(
 STATUS \out: \${_out}, err: \${_err}, res:\${_res}...\))
 -8---8--
 
Aha! This was probably obvious to you and Kornel, but it escaped
 me ;).
Brilliant, this is working fine now.
 
   One last item here: I'm now able to see the resulting variable values
 in the message command output, but I'd now like to enclose this in an 'if'
 command. Something like:
 
   install(CODE execute_process (
 COMMAND ${CMAKE_COMMAND} -E echo \Hello\
 OUTPUT_VARIABLE _out
 ERROR_VARIABLE _err
 RESULT_VARIABLE _res
 )
  )
 
   If (NOT \${_res} EQUAL 0) # escaping here has not effect one way or
 the other...
  install(CODE message( FATAL_ERROR \out: \${_out}, err:
 \${_err}, res: \${_res}\))
   endif ()
 
   However, the resulting cmake_install.cmake has the following (meaning
 the fatal error message will always be executed regardless of the
 value of '_res):
 
   IF(NOT CMAKE_INSTALL_COMPONENT OR
 ${CMAKE_INSTALL_COMPONENT}
 STREQUAL Unspecified)
 
 MESSAGE( FATAL_ERROR out: ${_out}, err: ${_err}, res: ${_res}...)
 
   ENDIF(NOT CMAKE_INSTALL_COMPONENT OR
 ${CMAKE_INSTALL_COMPONENT} STREQUAL Unspecified)
 
   Is there a way to do this?
 
   -David
 
Thanks to both of you for your help,
-David
   
Hth   Jc  On Wed, Nov 13, 2013 at 2:29 PM, David Hauck
 dav...@netacquire.comwrote: Hi Kornel,  
 
 On Wednesday, November 13, 2013 11:08 AM, cmake-
 boun...@cmake.org  wrote:Am Mittwoch, 13. November 2013 um
 18:41:03, schrieb David
 
Hauck dav...@netacquire.comHi Kornel,
 On Wednesday,
November 13, 2013 10:26 AM, cmake-boun...@cmake.org
 wrote:   Am
Mittwoch, 13. November 2013 um 18:12:26, schrieb David Hauck
 
dav...@netacquire.com   Hello, 
 I've been using
several install (CODE EXECUTE_PROCESS ...)   
 constructs  in
my top-level CMakeLists.txt file. However, I've been unable
 to   
capture/operate on any exit status of the embedded command.
 
Unfortunately, documentation/searches haven't turned up any useful  
 pointers. The closest I've come is a pointer in the following
 thread:  http://www.cmake.org/pipermail/cmake/2011-
 July/045475.html   However,  I've not been able to
 sufficiently read between the  lines to get  this
 working.   Does anyone have anythoughts on how to
 get something like the following working:   
 install (CODE EXECUTE_PROCESS (COMMAND ant...  
 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/java
 
ERROR_VARIABLE _errDidn't you mean 'RESULT_VARIABLE'
 here?  No, I really do mean ERROR_VARIABLE (unless,
 of course, thisvariable  does  not include the
 non-zero exit status of theEXECUTE_PROCESS command?).  
 If you run 'cmake --help-command   execute_process', you see: ... If  
   RESULT_VARIABLE is given thevariable will be set to contain the 
  result of running the processes.  This will be an integer return
 code  from the last child or a string describing an error
 condition. ... So,if this is not 0, then youhave an
 error condition.  Yes, I see this. I also assumed that the
 

[CMake] CTest working directory and CMAKE_CFD_INTDIR

2013-11-13 Thread Kurt Ehlert
I am trying to run a test in a specific working directory. The command I
used was:

add_test(NAME MyTest
WORKING_DIRECTORY ${MyDir}/Test/${CMAKE_CFG_INTDIR}
  COMMAND MyTest
)

When I tried running CTest within Xcode, the test did not pass, and instead
CTest gave me an error (BAD_COMMAND). I then looked at CTestTestfile.cmake
for a clue, and I found

SET_TESTS_PROPERTIES(MyTest PROPERTIES  WORKING_DIRECTORY
/MyDir/Test/\$(CONFIGURATION)\$(EFFECTIVE_PLATFORM_NAME))

The problem seems to be that CMAKE_CFG_INTDIR doesn't work correctly when
used within add_test (and specifically for the WORKING_DIRECTORY).

I changed the above line by manually inserting Debug, so it read

SET_TESTS_PROPERTIES(MyTest PROPERTIES  WORKING_DIRECTORY
/MyDir/Test/Debug)

and the test passed. Am I using the WORKING_DIRECTORY option correctly?
Should it be working with CMAKE_CFG_INTDIR?

Thanks.
--

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] Specifying an alternate location for cmake Modules directory

2013-11-13 Thread Paul Smith
I need to maintain my own copy of the latest cmake, and for multiple
different target systems (GNU/Linux, MacOS, Windows, Solaris...)

I have a shared location where all tools like this go, so that
regardless of the system architecture you can access this one location.
Obviously inside that location are architecture-specific areas for
binaries, etc.

There is also a common area for files that can be shared, to reduce disk
usage, copying time, etc.

Since all of the cmake installation with the exception of the binaries
is identical between the different architectures, I want to share all of
the installation (for example the Modules directory, etc.)  I can't use
symlinks.

So what I'd like is a structure something like this:

  .../common/cmake/Modules/...

  .../linux/bin/cmake
  .../darwin/bin/cmake
  .../windows/bin/cmake.exe
  .../sunos/bin/cmake

I can use a wrapper around cmake to set environment variables or pass in
command line flags to the REAL cmake, if necessary.

Is there any way to convince cmake to look in a different place for
Modules etc.?

--

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, master, updated. v2.8.12.1-611-g11fe434

2013-11-13 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, master has been updated
   via  11fe43422fe046d966dda8ae513b2b0af4377503 (commit)
   via  684063c0363687285126f30a517239aa2ad46149 (commit)
   via  eaf5b7a776e24af55f6f7f254171c3e2d2932d9b (commit)
  from  706aab0418f40e9816be5270e5b4e89321411e2d (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=11fe43422fe046d966dda8ae513b2b0af4377503
commit 11fe43422fe046d966dda8ae513b2b0af4377503
Merge: 706aab0 684063c
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Nov 13 09:55:17 2013 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Nov 13 09:55:17 2013 -0500

Merge topic 'cleanup-edit_cache-target'

684063c Refactor tool selection for edit_cache (#14544)
eaf5b7a cmGlobalGenerator: Do not propagate const through GetCMakeInstance


---

Summary of changes:
 Help/variable/CMAKE_EDIT_COMMAND.rst  |3 +-
 Source/cmExtraCodeBlocksGenerator.cxx |   20 -
 Source/cmExtraEclipseCDT4Generator.cxx|   20 -
 Source/cmExtraSublimeTextGenerator.cxx|   20 -
 Source/cmGlobalGenerator.cxx  |   15 +
 Source/cmGlobalGenerator.h|6 ++-
 Source/cmGlobalNinjaGenerator.cxx |7 
 Source/cmGlobalNinjaGenerator.h   |1 +
 Source/cmGlobalUnixMakefileGenerator3.cxx |   44 +
 Source/cmGlobalUnixMakefileGenerator3.h   |3 ++
 Source/cmLocalUnixMakefileGenerator3.cxx  |   11 ---
 Source/cmake.cxx  |   32 -
 Source/cmake.h|7 ++--
 13 files changed, 73 insertions(+), 116 deletions(-)


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


[Cmake-commits] CMake branch, master, updated. v2.8.12.1-613-g3822f5b

2013-11-13 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, master has been updated
   via  3822f5bcacf5076d8c1832e2dae57b47c1247f56 (commit)
   via  096591b96a0fb8cac2b330bc727c96ff90fa8d97 (commit)
  from  11fe43422fe046d966dda8ae513b2b0af4377503 (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=3822f5bcacf5076d8c1832e2dae57b47c1247f56
commit 3822f5bcacf5076d8c1832e2dae57b47c1247f56
Merge: 11fe434 096591b
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Nov 13 09:56:30 2013 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Nov 13 09:56:30 2013 -0500

Merge topic 'wix-custom-arguments'

096591b CPackWiX: Add variables for custom tool extensions and flags


---

Summary of changes:
 Modules/CPackWIX.cmake   |   24 ++-
 Source/CPack/WiX/cmCPackWIXGenerator.cxx |   69 +++---
 Source/CPack/WiX/cmCPackWIXGenerator.h   |   10 
 3 files changed, 96 insertions(+), 7 deletions(-)


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


[Cmake-commits] CMake branch, master, updated. v2.8.12.1-617-g85b9103

2013-11-13 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, master has been updated
   via  85b91039c2ec3956a8107dc5619dec72e481209b (commit)
   via  ed675a92a1581214916030fd1e12d50810ad7dd4 (commit)
  from  3c4071bec469f10cd802c8db43f3558aa71bd73b (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=85b91039c2ec3956a8107dc5619dec72e481209b
commit 85b91039c2ec3956a8107dc5619dec72e481209b
Merge: 3c4071b ed675a9
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Nov 13 09:57:49 2013 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Nov 13 09:57:49 2013 -0500

Merge topic 'create_test_sourcelist-clang-warnings'

ed675a9 create_test_sourcelist: Fix linkage in generated test driver code


---

Summary of changes:
 Templates/TestDriver.cxx.in |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


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


[Cmake-commits] CMake branch, master, updated. v2.8.12.1-629-g558a6f1

2013-11-13 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, master has been updated
   via  558a6f1f920defdfcd7651fba3a85fded84d6a63 (commit)
   via  3bade75b02cd4989d0be5efc6547439eade22be9 (commit)
   via  2bbf6bd7f880ee618dd1260d784ba88b042dbf89 (commit)
   via  3ee67d0df93a37c3026e857be48b9dfdd580062f (commit)
   via  621ba1fd04bae0a450da91887308a5647f071892 (commit)
   via  993b685676de7bd63c7e45d7b119acc2da9b2fc3 (commit)
  from  978d796e8dbb437ff9ebf34dadb123a9583c6d9b (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=558a6f1f920defdfcd7651fba3a85fded84d6a63
commit 558a6f1f920defdfcd7651fba3a85fded84d6a63
Merge: 978d796 3bade75
Author: Brad King brad.k...@kitware.com
AuthorDate: Wed Nov 13 09:59:12 2013 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Nov 13 09:59:12 2013 -0500

Merge topic 'cmake-copyright-year'

3bade75 Help: Parse Copyright.txt instead of using current year
2bbf6bd Copyright.txt: Add test to check year range
3ee67d0 Copyright.txt: Update year range to end in 2013
621ba1f cmake-gui: Parse Copyright.txt instead of duplicating notice
993b685 bootstrap: Parse Copyright.txt instead of duplicating notice


---

Summary of changes:
 Copyright.txt   |3 ++-
 Source/QtDialog/CMakeLists.txt  |5 -
 Tests/CMakeCopyright.cmake  |   22 ++
 Tests/CMakeLists.txt|3 +++
 Utilities/Sphinx/CMakeLists.txt |9 +
 Utilities/Sphinx/conf.py.in |3 +--
 bootstrap   |4 +++-
 7 files changed, 44 insertions(+), 5 deletions(-)
 create mode 100644 Tests/CMakeCopyright.cmake


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


[Cmake-commits] CMake branch, next, updated. v2.8.12.1-5131-g9cbfb82

2013-11-13 Thread Daniele E . Domenichelli
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  9cbfb82e873f1c3cc454da2482d163d7e7a7e4f0 (commit)
   via  bf755c7c381d8d7d84578bf2dc4ac673aefa090a (commit)
   via  bc280f1c8108809abed700c2fe039340bb9ae1c0 (commit)
   via  20afbd5e037a0ccfa55af8564ed8cd3ec2430540 (commit)
  from  9628802de3783ebf22600afda108e8356953d9f6 (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=9cbfb82e873f1c3cc454da2482d163d7e7a7e4f0
commit 9cbfb82e873f1c3cc454da2482d163d7e7a7e4f0
Merge: 9628802 bf755c7
Author: Daniele E. Domenichelli daniele.domeniche...@gmail.com
AuthorDate: Wed Nov 13 11:33:50 2013 -0500
Commit: CMake Topic Stage kwro...@kitware.com
CommitDate: Wed Nov 13 11:33:50 2013 -0500

Merge topic 'set_emptyvar_PARENT_SCOPE' into next

bf755c7 set: Add unit tests for set/unset PARENT_SCOPE
bc280f1 set: Fix handling of empty value with PARENT_SCOPE
20afbd5 set: Handle value-less PARENT_SCOPE explicitly


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf755c7c381d8d7d84578bf2dc4ac673aefa090a
commit bf755c7c381d8d7d84578bf2dc4ac673aefa090a
Author: Daniele E. Domenichelli daniele.domeniche...@iit.it
AuthorDate: Wed Nov 13 09:18:18 2013 +0100
Commit: Brad King brad.k...@kitware.com
CommitDate: Wed Nov 13 10:18:38 2013 -0500

set: Add unit tests for set/unset PARENT_SCOPE

Create a RunCMake.set test to cover set() command cases, starting with
PARENT_SCOPE.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index bf3dcc1..bb1b909 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -107,6 +107,7 @@ add_RunCMake_test(list)
 add_RunCMake_test(message)
 add_RunCMake_test(string)
 add_RunCMake_test(try_compile)
+add_RunCMake_test(set)
 add_RunCMake_test(variable_watch)
 add_RunCMake_test(CMP0004)
 add_RunCMake_test(TargetPolicies)
diff --git a/Tests/RunCMake/set/CMakeLists.txt 
b/Tests/RunCMake/set/CMakeLists.txt
new file mode 100644
index 000..4b3de84
--- /dev/null
+++ b/Tests/RunCMake/set/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/set/PARENT_SCOPE-result.txt 
b/Tests/RunCMake/set/PARENT_SCOPE-result.txt
new file mode 100644
index 000..573541a
--- /dev/null
+++ b/Tests/RunCMake/set/PARENT_SCOPE-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/set/PARENT_SCOPE.cmake 
b/Tests/RunCMake/set/PARENT_SCOPE.cmake
new file mode 100644
index 000..9bd6bca
--- /dev/null
+++ b/Tests/RunCMake/set/PARENT_SCOPE.cmake
@@ -0,0 +1,33 @@
+set(FOO )
+set(BAR bar)
+set(BAZ baz)
+set(BOO boo)
+
+function(_parent_scope)
+set(FOO foo PARENT_SCOPE)
+set(BAR  PARENT_SCOPE)
+set(BAZ PARENT_SCOPE)
+unset(BOO PARENT_SCOPE)
+endfunction()
+
+_parent_scope()
+
+if(NOT DEFINED FOO)
+  message(FATAL_ERROR FOO not defined)
+elseif(NOT ${FOO} STREQUAL foo)
+  message(FATAL_ERROR FOO should be \foo\, not \${FOO}\)
+endif()
+
+if(NOT DEFINED BAR)
+  message(FATAL_ERROR BAR not defined)
+elseif(NOT ${BAR} STREQUAL )
+  message(FATAL_ERROR BAR should be an empty string, not \${BAR}\)
+endif()
+
+if(DEFINED BAZ)
+  message(FATAL_ERROR BAZ defined)
+endif()
+
+if(DEFINED BOO)
+  message(FATAL_ERROR BOO defined)
+endif()
diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake 
b/Tests/RunCMake/set/RunCMakeTest.cmake
new file mode 100644
index 000..5d036e3
--- /dev/null
+++ b/Tests/RunCMake/set/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(PARENT_SCOPE)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc280f1c8108809abed700c2fe039340bb9ae1c0
commit bc280f1c8108809abed700c2fe039340bb9ae1c0
Author: Daniele E. Domenichelli daniele.domeniche...@iit.it
AuthorDate: Wed Nov 13 09:02:56 2013 +0100
Commit: Brad King brad.k...@kitware.com
CommitDate: Wed Nov 13 10:15:56 2013 -0500

set: Fix handling of empty value with PARENT_SCOPE

Just as

  set(VAR )

sets VAR to an empty string in the current scope, the code

  set(VAR  PARENT_SCOPE)

is documented to set the variable to an empty string in the parent
scope.  Fix the implementation to make it so.

diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 22b4383..bb193bf 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -122,15 +122,8 @@ bool cmSetCommand
 
   if (parentScope)
 {
-if (value.empty())
-  {
-  this-Makefile-RaiseScope(variable, 0);
-  }
-else
-  {
-  this-Makefile-RaiseScope(variable, value.c_str());
-