Re: [CMake] [cmake-developers] productbuild: Installing to absolute system path or to user home path

2019-10-31 Thread David Cole via CMake
According to the docs, the INSTALL command uses the absolute path if
it is given as the DESTINATION, so  it should work.
https://cmake.org/cmake/help/latest/command/install.html

Did you try using a double quoted string, instead of escaping the
space with a backslash?

I think this should work for the absolute one:
INSTALL( ... DESTINATION "/abs/path/to/some folder")

For the one in the home directory, I'm not sure if a string that
starts with "~" is considered absolute or not, so it may or may not
end up where you expect it. Can you resolve it before hand with a
get_filename_component call, (or otherwise), and pass in a string that
begins with "/" ...?


Hope this helps,
David C.


On Mon, Oct 28, 2019 at 4:36 PM Roman Wüger  wrote:
>
> 
>
> Hello,
>
>
>
> I tried to install a file/directory with productbuild on macOS which is 
> generated with CPack
>
> The most of the files are installed correctly, but I have two problems:
>
>
>
> If I want to install to “/Library/Application\ 
> Support/Adobe/Lightroom/Modules”
> If I want to install to the users modules folder “~/Library/Application\ 
> Support/Adobe/Lightroom/Modules”
>
>
>
> How can I archive these two?
>
>
>
> I already tried the following with no luck:
>
> install(DIRECTORY 
> $/${CMAKE_PROJECT_NAME}.lrplugin
>
> DESTINATION /Library/Application\ 
> Support/Adobe/Lightroom/Modules)
>
>
>
> install(DIRECTORY 
> $/${CMAKE_PROJECT_NAME}.lrplugin
>
> DESTINATION ~/Library/Application\ 
> Support/Adobe/Lightroom/Modules)
>
>
>
> Best Regards
>
> Roman
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake-developers
-- 

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


Re: [CMake] [cmake-developers] Debugging find_package() search behavior?

2017-10-01 Thread David Cole via CMake
No, I was already promptly corrected by Brad, too. I was not
accounting for the fact that the other find_* calls used inside of
find modules also use CMAKE_PREFIX_PATH. I was thinking of its use to
find a project's config file from the find_package config mode.

I stand corrected. Again. ;-)

However, I stand by my assertion that find modules do what they want.
It's still a bit of a wild wild west, and people make their own find
modules that live inside their own project's source trees.

Config files should be the preferred/primary mechanism for
find_package calls (going on something like 5 or 6 years now...), but
still people write new find modules.


Thanks,
David C.




On Sun, Oct 1, 2017 at 11:52 AM, Alexander Neundorf
 wrote:
> On 2017 M08 29, Tue 11:33:15 CEST David Cole via cmake-developers wrote:
>> That's correct:
>>
>> find modules do what they want, and most do not pay attention to
>> CMAKE_PREFIX_PATH.
>
> are you sure ?
> As long as NO_DEFAULT_PATH is not used in the find_*() calls, 
> CMAKE_PREFIX_PATH
> is used automatically by them.
>
> Alex
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] rebuild externalprojects

2017-09-21 Thread David Cole via CMake
By manually deleting (or touching) the stamp file associated with the
earliest step you need to re-run.

ExternalProject is not for auto-detecting changes to stuff and
minimally re-running build steps. It's for static stuff that doesn't
change much.

Find the "-build" stamp file that's associated with the project
containing the source you changed and delete it.

Then run the build from the top and that one and everything that
depends on it afterwards should rebuild.


HTH,
David C.


On Thu, Sep 21, 2017 at 7:09 AM, J Decker  wrote:
> how do I make sure that externalprojects get built if I change a source in
> one?
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] [cmake-developers] Debugging find_package() search behavior?

2017-08-29 Thread David Cole via CMake
Sorry for the mis-statement. I stand corrected.

However, it is true that there are many find modules with some
differences in approach, and if you are using one, you need to read up
on the individual documentation of that particular find module.
Especially if you need to know how to tell it how to find the exact
one you already know you have...




On Tue, Aug 29, 2017 at 11:49 AM, Brad King  wrote:
> On 08/29/2017 11:33 AM, David Cole wrote:
>> That's correct:
>>
>> find modules do what they want, and most do not pay attention to
>> CMAKE_PREFIX_PATH.
>
> CMAKE_PREFIX_PATH *is* used by find modules.
>
> The find modules use find_* commands, and those use CMAKE_PREFIX_PATH.
> See the documentation of find_library, find_path, etc. for details.
> Each command searches an appropriate `/` where ``
> is based on the kind of command doing the searching.
>
> -Brad
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] [cmake-developers] Debugging find_package() search behavior?

2017-08-29 Thread David Cole via CMake
That's correct:

find modules do what they want, and most do not pay attention to
CMAKE_PREFIX_PATH.

It's better to use a config file, but when you have to use a find
module, you have to dig in and figure out the right way to use each
one.



On Tue, Aug 29, 2017 at 11:25 AM, Robert Dailey
 wrote:
> I think the discrepancy here might be config vs module find mode. The
> documentation I linked seems to be for config mode only, however I'm
> utilizing the CMake-shipped FindZLIB.cmake module to find this
> particular library. Does this offer no guarantees on how
> CMAKE_PREFIX_PATH is used?
>
> On Tue, Aug 29, 2017 at 10:11 AM, Robert Dailey
>  wrote:
>> What I'm hoping for is that find_package() follows the rules it
>> documents here:
>> https://cmake.org/cmake/help/v3.6/command/find_package.html
>>
>> Specifically, it states it searches these paths (and that  is
>> treated case-insensitive):
>>
>> /   (W)
>> /(cmake|CMake)/ (W)
>> /*/   (W)
>> /*/(cmake|CMake)/ (W)
>> /(lib/|lib|share)/cmake/*/  (U)
>> /(lib/|lib|share)/*/(U)
>> /(lib/|lib|share)/*/(cmake|CMake)/  (U)
>>
>> If this is true, then the 3rd one from the top should be a match,
>> because  is set to:
>>
>> E:/code/frontend/msvc_2015/third_party/installed
>>
>> And  is set to ZLIB in find_package() first argument, so it
>> should be adding that to the end.
>>
>> I need to keep CMAKE_PREFIX_PATH pointing to the parent directory
>> ("installed") because I have other libraries that get installed in
>> that directory, each with their own directory to contain their
>> installation files. If find_package() is appending  to 
>> like it says it should, it should find each one of them without
>> switching the value of CMAKE_PREFIX_PATH.
>>
>> Am I misunderstanding something?
>>
>>
>> On Tue, Aug 29, 2017 at 10:06 AM, David Cole  wrote:
>>> Shouldn't the "/zlib" at the end be included in your CMAKE_PREFIX_PATH?
>>>
>>> On Tue, Aug 29, 2017 at 11:01 AM, Robert Dailey
>>>  wrote:
 On Tue, Aug 29, 2017 at 9:56 AM, Brad King  wrote:
> On 08/29/2017 10:55 AM, Brad King wrote:
>> On 08/29/2017 10:48 AM, Robert Dailey wrote:
>>> CMAKE_PREFIX_PATH: E:/code/frontend/msvc_2015/third_party/installed
>>> CMAKE_FIND_ROOT_PATH: E:/code/frontend/msvc_2015/third_party/installed
>>
>> I'm not sure how CMAKE_FIND_ROOT_PATH's path re-rooting interacts with
>> drive letters on Windows.
>
> Oops, sent too soon.
>
> CMAKE_FIND_ROOT_PATH should not be necessary here.  It's for 
> cross-compiling
> to re-root paths like `/usr` into some prefix on the host.
>
> -Brad

 Ok but even if I remove that, find_package() still isn't working..
 --

 Powered by www.kitware.com

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

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

 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] [cmake-developers] Debugging find_package() search behavior?

2017-08-29 Thread David Cole via CMake
Is there a ZLIBConfig.cmake file which find_package is searching for?
(i.e. -- somewhere under that directory does that file exist?) On
Windows the case won't matter, but on Linux, a find_package(ZLIB will
expect a case-sensitive match on a ZLIBConfig.cmake file.

If ZLIBConfig.cmake exists, it needs to exist in one of the locations
on that find_package documentation snippet you sent. If it's not
directly in the "zlib" folder, or one of the other folders listed,
then it won't be found. The directory it is in, or something matching
one of those in the list needs to be included in your
CMAKE_PREFIX_PATH.


If that file does not exist, then the CMake FindZLIB.cmake module will
be used in an attempt to find your zlib... And the help for that
speaks of setting a ZLIB_ROOT var if you want to direct it to find a
given zlib. See the "HINTS" section here:

https://cmake.org/cmake/help/v3.6/module/FindZLIB.html#hints


One more hint regarding CMAKE_PREFIX_PATH : despite its name, it is a
**list** of paths, and you can use multiple semi-colon separated
values if necessary. So, if appending "/zlib" works, then you could
always find zlib and all your other stuff too by using two directories
as your CMAKE_PREFIX_PATH value.


HTH,
David C.



On Tue, Aug 29, 2017 at 11:11 AM, Robert Dailey
 wrote:
> What I'm hoping for is that find_package() follows the rules it
> documents here:
> https://cmake.org/cmake/help/v3.6/command/find_package.html
>
> Specifically, it states it searches these paths (and that  is
> treated case-insensitive):
>
> /   (W)
> /(cmake|CMake)/ (W)
> /*/   (W)
> /*/(cmake|CMake)/ (W)
> /(lib/|lib|share)/cmake/*/  (U)
> /(lib/|lib|share)/*/(U)
> /(lib/|lib|share)/*/(cmake|CMake)/  (U)
>
> If this is true, then the 3rd one from the top should be a match,
> because  is set to:
>
> E:/code/frontend/msvc_2015/third_party/installed
>
> And  is set to ZLIB in find_package() first argument, so it
> should be adding that to the end.
>
> I need to keep CMAKE_PREFIX_PATH pointing to the parent directory
> ("installed") because I have other libraries that get installed in
> that directory, each with their own directory to contain their
> installation files. If find_package() is appending  to 
> like it says it should, it should find each one of them without
> switching the value of CMAKE_PREFIX_PATH.
>
> Am I misunderstanding something?
>
>
> On Tue, Aug 29, 2017 at 10:06 AM, David Cole  wrote:
>> Shouldn't the "/zlib" at the end be included in your CMAKE_PREFIX_PATH?
>>
>> On Tue, Aug 29, 2017 at 11:01 AM, Robert Dailey
>>  wrote:
>>> On Tue, Aug 29, 2017 at 9:56 AM, Brad King  wrote:
 On 08/29/2017 10:55 AM, Brad King wrote:
> On 08/29/2017 10:48 AM, Robert Dailey wrote:
>> CMAKE_PREFIX_PATH: E:/code/frontend/msvc_2015/third_party/installed
>> CMAKE_FIND_ROOT_PATH: E:/code/frontend/msvc_2015/third_party/installed
>
> I'm not sure how CMAKE_FIND_ROOT_PATH's path re-rooting interacts with
> drive letters on Windows.

 Oops, sent too soon.

 CMAKE_FIND_ROOT_PATH should not be necessary here.  It's for 
 cross-compiling
 to re-root paths like `/usr` into some prefix on the host.

 -Brad
>>>
>>> Ok but even if I remove that, find_package() still isn't working..
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at: 
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more 
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at 
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] [cmake-developers] Debugging find_package() search behavior?

2017-08-29 Thread David Cole via CMake
Shouldn't the "/zlib" at the end be included in your CMAKE_PREFIX_PATH?

On Tue, Aug 29, 2017 at 11:01 AM, Robert Dailey
 wrote:
> On Tue, Aug 29, 2017 at 9:56 AM, Brad King  wrote:
>> On 08/29/2017 10:55 AM, Brad King wrote:
>>> On 08/29/2017 10:48 AM, Robert Dailey wrote:
 CMAKE_PREFIX_PATH: E:/code/frontend/msvc_2015/third_party/installed
 CMAKE_FIND_ROOT_PATH: E:/code/frontend/msvc_2015/third_party/installed
>>>
>>> I'm not sure how CMAKE_FIND_ROOT_PATH's path re-rooting interacts with
>>> drive letters on Windows.
>>
>> Oops, sent too soon.
>>
>> CMAKE_FIND_ROOT_PATH should not be necessary here.  It's for cross-compiling
>> to re-root paths like `/usr` into some prefix on the host.
>>
>> -Brad
>
> Ok but even if I remove that, find_package() still isn't working..
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] CMake 3.9.0 Windows zip file shows wrong version

2017-08-08 Thread David Cole via CMake
I suspect you are running a different cmake, not the one you've unzipped.

Type "where cmake" instead of "cmake --version" and Windows will list
the directories where it finds an executable named cmake. The first
one it lists is the one it is running when you type "cmake
--version"...

If you want to force the one you've downloaded to run instead of that
one, you could **prepend** to the PATH instead of appending to it.


HTH,
David C.



On Mon, Aug 7, 2017 at 9:07 PM, Adam Getchell  wrote:
> Hi all,
>
> The CMake 3.9.0 Windows zip file gives the wrong version. Here’s a snippet
> from my AppVeyor logs [1]:
>
> set CMAKE_URL="https://cmake.org/files/v3.9/cmake-3.9.0-win64-x64.zip";
> appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
> Downloading cmake.zip (25,944,520 bytes)...100%
> 7z x cmake.zip -oC:\projects\dev
> 7-Zip [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04
> Scanning the drive for archives:
> 1 file, 25944520 bytes (25 MiB)
> Extracting archive: cmake.zip
> --
> Path = cmake.zip
> Type = zip
> Physical Size = 25944520
> Everything is Ok
> Folders: 90
> Files: 4922
> Size: 66584952
> Compressed: 25944520
> set PATH=%PATH%;C:\projects\dev\cmake\bin
> cmake --version
> cmake version 3.8.2
> CMake suite maintained and supported by Kitware (kitware.com/cmake).
>
> [1] https://ci.appveyor.com/project/acgetchell/cdt-plusplus
> --
> Adam Getchell
> https://keybase.io/adamgetchell
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] What is the default build type?

2017-08-02 Thread David Cole via CMake
Yes, your code is a good example Marcus. It was one of the previous
suggestions on this thread which had example code setting
CMAKE_CONFIGURATION_TYPES.

I would recommend against setting this variable because in some places
in CMake code, it is used as an approximate proxy for whether or not a
multi-configuration generator is being used.


For a few examples, see the CMake code base itself:

$ git grep CMAKE_CONFIGURATION_TYPES | grep -Ev
"Auxiliary/vim/syntax/cmake.vim|Help/|Tests/"

CMakeCPack.cmake:  if(CMAKE_CONFIGURATION_TYPES)
Modules/CMakeExpandImportedTargets.cmake:#
${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
Modules/CMakeExpandImportedTargets.cmake:  if(CMAKE_CONFIGURATION_TYPES)
Modules/CMakeExpandImportedTargets.cmake: list(GET
CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION)
Modules/CTestTargets.cmake:if(CMAKE_CONFIGURATION_TYPES)
Modules/DeployQt4.cmake:if(configurations AND
(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
Modules/DeployQt4.cmake:if(CMAKE_CONFIGURATION_TYPES
OR CMAKE_BUILD_TYPE)
Modules/ExternalProject.cmake:  if(CMAKE_CONFIGURATION_TYPES)
Modules/ExternalProject.cmake:if(CMAKE_CONFIGURATION_TYPES)
Modules/ExternalProject.cmake:  if(CMAKE_CONFIGURATION_TYPES)
Modules/ExternalProject.cmake:if(CMAKE_CONFIGURATION_TYPES)
Modules/ExternalProject.cmake:  foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
Modules/FindBoost.cmake:  if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
Modules/FindCUDA.cmake:# Makefile and similar generators don't define
CMAKE_CONFIGURATION_TYPES, so we
Modules/FindCUDA.cmake:set(CUDA_configuration_types
${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel
Release RelWithDebInfo)
Modules/FindQt4.cmake:if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
Modules/SelectLibraryConfigurations.cmake:   (
CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) )
Source/cmGlobalVisualStudio7Generator.cxx:  if
(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
Source/cmGlobalVisualStudio7Generator.cxx:
"CMAKE_CONFIGURATION_TYPES",
"Debug;Release;MinSizeRel;RelWithDebInfo",
Source/cmGlobalXCodeGenerator.cxx:  if
(!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
Source/cmGlobalXCodeGenerator.cxx:  "CMAKE_CONFIGURATION_TYPES",
"Debug;Release;MinSizeRel;RelWithDebInfo",
Source/cmGlobalXCodeGenerator.cxx:
this->CurrentMakefile->GetRequiredDefinition("CMAKE_CONFIGURATION_TYPES");
Source/cmMakefile.cxx:
this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
Utilities/Release/WiX/CMakeLists.txt:if(CMAKE_CONFIGURATION_TYPES)





On Wed, Aug 2, 2017 at 2:42 PM, Marcus D. Hanwell
 wrote:
> On Wed, Aug 2, 2017 at 1:32 PM, David Cole  wrote:
>> Very cool, Marcus. Thanks for the blog post.
>>
>> Florian, when you "message(${CMAKE_CONFIGURATION_TYPES})" it is empty
>> because you are using a single-configuration CMake generator. Only
>> Visual Studio and Xcode (and possibly other) **multi** config
>> generators have a list of values in CMAKE_CONFIGURATION_TYPES.
>> Contrary to the previous recommendation, I would NOT recommend setting
>> it to a list in a single configuration generator. If you're using a
>> multi-config generator, you can set up a subset for it to use with
>> this, but in a single config generator, this variable SHOULD be empty,
>> and you should not give it contents in that case.
>>
> Terrible English, try number two... Why would you not recommend
> setting it, and what do you mean by it? I was not setting
> CMAKE_CONFIGURATION_TYPES to anything, but the CMAKE_BUILD_TYPE
> property is manipulated to offer the list, and then the
> CMAKE_BUILD_TYPE variable is populated if it is empty in my example.
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] What is the default build type?

2017-08-02 Thread David Cole via CMake
Very cool, Marcus. Thanks for the blog post.

Florian, when you "message(${CMAKE_CONFIGURATION_TYPES})" it is empty
because you are using a single-configuration CMake generator. Only
Visual Studio and Xcode (and possibly other) **multi** config
generators have a list of values in CMAKE_CONFIGURATION_TYPES.
Contrary to the previous recommendation, I would NOT recommend setting
it to a list in a single configuration generator. If you're using a
multi-config generator, you can set up a subset for it to use with
this, but in a single config generator, this variable SHOULD be empty,
and you should not give it contents in that case.


HTH,
David C.



On Wed, Aug 2, 2017 at 11:55 AM, Marcus D. Hanwell
 wrote:
> On Wed, Aug 2, 2017 at 3:03 AM, Bo Zhou  wrote:
>>
>> It depends on the Generator.
>>
>> To the Makefile, the actual type was controlled by the compiler options.
>> If you don't specific any type, usually it means non-debug and
>> non-optimization because the CMAKE_CXX_FLAGS is empty as default. This is
>> critical, so usually people should specific the actual type they want to
>> build.
>>
>> To the generator of the IDE, such as Visual Studio and Xcode, the
>> CMAKE_BUILD_TYPE doesn't make sense but we have to use
>> CMAKE_CONFIGURATION_TYPES, then CMake will create the several configuration
>> sets for the IDE from the CMAKE_C|CXX_FLAGS_{CONFIG} .
>
>
> This thread inspired me to write up how we have been doing it in some of the
> projects I work on for quite a while now,
>
> https://blog.kitware.com/cmake-and-the-default-build-type/
>
> It certainly isn't the only way, but it provides an easy path to ensure
> things show up in the GUIs, respect build types passed in, 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://public.kitware.com/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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Source is not rebuild when header changes

2017-08-01 Thread David Cole via CMake
And in your file "src/CMakeLists.txt" do you add
"${CMAKE_CURRENT_SOURCE_DIR}" (or anything else which resolves to the
"src" directory) to your include directories?

The line which includes the header is
#include "mapping/..."
but there is no local subdirectory "mapping" relative to that file
(which is down in the mapping/config dir)




On Tue, Aug 1, 2017 at 6:47 AM, Florian Lindner  wrote:
> Hi,
>
> Am 01.08.2017 um 18:32 schrieb David Cole via CMake:
>> What source files include the header?
>
> It's included by src/mapping/config/MappingConfiguration.cpp
>
> https://github.com/precice/precice/blob/develop/src/mapping/config/MappingConfiguration.cpp
>
> https://github.com/precice/precice/blob/develop/src/mapping/PetRadialBasisFctMapping.hpp
>
>> Is one of them listed as a file in your project?
>
> Yes, it's also in the CMakeFiles:
>
> % ll 
> build/cmake-debug/CMakeFiles/precice.dir/src/mapping/config/MappingConfiguration.cpp.o
>
> -rw-r--r-- 1 florian florian 1517472  1. Aug 15:08
> build/cmake-debug/CMakeFiles/precice.dir/src/mapping/config/MappingConfiguration.cpp.o
>
>> Does the **including** file exist at CMake configure time, or is it
>> generated later by a build step?
>
> No, it's a standard plain file.
>
>> What do the lines of code that include the header look like?
>
> #include "mapping/PetRadialBasisFctMapping.hpp"
>
>>
>> CMake uses its own analysis of the source files to determine the
>> depends information, since it needs to generate it without invoking
>> the compiler. This leads to a less-than-100% rate of correctness in
>> the depends information, although usually, it is misses "in the other
>> direction" due to depending on a header file which is included in some
>> conditionally compiled block. (So the typical problem is an extra
>> dependency, not a missing one...)
>
> The header file is (not the including file or the #include itself) is guarded 
> by a define
>
> #ifndef PRECICE_NO_PETSC
>
> which is not set. The build also contains the functionality which is guarded 
> thereof.
>
>> Perhaps passing along the includers and the exact lines and context of
>> being included will give us a hint about why the dependency is not
>> generated properly in your case.
>
> I'm happy to provide whatever information I can.
>
> If you want to download the entire source of the project, tell me. Right now 
> the CMake files are not yet in the
> repository, but I can create a branch and add them there.
>
> My CMake version is 3.8.2.
>
> Best,
> Florian
>
>
>>
>>
>>
>> On Tue, Aug 1, 2017 at 5:18 AM, Florian Lindner  wrote:
>>> Hello,
>>>
>>> on my project, which I'm currently testing with cmake, I just noticed, that 
>>> when I modify a header, the project is not
>>> rebuilt.
>>>
>>> The CMakeLists.txt in the root dir is here: https://pastebin.com/vfReTM1N
>>>
>>> The other CMakeLists.txt resides in root/src and lists all the source 
>>> (*.cpp) files using GLOBS and adds them to the
>>> parent scope:
>>>
>>> set (sourcesAllNoMain ${sourcesAllNoMain} PARENT_SCOPE)
>>> set (sourcesTests ${sourcesTests} PARENT_SCOPE)
>>> set (sourcesTarchTests ${sourcesTarchTests} PARENT_SCOPE)
>>>
>>>
>>> the questionable header file was not added recently, so I don't think its 
>>> related to the GLOBs.
>>>
>>> The header file is also not listed in depends.make file.
>>>
>>> What other information can I give?
>>>
>>> Thanks,
>>> Florian
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at: 
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more 
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at 
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Source is not rebuild when header changes

2017-08-01 Thread David Cole via CMake
What source files include the header?
Is one of them listed as a file in your project?
Does the **including** file exist at CMake configure time, or is it
generated later by a build step?
What do the lines of code that include the header look like?

CMake uses its own analysis of the source files to determine the
depends information, since it needs to generate it without invoking
the compiler. This leads to a less-than-100% rate of correctness in
the depends information, although usually, it is misses "in the other
direction" due to depending on a header file which is included in some
conditionally compiled block. (So the typical problem is an extra
dependency, not a missing one...)

Perhaps passing along the includers and the exact lines and context of
being included will give us a hint about why the dependency is not
generated properly in your case.


HTH,
David C.




On Tue, Aug 1, 2017 at 5:18 AM, Florian Lindner  wrote:
> Hello,
>
> on my project, which I'm currently testing with cmake, I just noticed, that 
> when I modify a header, the project is not
> rebuilt.
>
> The CMakeLists.txt in the root dir is here: https://pastebin.com/vfReTM1N
>
> The other CMakeLists.txt resides in root/src and lists all the source (*.cpp) 
> files using GLOBS and adds them to the
> parent scope:
>
> set (sourcesAllNoMain ${sourcesAllNoMain} PARENT_SCOPE)
> set (sourcesTests ${sourcesTests} PARENT_SCOPE)
> set (sourcesTarchTests ${sourcesTarchTests} PARENT_SCOPE)
>
>
> the questionable header file was not added recently, so I don't think its 
> related to the GLOBs.
>
> The header file is also not listed in depends.make file.
>
> What other information can I give?
>
> Thanks,
> Florian
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] How do I specify VTK minimum version?

2017-07-24 Thread David Cole via CMake
You don't have to ask for a specific version. You can just do:

find_package(VTK REQUIRED)

if you don't really care what version is found.

Or if you need >= 7, you can do it like that and then check what
version was actually found, and error out yourself if it is too old.


HTH,
David C.



On Mon, Jul 24, 2017 at 10:52 AM, Victor Lamoine
 wrote:
> Thank you for the answers.
>
> I used this script to fix my problem:
>
> find_package(VTK 7.1.0 QUIET)
> if (NOT VTK_FOUND)
>   find_package(VTK 8.0.0 REQUIRED)
> endif()
> include(${VTK_USE_FILE})
>
> Of course this will only work until there is a VTK 9.x.x version.
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] CPack install 3rd party shared libraries

2017-07-19 Thread David Cole via CMake
Very nice example. Does CMake have a place to put examples like VTK
does...? If so, where is it? And if not, it would be super useful to
start one somewhere "official."

However, one word of caution on the example. I know it was targeted at
Linux, and perhaps for a very simple case it's proper, but using an
unconditional "local" for everything in a
gp_resolved_file_type_override would not be something you'd want to do
in general, especially on Windows. You would end up with probably on
the order of a hundred (or maybe nowadays even a few hundred) DLLs
from the Windows system directories inside your bundle. Almost
certainly not what you intended.


Cheers,
David C.



On Wed, Jul 19, 2017 at 9:57 AM, Elvis Stansvik
 wrote:
> 2017-07-19 13:42 GMT+02:00 Roman Wüger :
>> The problem with BundleUtilities which Inder is that it doesn't support 
>> generator expressions.
>>
>> Maybe I do something wrong?
>> But I need to specify the path to the executable (generator expression) and 
>> the paths where to look for dependencies. Right?
>
> You don't need to use a generator to fetch the executable path. You
> will know the path, since you installed the executable with
> install(..) :) I think most people essentially hardcode the executable
> path in their call to fixup_bundle(..).
>
> If you really want to, I think there is a way to use generator
> expressions, and that is to put the fixup_bundle(..) call in a
> separate file (say InstallStuff.cmake.in), and then process that file
> with file(GENERATE OUTPUT ...) [1] to produce InstallStuff.cmake with
> generator expressions evaluated and then use install(SCRIPT
> InstallStuff.cmake). But that's much too complicated IMHO, and I would
> avoid it.
>
> I made a minimal example that links against zlib and also the Boost
> library you mentioned:
>
> cmake_minimum_required(VERSION 2.8)
>
> project(bundletest)
>
> find_package(ZLIB REQUIRED)
> find_package(Boost REQUIRED COMPONENTS filesystem)
>
> add_executable(bundletest main.cpp)
>
> target_include_directories(bundletest PRIVATE ${ZLIB_INCLUDE_DIRS}
> ${Boost_INCLUDE_DIRS})
>
> target_link_libraries(bundletest ${ZLIB_LIBRARIES} ${Boost_LIBRARIES})
>
> install(TARGETS bundletest
> RUNTIME DESTINATION "bin"
> )
>
> install(CODE "
> function(gp_resolved_file_type_override resolved_file type_var)
>set(\${type_var} local PARENT_SCOPE)
> endfunction()
> include(BundleUtilities)
> fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/bin/bundletest\" \"\" \"\")
> " COMPONENT Runtime)
>
> main.cpp:
>
> #include 
> #include 
> #include 
>
> using namespace boost::filesystem;
>
> int main (int argc, char *argv[]) {
> // Pretend we're using zlib and Boost
> deflateInit(0, 0);
> std::cout << file_size(argv[1]) << std::endl;
> return 0;
> }
>
> The overriding of the gp_resolved_file_type_override was necessary, to
> make it treat all libraries as local (otherwise it skips "system"
> libraries). See the docs for GetPrerequisites.
>
> Building/installing this with
>
> mkdir build
> cd build
> cmake -DCMAKE_INSTALL_PREFIX=~/bundletest_install ..
> make install
>
> produces:
>
> /home/estan/bundletest_install
> /home/estan/bundletest_install/bin
> /home/estan/bundletest_install/bin/bundletest
> /home/estan/bundletest_install/bin/libm.so.6
> /home/estan/bundletest_install/bin/libstdc++.so.6
> /home/estan/bundletest_install/bin/libc.so.6
> /home/estan/bundletest_install/bin/libz.so.1
> /home/estan/bundletest_install/bin/libpthread.so.0
> /home/estan/bundletest_install/bin/libboost_system.so.1.58.0
> /home/estan/bundletest_install/bin/libgcc_s.so.1
> /home/estan/bundletest_install/bin/libboost_filesystem.so.1.58.0
>
> I did the build on Ubuntu, and tested that it also runs in a clean
> Fedora 24 Docker container.
>
> Hope that helps some.
>
> Elvis
>
> [1] https://cmake.org/cmake/help/v3.9/command/file.html
>
>>
>> Please, could you give me a hint?
>>
>> Regards
>> Roman
>>
>>> Am 19.07.2017 um 12:40 schrieb Elvis Stansvik 
>>> :
>>>
>>> 2017-07-19 10:24 GMT+02:00 Roman Wüger :
 Hello,

 I have a project which depends on a self compiled 3rd party project (boost)
 Boost is here only an example, there are other 3rd party libraries too.

 If I call the "install" command on the target, then it would be packaged.
 But how could I add the shared libraries and especially the links for the 
 shared libraries?

 E.g.:
 libboost_filesystem.so -> libboost_filesystem.so.1.48.0
 libboost_filesystem.so.1.48.0

 Thanks in advance
>>>
>>> I think fixup_bundle() from BundleUtilities is what you want [1].
>>>
>>> We're using it to make our Windows and macOS installs standalone, but
>>> (I think) it should work on Linux as well.
>>>
>>> [1] https://cmake.org/cmake/help/v3.8/module/BundleUtilities.html
>>>

 Best Regards
 Roman
 --

 Powered by www.kitware.com

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

Re: [CMake] Debugging custom commands with VS project generator

2017-06-22 Thread David Cole via CMake
When you convert that error code to hex, it's 0xc139, and if you
google that, you see it's an "entry point not found" error code.

Is something in the custom command trying to load a DLL that doesn't
have the expected export? Or perhaps trying to load a DLL of the wrong
architecture?

Or, there's a missing dependency to one of the DLLs you are loading:
https://stackoverflow.com/questions/1649384/c-debugging-exception-c139

I always convert "/" to "\" when modifying the Windows PATH
environment variable. Does "/" always work? (I noticed the forward
slash is being used in the set PATH statements in your build
output...)


HTH,
David C.



On Thu, Jun 22, 2017 at 6:02 AM, James Turner  wrote:
> Hi,
>
> We’re trying to debug a failure of a custom build command, in a Cmake project 
> using Visual Studio 2015. Unfortunately the command works on some Windows 
> setups but not others - clearly there is something install-dependent going 
> on. (It works on my local machine, but not on our Jenkins build server)
>
> Unfortunately, when the command fails, the only output is:
>
> (CustomBuild target) ->
>   C:\Program Files 
> (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): 
> error MSB6006: "cmd.exe" exited with code -1073741511. 
> [G:\Jenkins\workspace\FlightGear-Win\build32\src\Main\fgfs.vcxproj]
>
>
> (Full log is visible here: 
> http://build.flightgear.org:8080/job/FlightGear-Win/2867/console )
>
> The relevant Cmake file is here:
>
> 
> https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/Main/CMakeLists.txt#l46
>
> Is there any way to get more output from the custom command invocation? Prior 
> to this failure, we had a different issue with missing DLLs, which we fixed 
> by setting PATH via the ‘CMAKE_MSVCIDE_RUN_PATH’ value - this worked fine, so 
> we think the command is running. And the ‘missing DLL’ error was reported + 
> logged clearly in the console, unlike the current failure.
>
> I have tried setting VERBOSE=1 but I expect this doesn’t work with the VS 
> generator? Any other way to get the stdout / stderr of the failing custom 
> command would help.
>
> Kind regards,
> James
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Force target to always run last?

2017-05-18 Thread David Cole via CMake
Hopefully, somebody else doing something similar to what you're doing
will chime in here.

Seems overly complicated from an outsider's perspective.

If what you say is true ...:
"If 'copy_dlls' happens while 'B' is building, then it's possible the
post-build event run by B that deletes the 'libs' directory also
deletes some files copied by 'copy_dlls'"

...then copy_dlls depends on B, because if it runs before or while B
is running, you have problems. So it has to run after.

Seems like you have some untangling to do.



On Thu, May 18, 2017 at 3:42 PM, Robert Dailey  wrote:
> To be clear, I do have a "package" target per real native target.
> However, if I set up the dependencies like so:
>
> Target 'A' depends on 'copy_dlls'
> Target 'A' depends on target 'B'
> Target 'A_package' depends on 'A'
> Target 'A_package' depends on 'copy_dlls'
>
> Furthermore, the add_custom_command() to delete 'libs' and copy the
> *.so is added to 'A' and 'B' (each for their own 'libs' directory and
> their own *.so output)
>
> Then when I do:
>
> $ ninja A_package
>
> The following items are built in any order (due to parallel builds):
>
> * B
> * A (after B)
> * copy_dlls
>
> If 'copy_dlls' happens while 'B' is building, then it's possible the
> post-build event run by B that deletes the 'libs' directory also
> deletes some files copied by 'copy_dlls', which means those files will
> not get packaged when 'A_package' invokes `ant release` for the APK
> packaging.
>
> I hope that makes the issue a little clearer... sorry for the confusion.
>
> On Thu, May 18, 2017 at 1:22 PM, David Cole  wrote:
>> Seems to me the simplest thing to do would be to have copy_dlls depend
>> on nothing, and have package depend on copy_dlls and all the native
>> targets, and then tell your developers to run:
>>
>>   make individualTarget && make package
>>
>> Either that, or introduce a packageIndividualTarget target for each
>> individualTarget.
>>
>> Maybe I just don't understand fully, but why would you ever "make
>> individualTarget" and then expect package to work properly? What if
>> stuff that depends on that individualTarget also needs to rebuild
>> before packaging? Shouldn't you have to do a build all to guarantee
>> that packaging the results works properly?
>>
>>
>>
>>
>>
>>
>> On Thu, May 18, 2017 at 12:16 PM, Robert Dailey
>>  wrote:
>>> So let me go over the problem I'm trying to solve, because it's
>>> possible at this point I'm over-engineering it, but it's hard to fix.
>>>
>>> So my build process is for native shared library targets that
>>> eventually get included in an APK for Android. I'm using the NDK
>>> toolchain to build my native targets. The general flow from nothing to
>>> complete APK is as follows:
>>>
>>> 1. Build all native library targets
>>> 2. Copy native *.so outputs from the CMake build to `libs/armeabi-v7a`
>>> in the android project directory (where the src, res, and other
>>> android directories are located)
>>> 3. Run custom commands that basically invoke 'ant release', and since
>>> I positioned the *.so files under 'libs' they get packaged with the
>>> APK itself.
>>>
>>> This is how I provide support for using CMake to build native, run
>>> java build, and perform APK packaging.
>>>
>>> There's a lot of setup that happens in CMake in order to make sure the
>>> 'ant release' command behaves as expected. I have to handle a few
>>> corner cases:
>>>
>>> * Each new build of the custom target that runs the 'ant release'
>>> command has to only contain the *.so files that were built during that
>>> run
>>> * Various third-party libraries (pre-compiled *.so files) have to also
>>> be copied to libs/armeabi-v7a for only certain android projects,
>>> because we do not want duplicated *.so files across multiple android
>>> libraries (ant release will fail if there are duplicate *.so files
>>> across android project dependencies)
>>>
>>> So given this, my complete pipeline is as follows:
>>>
>>> 1. A `android_clean_libs` custom target is run which iterates all
>>> known native targets with mapped java projects and completely deletes
>>> its 'libs' directory (this is a forced clean prior to building)
>>> 2. A `copy_dlls` target runs next, which copies third party
>>> (precompiled) *.so files to a single common java project, in its
>>> 'libs/armeabi-v7a' directory.
>>> 3. Each native target now builds in parallel, as a post-build event it
>>> copies its output *.so file to its respective libs/armeabi-v7a
>>> directory for packaging.
>>> 4. A final 'package' custom target runs which runs 'ant release' on
>>> the bottom-most android project (that is not a library target by
>>> itself).
>>>
>>> The part I don't like here is step #1. I don't like the clean to
>>> require keeping track of a global property of a list of directories to
>>> remove. Ideally, #1 should run as a post-build event during step 3.
>>> Basically each native target should delete its 'libs' directory prior
>>> to copying its own *.so target to that di

Re: [CMake] Force target to always run last?

2017-05-18 Thread David Cole via CMake
Seems to me the simplest thing to do would be to have copy_dlls depend
on nothing, and have package depend on copy_dlls and all the native
targets, and then tell your developers to run:

  make individualTarget && make package

Either that, or introduce a packageIndividualTarget target for each
individualTarget.

Maybe I just don't understand fully, but why would you ever "make
individualTarget" and then expect package to work properly? What if
stuff that depends on that individualTarget also needs to rebuild
before packaging? Shouldn't you have to do a build all to guarantee
that packaging the results works properly?






On Thu, May 18, 2017 at 12:16 PM, Robert Dailey
 wrote:
> So let me go over the problem I'm trying to solve, because it's
> possible at this point I'm over-engineering it, but it's hard to fix.
>
> So my build process is for native shared library targets that
> eventually get included in an APK for Android. I'm using the NDK
> toolchain to build my native targets. The general flow from nothing to
> complete APK is as follows:
>
> 1. Build all native library targets
> 2. Copy native *.so outputs from the CMake build to `libs/armeabi-v7a`
> in the android project directory (where the src, res, and other
> android directories are located)
> 3. Run custom commands that basically invoke 'ant release', and since
> I positioned the *.so files under 'libs' they get packaged with the
> APK itself.
>
> This is how I provide support for using CMake to build native, run
> java build, and perform APK packaging.
>
> There's a lot of setup that happens in CMake in order to make sure the
> 'ant release' command behaves as expected. I have to handle a few
> corner cases:
>
> * Each new build of the custom target that runs the 'ant release'
> command has to only contain the *.so files that were built during that
> run
> * Various third-party libraries (pre-compiled *.so files) have to also
> be copied to libs/armeabi-v7a for only certain android projects,
> because we do not want duplicated *.so files across multiple android
> libraries (ant release will fail if there are duplicate *.so files
> across android project dependencies)
>
> So given this, my complete pipeline is as follows:
>
> 1. A `android_clean_libs` custom target is run which iterates all
> known native targets with mapped java projects and completely deletes
> its 'libs' directory (this is a forced clean prior to building)
> 2. A `copy_dlls` target runs next, which copies third party
> (precompiled) *.so files to a single common java project, in its
> 'libs/armeabi-v7a' directory.
> 3. Each native target now builds in parallel, as a post-build event it
> copies its output *.so file to its respective libs/armeabi-v7a
> directory for packaging.
> 4. A final 'package' custom target runs which runs 'ant release' on
> the bottom-most android project (that is not a library target by
> itself).
>
> The part I don't like here is step #1. I don't like the clean to
> require keeping track of a global property of a list of directories to
> remove. Ideally, #1 should run as a post-build event during step 3.
> Basically each native target should delete its 'libs' directory prior
> to copying its own *.so target to that directory. However, I can't do
> this because of step #2. Step 2 must happen first, because it's the
> only way I can guarantee that it will execute regardless of which
> target I build (all, or specific target). I make `copy_dlls` a
> dependency of every other target, so it always runs. If I could force
> it to run *last*, then I could simplify step 1.
>
> Sorry if this is too much information or if I've not explained things
> clearly, but I wanted to hash out the details because maybe there is a
> better approach. I'm willing to start from scratch on this if it
> improves the design of the targets.
>
> Thanks again!!
>
>
> On Thu, May 18, 2017 at 10:51 AM, David Cole  wrote:
>> I'm sorry, I misunderstood that you wanted it to run last regardless
>> of what target you are building. I was assuming you wanted it to
>> happen when you build the "all" target. I didn't think you wanted to
>> run it after any other *individual* target which you might specify.
>>
>> I don't know of an easy way to do that. You could add a custom command
>> as a post-build command on every single target, but that seems like it
>> wouldn't work for you either, as it would run the command potentially
>> multiple times, with no way to tell whether you're being called last
>> or not.
>>
>> Sorry.
>>
>> Why does this need to run after the build of any individual target?
>> Why not just say there are two ways to get it to run: build "all" or
>> explicitly build it after you build the other individual thing you
>> want?
>>
>>
>>
>>
>> On Thu, May 18, 2017 at 10:24 AM, Robert Dailey
>>  wrote:
>>> David,
>>>
>>> Thanks for your help. So if I do it as you suggest, this will also
>>> require I specify `ALL` to add_custom_target(), correct? If I do it
>>> this way, will i

Re: [CMake] Force target to always run last?

2017-05-18 Thread David Cole via CMake
I'm sorry, I misunderstood that you wanted it to run last regardless
of what target you are building. I was assuming you wanted it to
happen when you build the "all" target. I didn't think you wanted to
run it after any other *individual* target which you might specify.

I don't know of an easy way to do that. You could add a custom command
as a post-build command on every single target, but that seems like it
wouldn't work for you either, as it would run the command potentially
multiple times, with no way to tell whether you're being called last
or not.

Sorry.

Why does this need to run after the build of any individual target?
Why not just say there are two ways to get it to run: build "all" or
explicitly build it after you build the other individual thing you
want?




On Thu, May 18, 2017 at 10:24 AM, Robert Dailey
 wrote:
> David,
>
> Thanks for your help. So if I do it as you suggest, this will also
> require I specify `ALL` to add_custom_target(), correct? If I do it
> this way, will it still run even if it isn't a dependency of the
> target I'm building?
>
> Let me set up a simple scenario for my own understanding. Suppose I
> have the following targets:
>
> * A (add_library target)
> * B (add_library target)
> * C (add_custom_target target)
>
> Dependencies:
>
> B depends on A
> C depends on B and A
>
> Normally if I build B, only A and B will build. However, if C was set
> up using `ALL`, will it build C when I build B? So the expected build
> order in this case would be:
>
> 1. A
> 2. B
> 3. C
>
> Thanks in advance.
>
> On Wed, May 17, 2017 at 4:26 PM, David Cole  wrote:
>> The way I know how to do this is to add it last at the bottom of the
>> top-level CMakeLists.txt file, and then use add_dependencies to make
>> it depend on all other targets. (Or at least all other "leaf" targets,
>> which further depend on others, ... the sum of which is "all other
>> targets" besides the new "last" target.)
>>
>> So it's not pretty, but it's possible.
>>
>>
>> HTH,
>> David C.
>>
>>
>>
>> On Wed, May 17, 2017 at 11:36 AM, Robert Dailey
>>  wrote:
>>> I have a custom target that must meet the following requirements:
>>>
>>> * It must always run, regardless of what subset of other targets are being 
>>> built
>>> * It must always be the very last thing run. In parallelized builds,
>>> it must wait until all other targets are done building before
>>> starting, so that it is the very last target run, and should not run
>>> in parallel  with others.
>>>
>>> Is this possible? I'm willing to use hackery if needed...
>>>
>>> Running CMake 3.8.0. 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://public.kitware.com/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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Force target to always run last?

2017-05-17 Thread David Cole via CMake
The way I know how to do this is to add it last at the bottom of the
top-level CMakeLists.txt file, and then use add_dependencies to make
it depend on all other targets. (Or at least all other "leaf" targets,
which further depend on others, ... the sum of which is "all other
targets" besides the new "last" target.)

So it's not pretty, but it's possible.


HTH,
David C.



On Wed, May 17, 2017 at 11:36 AM, Robert Dailey
 wrote:
> I have a custom target that must meet the following requirements:
>
> * It must always run, regardless of what subset of other targets are being 
> built
> * It must always be the very last thing run. In parallelized builds,
> it must wait until all other targets are done building before
> starting, so that it is the very last target run, and should not run
> in parallel  with others.
>
> Is this possible? I'm willing to use hackery if needed...
>
> Running CMake 3.8.0. 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://public.kitware.com/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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] How to get message() to go to stdout when executed from -P?

2017-04-10 Thread David Cole via CMake
>From the Windows command line, you would do it with 2>&1 after the command (2 
>is stderr, and 1 is stdout). You could write your custom command as a batch 
>file or bash script (unfortunately platform dependent) which uses this 
>technique with a single command inside the batch file.


HTH,
David C.


> On Apr 10, 2017, at 6:44 PM, Robert Dailey  wrote:
> 
> When I execute a CMake script as a custom command, message() logs are
> not shown in stdout from that script.
> 
> Is there a way to make it pipe out messages?
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] ExternalProject_Add ... output directy (sln file directory)

2017-03-30 Thread David Cole via CMake
Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
 wrote:
> Hi,
>
> I'm currently using one CMakeLists.txt file that will execute an external
> CMakeLists.txt (and dependency).
>
> For this I use the ExternalProject_Add command, but I can't find a way to
> specify where the ".sln" file will be generated.
>
> I have also created StackOverflow question here with more information, if
> someone have an idea for a solution ?
>
> http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder
>
> 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://public.kitware.com/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://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Running test who have two labels?

2017-03-24 Thread David Cole via CMake
Here's a bash script wrapper you could use with existing ctest. Save
it out to a file named ctest-two-labels.sh and then call it with bash
on Mac or Linux:


label1=$1
label2=$2

if [ -z "$label1" ]; then
echo "script takes two label arguments as input, missing arg 1"
exit 1
fi

if [ -z "$label2" ]; then
echo "script takes two label arguments as input, missing arg 2"
exit 2
fi

tmpfile=./ctest-two-labels-sh-tmp.txt
testlistFile=./ctest-two-labels-sh-testlist.txt
testnumsFile=./ctest-two-labels-sh-testnums.txt

ctest -L "^($label1)$" -N > "$tmpfile"
ctest -L "^($label2)$" -N >> "$tmpfile"

cat "$tmpfile" | grep "  Test #" | sort | uniq -d > "$testlistFile"

cat "$testlistFile" | awk -F "#" '{ print $2; }' | awk -F ":" '{ print
$1; }' > "$testnumsFile"

testnums=$(cat "$testnumsFile" | paste -s -d, -)

#echo Tests with both labels $label1 and $label2:
#cat "$testlistFile"
#
#echo Just the test numbers:
#cat "$testnumsFile"
#
#echo The test numbers, assembled into a ctest -I string to run just
those numbered tests:
#echo $testnums

echo Running command line:
echo ""
echo "  ctest -I \"0,0,0,$testnums\" -N"
echo ""
echo Run it without the -N to actually execute the tests...
echo ""

ctest -I "0,0,0,$testnums" -N



It's a "back of the envelope / proof of concept" script. Polish it up
and make it nice if the approach seems reasonable to you.


HTH,
David C.





On Fri, Mar 24, 2017 at 8:08 AM, Eric Noulard  wrote:
>
>
> 2017-03-24 12:30 GMT+01:00 Nils Gladitz :
>>
>> On 03/24/2017 11:50 AM, Eric Noulard wrote:
>>
>>> Hi there,
>>>
>>> I'm playing with ctest LABELS and I wanted to know whether if it is
>>> possible
>>> to run the set of tests which have 2 labels ?
>>>
>>> I manage to have all tests which have **either** L1 or L2:
>>>
>>> ctest -L "L1|L2"
>>>
>>> but how can I write a proper command line for both L1 and L2 ?
>>>
>>> apparently
>>>
>>> ctest -L "L1" -L "L2"
>>>
>>> only takes into account the last -L argument.
>>>
>>
>> I don't think it is possible currently.
>> To a degree you might be able to work around it by creating additional
>> labels that combine the existing ones e.g. "L1", "L2", "L1-L2".
>
>
> Yes of course.
> I do test name mangling but I was hoping for more "classifying" feature with
> labels and was expecting a simple
> OR and AND operation with labels. This is not the case.
>
>
>>
>>
>> I was pondering trying to implement test filtering based on the condition
>> evaluator CMake uses for if()/while() at some point
>> (cmConditionEvaluator.cxx).
>> e.g. --run-tests-if "L1 IN_LIST TEST_LABELS AND L2 IN_LIST TEST_LABELS"
>
>
> It could have been nice but may be overkill my needs.
> A repetable ANDing -L or -LE will do the job.
>
> That said since test filtering is regex-based I simply rediscovered that
> ANDing or negating regex is not easy.
>
> --
> Eric
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Is it possible to run ctest outside build tree?

2017-03-24 Thread David Cole via CMake
If the implementation is "run ctest in this build tree" and it
effectively simply does a "pushd $build_tree", runs, and then "popd",
then I don't see why anybody would object to it.

Although, a script wrapper would be completely trivial, and work with
existing ctest.


D



On Fri, Mar 24, 2017 at 3:11 PM, Eric Noulard  wrote:
> Hi David,
> Thank you for you for checking the code. Would you think adding such a
> command line option would be acceptable upstream?
>
> Le 24 mars 2017 18:43, "David Cole"  a écrit :
>
> This code:
>
> https://github.com/Kitware/CMake/blob/master/Source/ctest.cxx#L139-L157
>
> shows ctest will look for a CTestTestfile.cmake or DartTestfile.txt
> file in the current working directory as soon as it starts. Except in
> the case of processing a "--launch" directive, in which case, it
> dispatches that in the code just above there.
>
> So. I think you have not much choice other than to propose adding a
> new command line argument for such purpose, or wrapping existing ctest
> with your own script or program of some sort.
>
>
> HTH,
> David C.
>
>
>
>
> On Fri, Mar 24, 2017 at 6:04 AM, Eric Noulard 
> wrote:
>> Is possible to run ctest outside the builld tree and how?
>> typical use is when I have an out of source build I may be in the source
>> tree
>> and want to run tests without manually going to build tree.
>>
>> i.e. I currently do:
>>
>> ninja -C /my/build/tree
>>
>> is there a similar way to do that with ctest (other than creating my own
>> script, shell alias etc...)?
>>
>> --
>> Eric
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Is it possible to run ctest outside build tree?

2017-03-24 Thread David Cole via CMake
This code:

https://github.com/Kitware/CMake/blob/master/Source/ctest.cxx#L139-L157

shows ctest will look for a CTestTestfile.cmake or DartTestfile.txt
file in the current working directory as soon as it starts. Except in
the case of processing a "--launch" directive, in which case, it
dispatches that in the code just above there.

So. I think you have not much choice other than to propose adding a
new command line argument for such purpose, or wrapping existing ctest
with your own script or program of some sort.


HTH,
David C.




On Fri, Mar 24, 2017 at 6:04 AM, Eric Noulard  wrote:
> Is possible to run ctest outside the builld tree and how?
> typical use is when I have an out of source build I may be in the source
> tree
> and want to run tests without manually going to build tree.
>
> i.e. I currently do:
>
> ninja -C /my/build/tree
>
> is there a similar way to do that with ctest (other than creating my own
> script, shell alias etc...)?
>
> --
> Eric
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] CMake 3.7.1 gui fails to launch

2017-01-06 Thread David Cole via CMake
Can you use Qt5? CMake 3.7 is typically built using Qt5: perhaps a Qt5
**requirement** has crept in since it's the commonly used one now.


HTH,
David C.



On Fri, Jan 6, 2017 at 10:41 AM,   wrote:
> I'm running Ubuntu 14.04 and I'm trying to get the current version of CMake
> to run.  (The apt-get version is 2.8).
>
> I installed Qt4 (version 4.8.6) with
>
>   $ sudo apt-get install libqt4-core libqt4-dev libqt4-gui qt4-dev-tools
>
> I installed cmake
>
>   $ ./bootstrap & make & sudo make install
>
> all seemed to run without issue.  Running "cmake-gui --version" reported
> version 3.7.1, but running "cmake-gui" failed:
>
> =
> daryl@eve-ldb:~/cmake/cmake-3.7.1$ cmake-gui --version
> cmake version 3.7.1
>
> CMake suite maintained and supported by Kitware (kitware.com/cmake).
> daryl@eve-ldb:~/cmake/cmake-3.7.1$ cmake-gui
> cmake-gui: symbol lookup error: cmake-gui: undefined symbol:
> _ZN9QListData11detach_growEPii
> ==
>
> That looks like a Qt linkage error.  Any suggestions on resolving this?
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] What are the missing features in Ninja that CMake needs?

2016-12-18 Thread David Cole via CMake
This "compare" view on GitHub shows the difference between the
regular/upstream ninja and the Kitware patched ninja:


https://github.com/ninja-build/ninja/compare/master...Kitware:features-for-fortran

The ReadMe explains the high-level view, and says it is gradually
being worked into upstream ninja.

Looks to me like it deals with "implicit dynamically discovered
dependencies" in the Fortran sources. (i.e., you don't have to say in
the build system input what order Fortran files get compiled in, but
the order is important, and CMake analyzes them to figure it out.)

This change probably helps CMake communicate that info to ninja so
things rebuild properly as files get edited.

I can't tell from a quick glance through exactly what the problem
scenarios are, but I bet Brad King can reply with more info --
probably not till January, though. I saw a message from him Friday
signing off until then.


Cheers,
David C.




On Sat, Dec 17, 2016 at 9:24 PM, Daniel Carrera  wrote:
> Hello,
>
> Kitware maintains a separate release of Ninja in order to support Fortran:
>
> https://github.com/Kitware/ninja
>
>
> I kind of want to ask what Kitware changed, but I probably won't understand
> the details. Instead, I was hoping someone could give me a toy example of a
> Fortran program that cannot be compiled without Kitware's changes to Ninja?
>
> Today I tried to compare CMake+Ninja with Meson+Ninja and both were able to
> handle the toy programs that I threw at them. So I haven't found the corner
> of the parameter space that is fixed by Kitware's patches.
>
> Cheers,
> Daniel.
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Prevent ExternalProject from updating git submodules

2016-12-06 Thread David Cole via CMake
If you customize DOWNLOAD_COMMAND, you should also probably customize
UPDATE_COMMAND. If you are just using a fixed snapshot from some repo,
consider simply using a *.tar.gz snapped to that commit rather than
connecting to the repo at all. The GitHub "/archive/" URLs are perfect
for this.

However, if you are still going to use some sort of git command for
DOWNLOAD_COMMAND, just use:

UPDATE_COMMAND ""

to prevent any git commands from running after the download step.

By the way, it's unclear to me: are you just trying to get something
to work for your project, or are you saying there's a bug in CMake
that needs to be dealt with regardless of what you do for your
project. The repo-based ExternalProject stuff assumes online status is
readily available... If that's not true, you shouldn't use the
repo-based ExternalProject stuff and instead use a "download
everything once to a local spot" and then thereafter use the local
stuff.


HTH,
David C.




On Sun, Dec 4, 2016 at 9:47 PM, Timothy Rae  wrote:
> I finally got a chance to try David's suggestion out, but unfortunately that
> doesn't work. I think the ExternalProject script is downloading the
> submodules in a separate step rather than via the "git clone --recursive"
> command.
>
> I simply mentioned the recursive clone as a way to reproduce the issue. You
> could also just set a local filesystem path as the GIT_REPOSITORY and
> disable the internet to reproduce:
>
> 1) git clone https://github.com/ericniebler/range-v3.git LOCAL_CLONE_DIR
> 2) Add ExternalProject_Add(range-v3 GIT_REPOSITORY LOCAL_CLONE_DIR) to a
> project
> 3) Disable the internet
> 4) Attempt to build
>
> ** Watch it hang, and you have to ctrl+c to exit **
>
>
> On 25/10/16 22:12, David Cole wrote:
>>
>> Sounds like you should consider customizing the git clone with
>> DOWNLOAD_COMMAND. You can do anything you want as a customization...
>>
>> HTH,
>> David
>>
>>
>> On Oct 24, 2016, at 11:35 PM, Timothy Rae > > wrote:
>>
>>> Thanks for the tip, but I'd rather it didn't fetch the documentation
>>> submodule at all, as this unnecessarily slows down the build.
>>>
>>> On Tue, Oct 25, 2016 at 12:29 PM, Hendrik Sattler
>>> mailto:p...@hendrik-sattler.de>> wrote:
>>>
>>> Hi,
>>>
>>> you can tell git where your copy of tree remote url is. This is
>>> site-specific and does not change the repository:
>>> git config remote."$origirl".url "$newurl"
>>>
>>> HS
>>>
>>>
>>> Am 25. Oktober 2016 03:52:12 MESZ, schrieb Tim Rae
>>> mailto:timothy@sbibits.com>>:
>>>
>>> >Hi all,
>>> >
>>> >I'm using ExternalProject_Add to add the popular C++ library
>>> range-v3
>>> >to
>>> >one of our projects. However, since the build server only has local
>>> >intranet access, and therefore can't access the main github
>>> repository,
>>> >
>>> >we have put a clone of that repo on our local gitlab:
>>> >
>>> >ExternalProject_Add(range-v3
>>> > PREFIX ${PREFIX_DIR}
>>> > GIT_REPOSITORY ${LOCAL_GITLAB_URI}
>>> >)
>>> >
>>> >The problem is that range-v3 has a documentation submodule that
>>> points
>>> >to github, so `git clone ${LOCAL_GITLAB_URI} --recursive` would fail
>>> >when github is inaccessible, whereas git clone works fine without
>>> the
>>> >recursive flag.
>>> >
>>> >I found a previous message from Tim Gallagher on the mailing list
>>> >reporting the same problem, but it looks like the issue was never
>>> >addressed upstream.
>>> >
>>> >https://cmake.org/pipermail/cmake/2015-March/060100.html
>>> 
>>> >
>>> >Unfortunately, specifying GIT_SUBMODULES "" will add all
>>> submodules, so
>>> >
>>> >it doesn't appear that variable will help to solve the issue. I
>>> would
>>> >suggest either having a special value like "__NONE__", or having
>>> a new
>>> >boolean variable like INIT_GIT_SUBMODULES; either of which can be
>>> used
>>> >to disable the automatic initialization of submodules entirely.
>>> >
>>> >You could also change the default to NOT pull in submodules. This
>>> would
>>> >
>>> >be much better IMHO, as the current behavior is unintuitive. Most
>>> >developers (e.g. myself until yesterday) don't even know what a
>>> >submodule is, and are only familiar with using git clone, as
>>> opposed to
>>> >
>>> >git clone --recursive. Obviously this would be a breaking change
>>> >though,
>>> >so I understand that you probably don't want to go with this option.
>>> >
>>> >For now I have "solved" the problem by adding a new commit to our
>>> >range-v3 fork removing all git submodules, however this makes it
>>> more
>>> >difficult to get the upstream changes in, so I highly recommend
>>> adding
>>> >an option to disable the automatic initialization of git submodules.

Re: [CMake] Determine which files have changed during a CMake run

2016-11-23 Thread David Cole via CMake
Using git like that is actually the perfect way to do it if you just want
to analyze it manually. I've actually done that with other projects source
trees when something seems to appear there even when doing an out of source
build... It's a great way to see what's changed (and how) easily.

You could also write a CMake script that iterates files in the build
directory, and uses IS_NEWER in conjunction with a reference file touched
just prior to running CMake if you need to generate a report like this
frequently for some reason.

HTH,
David C.


On Wednesday, November 23, 2016, Michael Jackson <
mike.jack...@bluequartz.net> wrote:

> Is there a way to determine which files in my build directory have changed
> for a given run of CMake? The use case is that I made what I thought was a
> small change to my configuration using cmake and when I went to build it
> was basically a full recompile. During our cmake run we do use
> configure_file(...) to generate headers and sources some of which basically
> get included in every source file. I am thinking that I have a dependency
> on generating those files when I probably do not have to.
>
> I use Ninja as my build system if that helps. I could always just hack a
> local git repo for the build folder, commit everything, run cmake and see
> what got changed. Anybody have a better idea?
>
> Thanks
>
> --
> Mike Jackson  [mike.jack...@bluequartz.net]
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Prevent ExternalProject from updating git submodules

2016-10-25 Thread David Cole via CMake
Sounds like you should consider customizing the git clone with 
DOWNLOAD_COMMAND. You can do anything you want as a customization...

HTH,
David


> On Oct 24, 2016, at 11:35 PM, Timothy Rae  wrote:
> 
> Thanks for the tip, but I'd rather it didn't fetch the documentation 
> submodule at all, as this unnecessarily slows down the build.
> 
>> On Tue, Oct 25, 2016 at 12:29 PM, Hendrik Sattler  
>> wrote:
>> Hi,
>> 
>> you can tell git where your copy of tree remote url is. This is 
>> site-specific and does not change the repository:
>> git config remote."$origirl".url "$newurl"
>> 
>> HS
>> 
>> 
>> Am 25. Oktober 2016 03:52:12 MESZ, schrieb Tim Rae :
>> >Hi all,
>> >
>> >I'm using ExternalProject_Add to add the popular C++ library range-v3
>> >to
>> >one of our projects. However, since the build server only has local
>> >intranet access, and therefore can't access the main github repository,
>> >
>> >we have put a clone of that repo on our local gitlab:
>> >
>> >ExternalProject_Add(range-v3
>> > PREFIX ${PREFIX_DIR}
>> > GIT_REPOSITORY ${LOCAL_GITLAB_URI}
>> >)
>> >
>> >The problem is that range-v3 has a documentation submodule that points
>> >to github, so `git clone ${LOCAL_GITLAB_URI} --recursive` would fail
>> >when github is inaccessible, whereas git clone works fine without the
>> >recursive flag.
>> >
>> >I found a previous message from Tim Gallagher on the mailing list
>> >reporting the same problem, but it looks like the issue was never
>> >addressed upstream.
>> >
>> >https://cmake.org/pipermail/cmake/2015-March/060100.html
>> >
>> >Unfortunately, specifying GIT_SUBMODULES "" will add all submodules, so
>> >
>> >it doesn't appear that variable will help to solve the issue. I would
>> >suggest either having a special value like "__NONE__", or having a new
>> >boolean variable like INIT_GIT_SUBMODULES; either of which can be used
>> >to disable the automatic initialization of submodules entirely.
>> >
>> >You could also change the default to NOT pull in submodules. This would
>> >
>> >be much better IMHO, as the current behavior is unintuitive. Most
>> >developers (e.g. myself until yesterday) don't even know what a
>> >submodule is, and are only familiar with using git clone, as opposed to
>> >
>> >git clone --recursive. Obviously this would be a breaking change
>> >though,
>> >so I understand that you probably don't want to go with this option.
>> >
>> >For now I have "solved" the problem by adding a new commit to our
>> >range-v3 fork removing all git submodules, however this makes it more
>> >difficult to get the upstream changes in, so I highly recommend adding
>> >an option to disable the automatic initialization of git submodules.
>> >
>> >Best regards,
>> >Tim
>> >
>> >--
>> >*This correspondence (including any attachments) is for the intended
>> >recipient(s) only. It may contain confidential or privileged
>> >information or
>> >both. No confidentiality or privilege is waived or lost by any
>> >mis-transmission. If you receive this correspondence by mistake, please
>> >
>> >contact the sender immediately, delete this correspondence (and all
>> >attachments) and destroy any hard copies. You must not use, disclose,
>> >copy,
>> >distribute or rely on any part of this correspondence (including any
>> >attachments) if you are not the intended recipient(s). 本
>> >メッセージに記載および添付されている情報 (以 下、総称して「本情報」といいます。)は、本来の受信者による使用のみを 意
>> >図しています。誤送信等により
>> >本 情報を取得された場合でも、本情報に係る 秘 密、または法律上の秘匿特権が失われるものではありません。本電子メールを 受
>> >取られた方が、本来の受
>> >信者ではない場合には、本情報及びそのコピー すべ てを削除・破棄し、本電子メールが誤って届い た旨を発信者宛てにご通知下さい ま
>> >すようお願いしま
>> >す。本情報の閲覧、発信または本情報に基づく いかなる行 為も明確に禁止されていることをご了承くださ い。*
>> >--
>> >
>> >Powered by www.kitware.com
>> >
>> >Please keep messages on-topic and check the CMake FAQ at:
>> >http://www.cmake.org/Wiki/CMake_FAQ
>> >
>> >Kitware offers various services to support the CMake community. For
>> >more information on each offering, please visit:
>> >
>> >CMake Support: http://cmake.org/cmake/help/support.html
>> >CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> >CMake Training Courses: http://cmake.org/cmake/help/training.html
>> >
>> >Visit other Kitware open-source projects at
>> >http://www.kitware.com/opensource/opensource.html
>> >
>> >Follow this link to subscribe/unsubscribe:
>> >http://public.kitware.com/mailman/listinfo/cmake
>> 
>> --
>> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
>> 
> 
> 
> This correspondence (including any attachments) is for the intended 
> recipient(s) only. It may contain confidential or privileged information or 
> both. No confidentiality or privilege is waived or lost by any 
> mis-transmission. If you receive this correspondence by mistake, please 
> contact the sender immediately, delete this correspondence (and all 
> attachments) and destroy any hard copies. You must not use, disclose, copy, 
> distribute or rely on any part of this correspondence (including any 
> attachments) if you are not the intended recip

Re: [CMake] Force copy of files

2016-10-14 Thread David Cole via CMake
"copy" should always overwrite.

"copy_if_different" will conditionally overwrite, only if the contents
of the two files are different.

If "copy" was not overwriting something when it should have been,
please send steps to reproduce the issue, because that would be a bug.


HTH,
David C.



On Fri, Oct 14, 2016 at 1:47 PM, Aaron Boxer  wrote:
> Never mind, figured this one out:
>
> use copy_if_different
>
> On Fri, Oct 14, 2016 at 1:34 PM, Aaron Boxer  wrote:
>>
>> I have the following lines in my cmake file
>>
>>
>> foreach(f ${MyFiles})
>>   add_custom_command(TARGET ${OPENJPEG_PLUGIN_NAME} PRE_BUILD
>>  COMMAND ${CMAKE_COMMAND} -E
>>  copy ${f} $)
>> endforeach()
>>
>> in order to copy MyFiles to MyFolder.
>>
>>
>> If these files already exist, I would like copy to overwrite the old file.
>> Is there a flag to pass to copy to force this to overwrite?
>>
>> Thanks!
>> Aaron
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Windows Visual Studio 13 with Ninja & CMake

2016-09-22 Thread David Cole via CMake
Does it work if you launch cmake-gui from the command prompt that
works for your "from the command line" scenario?

On Thu, Sep 22, 2016 at 1:58 PM, Michael Jackson
 wrote:
> My combination is Windows 10 (Anniversary Update), Visual Studio 12 2013
> Update 5, Ninja and CMake 3.5/3.6.
>
> I launch CMake-GUI.exe, select my Source and binary directories and then
> "Configure", select "Ninja" as the generator and then I instantly get the
> error that CMake can not find the C/C++ compilers. I do not recall ever
> having this issue. I just recently updated Windows 10 to the latest so I am
> not sure if that caused something to go wrong? I use the "Zipped" version of
> CMake if that makes a difference. I did have to install the "Windows 8.1
> SDK" in order for QtCreator to work correctly.
>
> I can successfully do the following:
> * Configure and generate from the command line for Ninja
> * Use the CMake-Gui to generate a VS 12 2013 solution file without any
> issues.
> * QtCreator 4.1 can use ninja to properly generate its own projects with a
> correctly detected compiler.
>
> Thoughts?
> --
> Michael A. Jackson
> BlueQuartz Software
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] How to codesign .msi from WIX/CPack?

2016-09-07 Thread David Cole via CMake
There may be a hook at the CPack level you can implement, but I'd have to dig 
to figure out what it is and if it even presently exists.

The easy thing to do would be to implement a custom target which does two 
custom commands: the first the same as CPack (the built-in package target) and 
the second, a custom command to sign the generated .msi file.


David

> On Sep 6, 2016, at 7:52 PM, Eric Wing  wrote:
> 
> I'm finally trying the WIX/CPack MSI generator. Pretty nice!
> 
> One thing I need to do is instruct the build process to codesign via
> signtool.exe. I've managed to figure out how to codesign my .exe via a
> POST_BUILD add_custom_command step.
> 
> But now I would like to make sure the .msi that gets generated also
> gets code signed. But I can't figure out how to do it.
> 
> 
> I seem to need at least two things:
> 
> 1) A post-build hook into the PACKAGE target (add_custom_command
> doesn't seem to do anything when I try to refer to this target).
> 
> 2) The name and location of the .msi that CPack/WIX generated so I can
> refer to it with the signtool command.
> 
> 
> Any advice?
> 
> Thanks,
> Eric
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Windows path too long

2016-09-07 Thread David Cole via CMake
I suppose the obvious "use shorter paths and names" is not possible or hard to 
enforce?


David


> On Sep 7, 2016, at 2:55 AM, Robert Bielik  wrote:
> 
> I have a problem with a VS 2015 project, where the build state path becomes 
> too long:
> 
> SeverityCodeDescriptionProjectFileLineSuppression 
> State
> ErrorMSB3491Could not write lines to file 
> "processor_withAVeryVeryLongName.dir\Release\processo.92BD73FC.tlog\processor_withAVeryVeryLongName.lastbuildstate".
>  The specified path, file name, or both are too long. The fully qualified 
> file name must be less than 260 characters, and the directory name must be 
> less than 248 characters.processor_withAVeryVeryLongNameC:\Program 
> Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets312
> 
> The line in Microsoft.CppBuild.targets is:
> 
>  Lines="$(ProjectStateLine);$(ProjectEvaluationFingerprint)"/>
> 
> I've set CMAKE_OBJECT_PATH_MAX to 240, but I don't think it will affect 
> this...
> 
> Ideas ?
> 
> This is with CMake 3.5.2.
> 
> Regards
> /Robert
> 
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Setup/tear down steps for CTest

2016-08-21 Thread David Cole via CMake
The best thing to do would be to add the feature to ctest, and
contribute to the CMake community.

I, too, use the "run this test first" and "that test last" technique,
and set up DEPENDS property values to ensure ordering when all tests
are run in parallel. However, as you noted, this does not work to run
subsets of tests reliably. For me, I am able to live with the partial
solution because the vast majority of my tests can be run
independently anyhow and we usually do run all the tests, but a setup
/ teardown step for the whole suite would be a welcome addition to
ctest.

Looking forward to your patch... :-)


David C.


On Sat, Aug 20, 2016 at 8:32 PM, Craig Scott  wrote:
> Let's say a project defines a bunch of tests which require setup and tear
> down steps before/after all the tests are run (not each individual test, I'm
> talking here about one setup before all tests are run and one tear down
> after all tests have finished). While this could be done by a script driving
> CTest itself, it is less desirable since different platforms may need
> different driver scripts and this seems like something CTest should be able
> to handle itself (if the setup/tear down steps use parts of the build, that
> only strengthens the case to have them handled by CMake/CTest directly).
>
> It is possible to abuse the DEPENDS test property and define setup and tear
> down "tests" which are not really tests but which perform the necessary
> steps. While this mostly works, it is not ideal and in particular it doesn't
> work with CTest's --rerun-failed option. I'm wondering if there's currently
> a better way of telling CMake/CTest about a setup step which must be run
> before some particular set of test cases and a tear down step after they are
> all done. The tear down step needs to be performed regardless of whether any
> of the real test cases pass or fail.
>
> The motivating case is to start up and shutdown a service which a (subset
> of) test cases need running. That service is expensive to set up and hence
> it isn't feasible to start it up and shut it down for every test case
> individually.
>
> Any ideas?
>
> --
> Craig Scott
> Melbourne, Australia
> http://crascit.com
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] howto retrigger check_function_exists

2016-08-18 Thread David Cole via CMake
The code is not meant to be called. The "require += info_size" line is
to keep compiler optimizations from stripping out the info_size string
variable from the final executable.

This code is simply built, and then the resulting binary is scanned
for the string "INFO:size[],key[]" and then the string
analyzed to pull out the size

Does that make sense?


D



On Thu, Aug 18, 2016 at 3:24 PM, J Decker  wrote:
> I don't understand how this works
>
> info_size[1] will return 'N'
> how will it know it has to pass like 14 arguments to get the right
> character?  And even then the character '4' is not the value 4.
>
>
>
> - this is the code generated for check_type_size
>
> #include 
> #include 
> #include 
> #include "time.h"
>
>
> #undef KEY
> #if defined(__i386)
> # define KEY '_','_','i','3','8','6'
> #elif defined(__x86_64)
> # define KEY '_','_','x','8','6','_','6','4'
> #elif defined(__ppc__)
> # define KEY '_','_','p','p','c','_','_'
> #elif defined(__ppc64__)
> # define KEY '_','_','p','p','c','6','4','_','_'
> #endif
>
> #define SIZE (sizeof(time_t))
> char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
>   ('0' + ((SIZE / 1)%10)),
>   ('0' + ((SIZE / 1000)%10)),
>   ('0' + ((SIZE / 100)%10)),
>   ('0' + ((SIZE / 10)%10)),
>   ('0' +  (SIZE% 10)),
>   ']',
> #ifdef KEY
>   ' ','k','e','y','[', KEY, ']',
> #endif
>   '\0'};
>
> #ifdef __CLASSIC_C__
> int main(argc, argv) int argc; char *argv[];
> #else
> int main(int argc, char *argv[])
> #endif
> {
>   int require = 0;
>   require += info_size[argc];
>   (void)argv;
>   return require;
> }
>
>
>
>
>
>
> On Thu, Aug 18, 2016 at 11:50 AM, J Decker  wrote:
>>
>> I was trying to add some libraries for CMAKE_REQUIRED_LIBRARIES to be able
>> to find more symbols, but changing that didn't cause the
>> check_function-0exists to re-run; is there a shorter way to get it to re-run
>> without deleting CMakeCache.txt?
>> I'm not abject to manually editing files; I had tried to remove just the
>> cached variable reference, but that didn't help.
>>
>> Same for check_type_size() I guess
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


[CMake] cmp0065

2016-07-06 Thread David Cole via CMake
Seems like you ought to be able to avoid this warning just by setting
ENABLE_EXPORTS to 0 or 1 ... If you're going to require 3.0, then use 3.0.
If you're going to use 3.5, then add the property to squelch the warning
and get the behavior you want.


D


On Wednesday, July 6, 2016, J Decker  wrote:

>
> M:/tmp/cmake_cmp0065/CMakeLists.txt(1):  cmake_minimum_required(VERSION
> 3.0 )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(2):  project(cmake-test )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(3):  add_executable(myExe main.c )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(4):  target_compile_definitions(myExe
> PRIVATE MY_DEFINITION )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(5):  target_compile_definitions(myExe
> PRIVATE VERSION_STRING="0.8.15" )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(6):  set(project myExe )
>
> -- Configuring done
> CMake Warning (dev) in CMakeLists.txt:
>   Policy CMP0065 is not set: Do not add flags to export symbols from
>   executables without the ENABLE_EXPORTS target property.  Run "cmake
>   --help-policy CMP0065" for policy details.  Use the cmake_policy command
> to
>   set the policy and suppress this warning.
>
>   For compatibility with older versions of CMake, additional flags may be
>   added to export symbols on all executables regardless of thier
>   ENABLE_EXPORTS property.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- Generating done
> -- Build files have been written to: M:/tmp/cmake_cmp0065/build
>
> ---
> you have cmake_minimum_required(VERSION 3.5 ) in your example... setting
> 3.0 instead and adding --trace shows the warning...
>
> -
> then command you said to use is doing exactly the same thing I'm doing to
> the same target property... of course it should generate the same
> result and it does.
>
>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] cmp0065

2016-07-06 Thread David Cole via CMake
Seems like you ought to be able to avoid this warning just by setting
ENABLE_EXPORTS to 0 or 1 ... If you're going to require 3.0, then use 3.0.
If you're going to use 3.5, then add the property to squelch the warning
and get the behavior you want.


D


On Wednesday, July 6, 2016, J Decker  wrote:

>
> M:/tmp/cmake_cmp0065/CMakeLists.txt(1):  cmake_minimum_required(VERSION
> 3.0 )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(2):  project(cmake-test )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(3):  add_executable(myExe main.c )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(4):  target_compile_definitions(myExe
> PRIVATE MY_DEFINITION )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(5):  target_compile_definitions(myExe
> PRIVATE VERSION_STRING="0.8.15" )
> M:/tmp/cmake_cmp0065/CMakeLists.txt(6):  set(project myExe )
>
> -- Configuring done
> CMake Warning (dev) in CMakeLists.txt:
>   Policy CMP0065 is not set: Do not add flags to export symbols from
>   executables without the ENABLE_EXPORTS target property.  Run "cmake
>   --help-policy CMP0065" for policy details.  Use the cmake_policy command
> to
>   set the policy and suppress this warning.
>
>   For compatibility with older versions of CMake, additional flags may be
>   added to export symbols on all executables regardless of thier
>   ENABLE_EXPORTS property.
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> -- Generating done
> -- Build files have been written to: M:/tmp/cmake_cmp0065/build
>
> ---
> you have cmake_minimum_required(VERSION 3.5 ) in your example... setting
> 3.0 instead and adding --trace shows the warning...
>
> -
> then command you said to use is doing exactly the same thing I'm doing to
> the same target property... of course it should generate the same
> result and it does.
>
>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] execute_process, cmd /c and vcvarsall

2016-06-10 Thread David Cole via CMake
The easiest way to do what you want here is to make a standalone
script (*.bat / *.cmd) that runs the commands you want and get it to
work without CMake involvement at all, and then simply use
execute_process to invoke that script.

You can pass arguments to it if you need to communicate information
from CMake to the script, but if you **require** environment for your
command to run, the easiest way to achieve it is to write a script
that sets up the env, and then executes the command, and then restores
the environment (if necessary).

In Windows *.cmd files, it's easy to save/restore the environment by
using "setlocal" and "endlocal".

Why bother with all the escaping and special characters in an
execute_process when you could just write a script and then call it?
It will be much easier on the eyes for people having to read your code
in the future if you make it simpler.


HTH,
David C.




On Fri, Jun 10, 2016 at 6:21 AM, Kristian  wrote:
> After some tries I found maybe a solution for you. In my small example, I
> had these lines, which are working:
>
>
>> set(HELLO1 "C:/Program Files (x86)/Microsoft Visual Studio
>> 14.0/VC/vcvarsall.bat")
>> execute_process(COMMAND ${HELLO1} && msbuild /help WORKING_DIRECTORY
>> "${CMAKE_CURRENT_SOURCE_DIR}")
>
> So for you, it would look like this (I am not very sure about it):
>
> ==
>
>
> execute_process( COMMAND
> $ENV{VS${VS_IDE_VERSION}0COMNTOOLS}../../VC/vcvarsall.bat x86_amd64 &&
> ${CUDA_NVCC_EXECUTABLE}
> ${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu --run
>
>  WORKING_DIRECTORY
> "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
>
>  RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
>
>  OUTPUT_STRIP_TRAILING_WHITESPACE)
>
>
> ==
>
> Anyhow, when I tried several types of your presentation, I got always some
> errors. I do not know, if this is a bug or not, but I will write them down
> here. Maybe some of the others could write something about it.
>
>
> *** First try ***
>
>> set(HELLO1 "C:/Program Files (x86)/Microsoft Visual Studio
>> 14.0/VC/vcvarsall.bat")
>> execute_process(COMMAND cmd /c "call ${HELLO1}" WORKING_DIRECTORY
>> "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE
>> _nvcc_out)
>> message("${_nvcc_out}")
>
> When I call these lines on a windows machine, I am getting the error
>
>> 'C:/Program' is not recognized as an internal or external command,
>> operable program or batch file.
>
> *** Second try ***
>
> When I change the execute_process to this
>
>> execute_process(COMMAND cmd /c "call \"${HELLO1}\"" WORKING_DIRECTORY
>> "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE
>> _nvcc_out)
>
> then I am getting this error
>
>> '\"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat\"'
>> is not recognized as an internal or external command, operable program or
>> batch file.
>
> So now, CMake / Batch recognizes the right path, but somehow there are the
> characters \".
>
> *** Third try ***
>
> I changed the definition of the variable HELLO1 into (because of some hints
> here
> https://superuser.com/questions/279008/how-do-i-escape-spaces-in-command-line-in-windows-without-using-quotation-marks)
>
>> set(HELLO1 "C:/Program^ Files^ (x86)/Microsoft^ Visual^ Studio^
>> 14.0/VC/vcvarsall.bat")
>
> But here, I am also getting the error
>
>> 'C:/Program' is not recognized as an internal or external command,
>> operable program or batch file.
>
> Even, when I double the carets ^^, then the same error occurs
>
>
> 2016-06-09 22:41 GMT+02:00 Adam Rankin :
>>
>> Hello all,
>>
>>
>>
>> I am trying to develop a execute_process command that will first load the
>> env variables set by the appropriate vcvarsall, and then run a compile
>> command. See here for my progress so far:
>>
>>
>>
>> set(cuda_generation_command cmd /c "\"call
>> \"$ENV{VS${VS_IDE_VERSION}0COMNTOOLS}../../VC/vcvarsall.bat\" x86_amd64 &&
>> \"${CUDA_NVCC_EXECUTABLE}\"
>> \"${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu\" \"--run\"\"")
>>
>>
>>
>> execute_process( COMMAND ${cuda_generation_command}
>>
>>  WORKING_DIRECTORY
>> "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
>>
>>  RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
>>
>>  OUTPUT_STRIP_TRAILING_WHITESPACE)
>>
>>
>>
>> When run at a command prompt, the command works as expected. When called
>> from CMake, the output is:
>>
>> The filename, directory name, or volume label syntax is incorrect.
>>
>>
>>
>> Has anyone ever succeeded with something like this?
>>
>>
>>
>> Cheers,
>>
>> Adam
>>
>>
>> --
>>
>> 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
>> 

Re: [CMake] How to use CMAKE_MFC_FLAG for only one on executables?

2016-06-01 Thread David Cole via CMake
Or just isolate it into its own CMakeLists.txt file in a sub-directory?

On Wed, Jun 1, 2016 at 8:34 AM, Nicholas Braden
 wrote:
> Have you tried unsetting it after adding the executable in question?
> If that doesn't work, is it possible to make the MFX executable be the
> very last executable added in your project?
>
> On Wed, Jun 1, 2016 at 4:50 AM, Zhang Peixuan  
> wrote:
>> Hello All,
>>
>> I want to use CMake to manage my MFC projects, and I added the following
>> code:
>>
>> set( CMAKE_MFC_FLAG 2)
>> add_executable(MFCDemo WIN32
>> ${MFC_RESOURCE_FILES}
>> ${MFC_HEADER_FILES}
>> ${MFC_SOURCE_FILES}
>> )
>> target_compile_definitions(MFCDemo
>> PUBLIC -D_AFXDLL=1
>> PUBLIC -D_UNICODE
>> PUBLIC -DUNICODE
>> )
>>
>> It works.
>> However, my question is that: In addition to the MFC executable, I still
>> have some non-MFC executables,
>> and once CMAKE_MFC_FLAG is set, all the add_executables' property should be
>> "Use MFC in a Shared DLL".
>> In fact, I want only one MFC executable, and make sure all other executables
>> are "Use Standard Windows Library".
>> Is there any way to implement it? It seems CMAKE_MFC_FLAG does not work with
>> set_target_property or other commands.
>>
>> Thanks,
>> Peixuan Zhang
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] how to add custom command/step to ExternalProject_Add ?

2016-04-08 Thread David Cole via CMake
This file has an example use which executes after download and before configure:

https://github.com/Kitware/CMake/blob/master/Tests/ExternalProjectLocal/CMakeLists.txt


HTH,
David C.


> On Apr 8, 2016, at 6:39 PM, jagernico...@legtux.org wrote:
> 
> Hi,
> 
> my question is related to : 
> http://stackoverflow.com/questions/36506300/using-autogen-sh-with-externalproject-add
> 
> I have to use ExternalProject_Add to compile 
> https://github.com/fukuchi/libqrencode as a gitmodule, it requires to run 
> autogen.sh before running configure.
> 
> I don't understand how to use ExternalProject_Add_Step to add a step before 
> CONFIGURE_COMMAND.
> 
>  
> 
> regards,
> 
> Nicolas
> 
>  
> 
>  
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Two phase install?

2016-03-24 Thread David Cole via CMake
Are you running a dashboard script (ctest -S script) when this
happens? Or calling ctest directly with other arguments?

If you are running a -S script, you can specify the configuration to
build and test in the script itself with the CTEST_CONFIGURATION_TYPE
script variable. Read the docs here on the ctest_build and ctest_test
steps: https://cmake.org/cmake/help/v3.5/manual/ctest.1.html#ctest-build-step

The ctest_build command also takes a "CONFIGURATION" argument
directly, but surprisingly, the ctest_test command does not seem to
have that arg. https://cmake.org/cmake/help/v3.5/command/ctest_build.html
and https://cmake.org/cmake/help/v3.5/command/ctest_test.html

If you're not calling a -S script, I'm not sure how else you can do it
besides passing "-C Release" on the command line...


HTH,
David C.



On Thu, Mar 24, 2016 at 2:09 PM, Scott Aron Bloom  wrote:
>
>
> -Original Message-
> From: Hendrik Sattler [mailto:p...@hendrik-sattler.de]
> Sent: Thursday, March 24, 2016 3:54 AM
> To: Alan W. Irwin; Scott Aron Bloom
> Cc: cmake@cmake.org
> Subject: Re: [CMake] Two phase install?
>
>
>
> Am 24. März 2016 10:14:40 MEZ, schrieb "Alan W. Irwin" 
> :
>>On 2016-03-24 03:59- Scott Aron Bloom wrote:
>>
>>> That method does NOT work with windows...  And since the visual
>>studio project has the external as a single command, (not sure if its
>>calling nmake or the new build cmd) the proeject is not run in
>>parallel.
>>
>>I am pretty sure ExternalProject_Add only works with generators
>>associated with build commands you can run from the command line such
>>as make, nmake, jom, ninja, etc..  So, for MSVC the way you arrange
>>that is avoid all the visual studio generators, and instead use one of
>>"NMake Makefiles", "NMake Makefiles JOM", or "Ninja".
>
> No. Just as with cmake-generated solutions, you can build those on the 
> command line using msbuild or devenv, the one used by cmake depends on the 
> cmake version. You can even use cmake itself to trigger the right build 
> command for those. Parallel building must be enabled by hand when using 
> msbuild. For devenv, the setting from the IDE is used.
>
> HS
> 
>
> The final hurdle Im hitting.  When ctest is run, on windows I get the 
> complaint that the configuration is not set.
>
> Is there any way to set the -C option to ctest?
>
> Scott
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-19 Thread David Cole via CMake
A multiple folder approach will be very difficult.

The basic assumptions are:

- On Windows, the "one executable path" is the destination path to
which to copy all of the DLLs that need to be copied, so they all end
up in the same directory. (You'd have to have multiple copies in
multiple locations, at which point, it probably makes sense to have
each of your exes set up to use a common shared DLL folder instead.)

- On Mac, the "one executable path" is used to fixup libraries to use
"@executable_path" relative references, so it's different for each
different exe path. If two executables depend on the same library, but
are in different places, but the library is only in one place, then
you cannot use an "@executable_path" relative reference to find the
library.

If all your executables are not in the same directory with each other,
then BundleUtilities will probably not make you a happy camper.


HTH,
David C.



On Fri, Mar 4, 2016 at 9:30 AM, Benjamin Ballet  wrote:
> FYI verifying_app failed with main.exe failed (3.4.3) because toptool
> depends on topdool.dll located only in toptoolfolder. The workaround is to
> include toptoolfolder in libs folder for fixup_bundle(main.exe...)
>
> David your answer was helpful to me. I know it's an expected behavior.
>
> Would a patch handling such multiple folder application been accepted ? I
> may try to work on it, since I either have to work on the workarounds or a
> nice improvment.
>
>
> 2016-03-04 14:15 GMT+01:00 Benjamin Ballet :
>>
>> Indeed I was lucky : It worked with 3.3.1 but not anymore with 3.4.3..
>> I've got a strang bug with one .NET dll generated near a tool :
>>
>> CMake Error at C:/Program Files
>> (x86)/CMake/share/cmake-3.4/Modules/GetPrerequisites.cmake:798 (message):
>> 106>C:/Program Files (x86)/Microsoft Visual Studio
>> 12.0/VC/bin/dumpbin.exe
>> 106>failed: 1181
>>
>> I'm digging
>>
>>
>>
>> 2016-03-03 21:02 GMT+01:00 David Cole :
>>>
>>> It was designed originally with the assumption that all the
>>> executables in a bundle are in the same directory. If you violate that
>>> assumption, I don't think you can count on it to do the right thing
>>> 100% of the time.
>>>
>>> If it works for you calling it multiple times with deepest first, then
>>> maybe you can get lucky...
>>>
>>> I would definitely dig into it and understand exactly what it's doing,
>>> though, if you want to make sure it's going to continue working for
>>> your scenario.
>>>
>>>
>>> HTH,
>>> David C.
>>>
>>>
>>> On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet 
>>> wrote:
>>> > Hello
>>> >
>>> > I'd like to discuss a problem I encountered today with the very useful
>>> > module BundleUtilities
>>> >
>>> > We have an application on Windows with one main exe file in the top
>>> > folder
>>> > and a few other exe in subdirectories, like that :
>>> >
>>> > applicationfolder  \
>>> >   | main.exe
>>> >   | toolsfolder \
>>> > | supertoolfolder \
>>> > |
>>> > supertool.exe
>>> > | toptoolfolder \
>>> >  |
>>> > toptool.exe
>>> >
>>> > But if I simply call
>>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>>> >
>>> > the verify_app will fails.
>>> >
>>> > Just a reminder that there is no rpath on Windows : dll must be either
>>> > in
>>> > PATH or in the same folder or in the working directory.
>>> >
>>> > We expected fixup_bundle to copy the required dll for main.exe in
>>> > applicationfolder, the required dll for supertool.exe in
>>> > supertoolfolder and
>>> > the required dll for toptool.exe in toptoolfolder, but it acually
>>> > didn't
>>> > copied anything in supertoolfolder and toptoolfolder.
>>> >
>>> > I worked around this issue by calling fixup_bundle multiple time with
>>> > the
>>> > following order : (the deepest exes first)
>>> >
>>> >
>>> > fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
>>> > plugins libs)
>>> > fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
>>> > plugins libs)
>>> > fixup_bundle("applicationfolder/main.exe" plugins libs)
>>> >
>>> >
>>> > --
>>> > Benjamin BALLET
>>> > Ingénieur R&D
>>> >
>>> > ACTIVISU
>>> > 19, rue Klock - 92110 Clichy
>>> >> Standard Tél :  01 44 69 37 37
>>> >> www.activisu.com
>>> >
>>> > --
>>> >
>>> > 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
>>> >
>>

Re: [CMake] File names with unbalanced square brackets

2016-03-18 Thread David Cole via CMake
"A single pair of square brackets with ; inside have also long been
used to designate registry [key;value] pairs on Windows."

http://stackoverflow.com/a/36085151/236192


HTH,
David C.


On Fri, Mar 18, 2016 at 8:21 AM, Allen Barnett  wrote:
> Hi Petr: You're right! If I rename "c" to "c]", it treats the whole
> "/home/allen/test/b[;/home/allen/test/c]" as an element of the list. The
> other file names are correctly split apart.
> Thanks,
> Allen
>
> On Fri, Mar 18, 2016 at 3:17 AM, Petr Kmoch  wrote:
>>
>> Hi Allen.
>>
>> I'm not sure whether it's documented, but CMake interprets square brackets
>> as escaping the semi-colon character (which means a semi-colon in square
>> brackets will not work as a list item separator). You will probably have to
>> translate the file names for CMake processing by replacing [ and ] with a
>> different string, and replacing it back just before use outside of CMake.
>>
>> Petr
>>
>> On Thu, Mar 17, 2016 at 5:38 PM, Allen Barnett 
>> wrote:
>>>
>>> I inherited a set of files with somewhat unusual file names. In
>>> particular, there were a couple of files whose names included a single
>>> square bracket character. I processed these files with the file( GLOB ...)
>>> command and then iterated over the resulting list with foreach. However, the
>>> foreach command does not seem to break the resulting list apart correctly.
>>> To make this concrete, I have a directory with files named "a", "b[", and
>>> "c". file( GLOB FILES "*" ) returns the list:
>>>
>>> /home/allen/test/b[;/home/allen/test/c;/home/allen/test/a
>>>
>>> However,
>>>
>>> foreach( FILE ${FILES} )
>>>   message( ${FILE} )
>>> endforeach()
>>>
>>> just prints the same thing. That is, foreach does not split FILES into
>>> separate pieces. If I rename "b[" to "b]" I see the same behavior. If I
>>> rename "b[" to "b[]" (or even "b]["), then foreach successfully splits FILES
>>> into the individual file names.
>>>
>>> I'm using CMake 3.3.2. I see the same thing on linux and windows.
>>>
>>> Thanks,
>>> Allen
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
>>
>>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Best way to show/include CMake files in IDE

2016-03-07 Thread David Cole via CMake
If you include those files in the source list for a library, executable, or 
custom target, they should show up in IDE projects, and they should be ignored 
by Makefile type projects. Have you tried that?


David

> On Mar 7, 2016, at 6:34 PM, Eric Wing  wrote:
> 
> I have a bunch of .cmake support files in my project that I have split
> off from CMakeLists.txt (using INCLUDE to combine them) to separate
> concerns. (Source files, application assets, script files, platform
> settings, codesigning, etc.)
> 
> This works, but they don't show up in IDEs (Visual Studio, Xcode,
> etc). I realized it would be nice to see these files in the IDE and be
> able to edit them there. (I assume the CMake bootstrap will still just
> work.)
> 
> What is the best way to include/show these files in the IDE (and won't
> break the Makefile or other non-IDE generators)?
> 
> Thanks,
> Eric
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] fixup_bundle on Windows : issue with multiple exe applications

2016-03-03 Thread David Cole via CMake
It was designed originally with the assumption that all the
executables in a bundle are in the same directory. If you violate that
assumption, I don't think you can count on it to do the right thing
100% of the time.

If it works for you calling it multiple times with deepest first, then
maybe you can get lucky...

I would definitely dig into it and understand exactly what it's doing,
though, if you want to make sure it's going to continue working for
your scenario.


HTH,
David C.


On Thu, Mar 3, 2016 at 1:43 PM, Benjamin Ballet  wrote:
> Hello
>
> I'd like to discuss a problem I encountered today with the very useful
> module BundleUtilities
>
> We have an application on Windows with one main exe file in the top folder
> and a few other exe in subdirectories, like that :
>
> applicationfolder  \
>   | main.exe
>   | toolsfolder \
> | supertoolfolder \
> |
> supertool.exe
> | toptoolfolder \
>  |
> toptool.exe
>
> But if I simply call
> fixup_bundle("applicationfolder/main.exe" plugins libs)
>
> the verify_app will fails.
>
> Just a reminder that there is no rpath on Windows : dll must be either in
> PATH or in the same folder or in the working directory.
>
> We expected fixup_bundle to copy the required dll for main.exe in
> applicationfolder, the required dll for supertool.exe in supertoolfolder and
> the required dll for toptool.exe in toptoolfolder, but it acually didn't
> copied anything in supertoolfolder and toptoolfolder.
>
> I worked around this issue by calling fixup_bundle multiple time with the
> following order : (the deepest exes first)
>
> fixup_bundle("applicationfolder/toolsfolder/supertoolfolder/supertool.exe"
> plugins libs)
> fixup_bundle("applicationfolder/toolsfolder/toptoolfolder/toptool.exe"
> plugins libs)
> fixup_bundle("applicationfolder/main.exe" plugins libs)
>
>
> --
> Benjamin BALLET
> Ingénieur R&D
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.com
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Visual Studio and ExternalProject_Add

2016-03-02 Thread David Cole via CMake
Newer versions of Visual Studio install a git, too, for their source
control integration features. Which git is CMake using, the one you've
installed or the one Visual Studio installed?



On Wed, Mar 2, 2016 at 12:45 AM, Kevin Brightwell
 wrote:
> I've been having great success with using ExternalProject over the terrible
> git submodules. However, when using Visual Studio, the following error
> happens:
>
>  Performing download step (git clone) for 'catch-lib'
> 2>  Cloning into 'catch-lib'...
> 2>  Note: checking out 'tags/v1.3.4'.
> 2>
> 2>  You are in 'detached HEAD' state. You can look around, make experimental
> 2>  changes and commit them, and you can discard any commits you make in
> this
> 2>  state without impacting any branches by performing another checkout.
> 2>
> 2>  If you want to create a new branch to retain commits you create, you may
> 2>  do so (now or later) by using -b with the checkout command again.
> Example:
> 2>
> 2>git checkout -b 
> 2>
> 2>  HEAD is now at 3b4edd7... Build for v1.3.4
> 2>  fatal: 'submodule' appears to be a git command, but we were not
> 2>  able to execute it. Maybe git-submodule is broken?
> 2>  CMake Error at
> C:/Users/kevin/dev/sol2/vendor/tmp/catch-lib-gitclone.cmake:58 (message):
> 2>Failed to init submodules in:
> 2>'C:/Users/kevin/dev/sol2/vendor/src/catch-lib'
>
> The CMake file is located here:
> https://github.com/Nava2/sol2/blob/cmake-build/CMakeLists.txt
>
> Steps I've verified:
>
> git.exe is on my system PATH
> The submodule URL is valid
> Builds on OSX/Linux
> Reinstalled git (twice)
>
> I'm new to Visual Studio (I work primarily with Linux/OSX), so I'm sure I'm
> missing something along the way.
>
> Thanks,
>
> --
> Kevin Brightwell. BESc., BSc.
> MESc. Candidate 2017
> Western University
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] ExternalProject_Add with flexible install commands

2016-02-25 Thread David Cole via CMake
Do you need to do it indirectly through a variable like this?

If you just use:
  INSTALL_COMMAND ""

directly in the ExternalProject_Add call, it will work.

If you really need to do it indirectly, there's probably a way, but it
will also probably be more confusing for people reading the code in
the future. Not sure it's worth that trade-off. You could always
"cheat" and execute a no-op command for the install step rather than
"skipping" it. i.e. INSTALL_COMMAND ${CMAKE_COMMAND} -E echo
NoInstallStep ...


HTH,
David C.




On Thu, Feb 25, 2016 at 11:03 AM, Knox, Kent  wrote:
> Hi Petr~
>
> Thanks for your reply.
>
>
> These set statements do not appear to work.  Either the command 'installs'
> the dependency, or an error pops up.
>
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
> --> this installs the dependency
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
> --> /bin/sh: 1:  : not found
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND  )
> --> CMake Warning (dev) in CMakeLists.txt
> --> Argument not separated from preceding token by whitespace.
>
> Kent
>
> 
> From: Petr Kmoch 
> Sent: Thursday, February 25, 2016 2:46 AM
> To: Knox, Kent
> Cc: cmake@cmake.org
> Subject: Re: [CMake] ExternalProject_Add with flexible install commands
>
> Hi Kent,
>
> I believe it's not "empty quotes" that disables the install command, it's
> the empty string. So you should not escape the quotes:
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> Petr
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Cannot set FOLDER property to an interface (header-only) target

2015-12-31 Thread David Cole via CMake
I can't think of a reason why we would not whitelist the FOLDER property...
Unless somebody else chimes in with one, perhaps you could submit a
proposed patch to whitelist it?


D


On Wednesday, December 30, 2015, Klaim - Joël Lamotte 
wrote:

> The following CMake script:
>
> cmake_minimum_required(VERSION 3.4)
>
> add_library( mylib INTERFACE )
> set_property( TARGET mylib PROPERTY FOLDER /some/dir )
>
>
> Will trigger this error on configuration:
>
> CMake Error at CMakeLists.txt:4 (set_property):
>   INTERFACE_LIBRARY targets may only have whitelisted properties.  The
>   property "FOLDER" is not allowed.
>
>
> This prevent any interface library to be organized in Visual Studio
> virtual folders.
> Unfortunately it also mean that header-only targets can't be organized.
>
> I have no idea how this should be solved. Should the property just be
> white-listed?
> Or should a better have a another specific library mode for header-only
> targets?
>
> Is there any workaround?
>
> Joël Lamotte
>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] BitDefender and cmakecompilerid.exe ot cmakecxxcompilerid.exe

2015-12-29 Thread David Cole via CMake
If BitDefender is quarantining those files, I would suspect the compiler you 
are using has somehow become virus-infected...

What does BitDefender say if you ask it to analyze your compiler *.exe?

Maybe you should run a full scan of all the drives you are using here...


HTH,
David



> On Dec 29, 2015, at 4:34 AM, Mauro Ziliani  
> wrote:
> 
> Hi all.
> BitDefender puts the files cmakecompilerid.exe and cmakecxxcompilerid.exe in 
> quarantena.
> 
> It find Gen:Variant.Midie.5130
> 
> It's a fake or is it true?
> 
> Mauro
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Tests with assert and Release build type

2015-12-23 Thread David Cole via CMake
Not only is it possible ... it WILL happen if you use the Microsoft
C++ compiler and try to mix and match Release and Debug compilation
units.

The MS compiler has some very nice memory tracking facilities built
into the Debug runtime libraries, but it is accomplished via different
structs for Debug and Release builds with extra stuff in the Debug
structs.

So allocations from a Debug compilation unit will not be accessed
correctly in a linked-in Release compilation unit when a pointer to it
is passed across the boundary.

You will see access violations and hard crashes happening in builds
from the Microsoft compiler unless you ensure that everything in a
build has matching Debug/Release defines and compiler settings.

It is only safe to mix-n-match if all calls which cross a boundary
between compilation units have NO differences in their struct and
class definitions from an ABI perspective. Since it is difficult to
verify when this is the case (in general) for large C++ projects, it's
best to avoid mixing and matching...


HTH,
David C.



On Wed, Dec 23, 2015 at 8:29 AM, Ruslan Baratov via CMake
 wrote:
> On 22-Dec-15 04:07, Magnus Therning wrote:
>>
>> Ruslan Baratov writes:
>>
>>> On 20-Dec-15 01:31, Magnus Therning wrote:

 Ruslan Baratov writes:

> How about using RelWithDebInfo? See:
> http://stackoverflow.com/a/28124715/2288008

 Hmm, I'm probably missing something but how does that solve the issue
 with some targets requiring NDEBUG to be *undefined* and other targets
 requiring NDEBUG to be defined?
>>>
>>> I don't think that building targets with different NDEBUG values is a
>>> good idea. More correct approach will be to introduce custom macro to
>>> allow checks (i.e. FOO_NDEBUG/FOO_DEBUG).
>>
>> Why not?
>
> It is possible to hit situation when ODR will be violated, e.g. if somebody
> define optional member in structure with "#if defined(NDEBUG)" condition.
> Something like this:
> http://stackoverflow.com/questions/20833226/library-headers-and-define
>
>>
>> /M
>>
>> --
>> Magnus Therning  OpenPGP: 0x927912051716CE39
>> email: mag...@therning.org   jabber: mag...@therning.org
>> twitter: magthe   http://therning.org/magnus
>>
>> We act as though comfort and luxury were the chief requirements of
>> life, when all that we need to make us happy is something to be
>> enthusiastic about.
>>   -- Albert Einstein
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] build order

2015-12-19 Thread David Cole via CMake
Build the second thing as an ExternalProject, too, and use the DEPENDS keyword 
to make it build after the first thing.

Don't try to mix-and-match external projects and non-external projects in the 
same CMake configure... It's just too much work to get things working in a 
reasonable cross-platform way. It's possible, but certainly not easy.


David


> On Dec 18, 2015, at 3:29 PM, Owen Hogarth II  wrote:
> 
> If you download, compile and install a cmake project through external project
> 
> How can I make sure that the external project is built before something that 
> depends on that external project?
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Problem when using variable_watch with Visual Studio generator in 3.4.1

2015-12-10 Thread David Cole via CMake
I've got a Debug build of current 'master' on Windows, and the problem is
also evident with my build:


C:\dev\dcole\tmp\variable_watch_problem\b1> "C:\dev\repos\My Tests\cmake
Win32-ninja-cl12-Debug\bin\
cmake.exe" -G Ninja ..
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at N:/repos/cmake/Modules/FindPythonInterp.cmake:161 (include):
  include could not find load file:


÷░♣A/Fin
dPackageHandleStandardArgs.cmake
Call Stack (most recent call first):
  CMakeLists.txt:11 (find_package)


CMake Error at N:/repos/cmake/Modules/FindPythonInterp.cmake:162
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
:
  Unknown CMake command "FIND_PACKAGE_HANDLE_STANDARD_ARGS".
Call Stack (most recent call first):
  CMakeLists.txt:11 (find_package)


-- Configuring incomplete, errors occurred!
See also
"C:/dev/dcole/tmp/variable_watch_problem/b1/CMakeFiles/CMakeOutput.log".


On Thu, Dec 10, 2015 at 7:26 AM, Yves Frederix <
yves.frederix+cm...@gmail.com> wrote:

> After commenting out the call there is no error output:
>
>   -- The CXX compiler identification is MSVC 17.0.61030.0
>   -- Check for working CXX compiler using: Visual Studio 11 2012 Win64
>   -- Check for working CXX compiler using: Visual Studio 11 2012 Win64 --
> works
>   -- Detecting CXX compiler ABI info
>   -- Detecting CXX compiler ABI info - done
>   -- Detecting CXX compile features
>   -- Detecting CXX compile features - done
>   -- Found PythonInterp: C:/Python27/python.exe (found version "2.7.10")
>   -- Configuring done
>   -- Generating done
>
>
> Yves
>
> On Thu, Dec 10, 2015 at 12:58 PM, David Cole  wrote:
>
>> Out of curiosity, what output do you get (with 3.4.1) when you comment
>> out your call to variable_watch? Do you still get error output, but without
>> strange symbols in it? Or is there no error output in that case?
>>
>>
>> On Thursday, December 10, 2015, Yves Frederix <
>> yves.frederix+cm...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I am experiencing problems during the CMake configure step when using
>>> the function variable_watch. Consider the following minimal CMakeLists
>>> file:
>>>
>>>   cmake_minimum_required(VERSION 3.4)
>>>   project(test CXX)
>>>
>>>   function(myhook _variable _access _value _current_list_file _stack)
>>> if("${_value}" STREQUAL "")
>>>   # Do nothing
>>> endif()
>>>   endfunction()
>>>
>>>   variable_watch(CMAKE_CURRENT_LIST_DIR myhook)
>>>   find_package(PythonInterp REQUIRED)
>>>
>>>
>>> When configuring on Windows using CMake 3.4.1 with the Visual Studio
>>> generator (I tried both VS2012 and VS2015), the process fails with an
>>> error message (notice the strange symbols at the beginning of the line
>>> mentioning FindPackageMessage.cmake):
>>>
>>>   -- Detecting CXX compile features - done
>>> CMake Error at
>>> C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:142
>>> (include):
>>>   include could not find load file:
>>>
>>> L☺
>>> /Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPackageMessage.cmake
>>> Call Stack (most recent call first):
>>>   C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPythonInterp.cmake:161
>>> (include)
>>>   CMakeLists.txt:12 (find_package)
>>>
>>>
>>>   CMake Error at
>>>
>>> C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:379
>>> (FIND_PACKAGE_MESSAGE):
>>>   Unknown CMake command "FIND_PACKAGE_MESSAGE".
>>>   Call Stack (most recent call first):
>>>
>>> C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPythonInterp.cmake:162
>>> (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
>>> CMakeLists.txt:12 (find_package)
>>>
>>>
>>> I did some more testing, and the configuration step is successful when:
>>> - using CMake 2.8.12 or 3.4.0
>>> - using 3.4.1 (or older versions) on osx (I did not try linux)
>>> - removing the 'CXX' in the project call or removing the project call
>>> entirely
>>> - removing the check for _value inside the function
>>>
>>> It seems that for some reason adding the watch (which actually only
>>> does read-only access), the contents of the CMAKE_CURRENT_LIST_DIR
>>> variable is messed up somehow. Could I have run into some corner case
>>> behavior here?
>>>
>>> Maybe it is also useful to mention how I ended up in this situation.
>>> My requirement was to run some custom code as the very last step of
>>> the configure process. The solution I found was based on using
>>> variable_watch (see
>>>
>>> http://stackoverflow.com/questions/15760580/execute-command-or-macro-in-cmake-as-last-step-before-configure-step-finishes#15824843
>>> ),
>>> but apparently this is not a very robust solution. Are there possibly
>>> better ways of accomplishing t

Re: [CMake] Problem when using variable_watch with Visual Studio generator in 3.4.1

2015-12-10 Thread David Cole via CMake
Out of curiosity, what output do you get (with 3.4.1) when you comment out
your call to variable_watch? Do you still get error output, but without
strange symbols in it? Or is there no error output in that case?


On Thursday, December 10, 2015, Yves Frederix 
wrote:

> Hi all,
>
> I am experiencing problems during the CMake configure step when using
> the function variable_watch. Consider the following minimal CMakeLists
> file:
>
>   cmake_minimum_required(VERSION 3.4)
>   project(test CXX)
>
>   function(myhook _variable _access _value _current_list_file _stack)
> if("${_value}" STREQUAL "")
>   # Do nothing
> endif()
>   endfunction()
>
>   variable_watch(CMAKE_CURRENT_LIST_DIR myhook)
>   find_package(PythonInterp REQUIRED)
>
>
> When configuring on Windows using CMake 3.4.1 with the Visual Studio
> generator (I tried both VS2012 and VS2015), the process fails with an
> error message (notice the strange symbols at the beginning of the line
> mentioning FindPackageMessage.cmake):
>
>   -- Detecting CXX compile features - done
> CMake Error at
> C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:142
> (include):
>   include could not find load file:
>
> L☺/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPackageMessage.cmake
> Call Stack (most recent call first):
>   C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPythonInterp.cmake:161
> (include)
>   CMakeLists.txt:12 (find_package)
>
>
>   CMake Error at
>
> C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPackageHandleStandardArgs.cmake:379
> (FIND_PACKAGE_MESSAGE):
>   Unknown CMake command "FIND_PACKAGE_MESSAGE".
>   Call Stack (most recent call first):
> C:/Tools/CMake_3.4.1/share/cmake-3.4/Modules/FindPythonInterp.cmake:162
> (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
> CMakeLists.txt:12 (find_package)
>
>
> I did some more testing, and the configuration step is successful when:
> - using CMake 2.8.12 or 3.4.0
> - using 3.4.1 (or older versions) on osx (I did not try linux)
> - removing the 'CXX' in the project call or removing the project call
> entirely
> - removing the check for _value inside the function
>
> It seems that for some reason adding the watch (which actually only
> does read-only access), the contents of the CMAKE_CURRENT_LIST_DIR
> variable is messed up somehow. Could I have run into some corner case
> behavior here?
>
> Maybe it is also useful to mention how I ended up in this situation.
> My requirement was to run some custom code as the very last step of
> the configure process. The solution I found was based on using
> variable_watch (see
>
> http://stackoverflow.com/questions/15760580/execute-command-or-macro-in-cmake-as-last-step-before-configure-step-finishes#15824843
> ),
> but apparently this is not a very robust solution. Are there possibly
> better ways of accomplishing the same thing?
>
> Thanks!
>
> Regards,
> Yves
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Copying directories as post build events without losing parent directory

2015-12-07 Thread David Cole via CMake
$ cmake -E copy_directory foo bar/foo

?


On Mon, Dec 7, 2015 at 4:53 PM, Robert Dailey  wrote:
> I have a custom target which runs a command similar to this:
>
> $ cmake -E copy_directory foo bar
>
> The problem is that the contents of "foo" are copied inside of "bar",
> instead of it creating a directory "bar/foo" and putting the contents
> in there.
>
> Is there a way to make copy_directory behave like this? If not, I
> guess my only option is to create a little CMake script that runs
> file(INSTALL) to copy the directories like I want.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] download file, modify, add test from it

2015-11-23 Thread David Cole via CMake
You're welcome.

I see you have ${file}-2.h5m in only one place, though... Is that a
leftover, or is the other reference to -2 just omitted from your example...?


Cheers,
David C.



On Monday, November 23, 2015, Nico Schlömer 
wrote:

> Thanks David for your explanations. I've now reached a good solution:
>
> Fetch the data:
> ```
> INCLUDE(ExternalData)
> set(
>   ExternalData_URL_TEMPLATES
>   "https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)"
>   )
> foreach(file ${input_files})
>   ExternalData_Expand_Arguments(
> noshTestFetchData
> OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test/data/${file}.e}
> )
> endforeach()
> ExternalData_Add_Target(noshTestFetchData)
> ```
> Define conversion commands:
> ```
> foreach(file ${input_files})
>   LIST(APPEND FILES2 ${file}-2.h5m)
>   add_custom_command(
> DEPENDS ${file}.e
> COMMAND convert ${file}.e ${file}.h5m
> OUTPUT ${file}.h5m
> )
> endforeach()
> ```
> Add a custom target with ALL:
> ```
> add_custom_target(split2 ALL
>   SOURCES ${FILES2}
>   )
> ```
> Adding the output files to the SOURCES makes the target do what's its
> supposed to do.
>
> Cheers,
> Nico
>
> On Sun, Nov 22, 2015 at 11:59 PM David Cole  > wrote:
>
>> You don't. You just assume all relevant targets have already been built
>> by the time you run the tests... There's no such thing as a test from
>> an add_test call depending on a target.
>>
>> There **is** a dependency, of course, if you are using one of the build
>> products in your test, but it's assumed that everything is already built at
>> test time.
>>
>> There is not yet a notion of connecting certain tests to certain build
>> targets.
>>
>> So, for example, there is no way to re-run only the tests affected by
>> things which have changed since the last build, because there is no
>> connection between targets and tests.
>>
>> People have artificially created such connections using test labels, and
>> running subsets of tests by label, but there is no official dependency from
>> tests back to targets.
>>
>>
>> D
>>
>>
>>
>> On Sunday, November 22, 2015, Nico Schlömer > > wrote:
>>
>>> Aha, this was a misunderstanding of me then. Thanks!
>>> How do I make a test depend on a target then?
>>>
>>> Cheers,
>>> Nico
>>>
>>>
>>> On Sun, Nov 22, 2015 at 8:58 PM David Cole  wrote:
>>>
 The DEPENDS property of a test is meant to ensure test running order in
 the case of parallel testing... It simply ensures that one test runs before
 another. It is not connected to the build system at all. It's different
 than target dependencies.


 D



 On Sunday, November 22, 2015, David Cole  wrote:

> What do you mean by "depend" in this case? All libs and exes should be
> built during a "make" or "make all" or "make install" ... And all that
> should be done before any tests get run.
>
> Simply typing "ctest" to execute all the tests never does any
> building. The assumed workflow is that you build stuff first and then run
> the tests.
>
> If you want, you can add a custom target that runs a test, and make
> that custom target depend on any other targets, but ctest still won't know
> about it. Only "make custom_test_target" will...
>
>
> D
>
>
>
> On Sunday, November 22, 2015, Nico Schlömer 
> wrote:
>
>> Thanks for the hints!
>> I'm almost there now, the only thing missing is to have my test
>> depend on the custom_target. This
>> ```
>> SET_TESTS_PROPERTIES(testname PROPERTIES DEPENDS convert)
>> ```
>> doesn't do the trick: The target `convert` isn't executed before
>> `ctest`.
>>
>> Any hints?
>>
>> Cheers,
>> Nico
>>
>>
>> On Sun, Nov 22, 2015 at 3:18 AM David Cole  wrote:
>>
>>> Did you try using full path names for the add_custom_command file
>>> names?
>>>
>>> And the NAME/COMMAND form of the add_test command?
>>>
>>> Also, I've always found custom commands to work best when they're
>>> associated with a target. And if it was part of a target you could make 
>>> the
>>> target depend on the external data target with add_dependencies if
>>> necessary.
>>>
>>>
>>> HTH,
>>> David C.
>>>
>>>
>>> On Saturday, November 21, 2015, Nico Schlömer <
>>> nico.schloe...@gmail.com> wrote:
>>>
 Hi everyone,

 I would like to create a CMake test that does the following:
  * Download a file from an external resource
  * Do something with the file
  * compile an executable myTest
  * execute myTest outputfile

 Using ExternalData for downloading the file works well, but the
 second step (file conversion, in this example cp for simplicity) does 
 not
 work:
 ```
 cmake_minimum_required(VERSION 3.2)

 project(mytest)

 

Re: [CMake] download file, modify, add test from it

2015-11-22 Thread David Cole via CMake
You don't. You just assume all relevant targets have already been built by
the time you run the tests... There's no such thing as a test from
an add_test call depending on a target.

There **is** a dependency, of course, if you are using one of the build
products in your test, but it's assumed that everything is already built at
test time.

There is not yet a notion of connecting certain tests to certain build
targets.

So, for example, there is no way to re-run only the tests affected by
things which have changed since the last build, because there is no
connection between targets and tests.

People have artificially created such connections using test labels, and
running subsets of tests by label, but there is no official dependency from
tests back to targets.


D



On Sunday, November 22, 2015, Nico Schlömer 
wrote:

> Aha, this was a misunderstanding of me then. Thanks!
> How do I make a test depend on a target then?
>
> Cheers,
> Nico
>
>
> On Sun, Nov 22, 2015 at 8:58 PM David Cole  > wrote:
>
>> The DEPENDS property of a test is meant to ensure test running order in
>> the case of parallel testing... It simply ensures that one test runs before
>> another. It is not connected to the build system at all. It's different
>> than target dependencies.
>>
>>
>> D
>>
>>
>>
>> On Sunday, November 22, 2015, David Cole > > wrote:
>>
>>> What do you mean by "depend" in this case? All libs and exes should be
>>> built during a "make" or "make all" or "make install" ... And all that
>>> should be done before any tests get run.
>>>
>>> Simply typing "ctest" to execute all the tests never does any building.
>>> The assumed workflow is that you build stuff first and then run the tests.
>>>
>>> If you want, you can add a custom target that runs a test, and make that
>>> custom target depend on any other targets, but ctest still won't know about
>>> it. Only "make custom_test_target" will...
>>>
>>>
>>> D
>>>
>>>
>>>
>>> On Sunday, November 22, 2015, Nico Schlömer 
>>> wrote:
>>>
 Thanks for the hints!
 I'm almost there now, the only thing missing is to have my test depend
 on the custom_target. This
 ```
 SET_TESTS_PROPERTIES(testname PROPERTIES DEPENDS convert)
 ```
 doesn't do the trick: The target `convert` isn't executed before
 `ctest`.

 Any hints?

 Cheers,
 Nico


 On Sun, Nov 22, 2015 at 3:18 AM David Cole  wrote:

> Did you try using full path names for the add_custom_command file
> names?
>
> And the NAME/COMMAND form of the add_test command?
>
> Also, I've always found custom commands to work best when they're
> associated with a target. And if it was part of a target you could make 
> the
> target depend on the external data target with add_dependencies if
> necessary.
>
>
> HTH,
> David C.
>
>
> On Saturday, November 21, 2015, Nico Schlömer <
> nico.schloe...@gmail.com> wrote:
>
>> Hi everyone,
>>
>> I would like to create a CMake test that does the following:
>>  * Download a file from an external resource
>>  * Do something with the file
>>  * compile an executable myTest
>>  * execute myTest outputfile
>>
>> Using ExternalData for downloading the file works well, but the
>> second step (file conversion, in this example cp for simplicity) does not
>> work:
>> ```
>> cmake_minimum_required(VERSION 3.2)
>>
>> project(mytest)
>>
>> # Download the files
>> INCLUDE(ExternalData)
>> set(
>>   ExternalData_URL_TEMPLATES
>>   "https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)
>> "
>>   )
>> ExternalData_Expand_Arguments(
>>   testFetchData
>>   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test.e}
>>   )
>> ExternalData_Add_Target(testFetchData)
>>
>> add_custom_command(
>>   OUTPUT test.g
>>   COMMAND cp test.e test.g
>>   DEPENDS test.e
>>   )
>>
>> ADD_EXECUTABLE("myTest" main.cpp)
>>
>> add_test(myTest test.g)
>> ```
>> I suppose I'm missing something about the dependencies here; after
>> all, the `add_custom_command` has to wait for `testFetchData` to 
>> complete.
>> Likewise, `add_test` has to wait for `add_custom_command` to complete.
>>
>> Hints appreciated.
>>
>> Cheers,
>> Nico
>>
>
-- 

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://publ

Re: [CMake] download file, modify, add test from it

2015-11-22 Thread David Cole via CMake
Use ALL to include your custom target in the default build of all.

https://cmake.org/cmake/help/v3.4/command/add_custom_target.html


D


On Sunday, November 22, 2015, Nico Schlömer 
wrote:

> I was under the impression that if I don't explicitly build a target, it
> won't get build. Perhaps I'm wrong here. In any case, this
> ```
> add_custom_target(convert)
> add_dependencies(convert testFetchData)
> add_custom_command(
>   TARGET convert
>   COMMAND cp test.e test.g
>   )
> ```
> never gets executed on `make`, unlike all other targets (e.g., `
> testFetchData`). (Full CMakeLists.txt at [1].) Explicitly calling `make
> convert` works alright.
>
> Any idea why that might be?
>
> Cheers,
> Nico
>
> [1] http://chunk.io/f/729beeab41fb4a7385ceb98b31a2ea0a
>
> On Sun, Nov 22, 2015 at 8:46 PM David Cole  > wrote:
>
>> What do you mean by "depend" in this case? All libs and exes should be
>> built during a "make" or "make all" or "make install" ... And all that
>> should be done before any tests get run.
>>
>> Simply typing "ctest" to execute all the tests never does any building.
>> The assumed workflow is that you build stuff first and then run the tests.
>>
>> If you want, you can add a custom target that runs a test, and make that
>> custom target depend on any other targets, but ctest still won't know about
>> it. Only "make custom_test_target" will...
>>
>>
>> D
>>
>>
>>
>> On Sunday, November 22, 2015, Nico Schlömer > > wrote:
>>
>>> Thanks for the hints!
>>> I'm almost there now, the only thing missing is to have my test depend
>>> on the custom_target. This
>>> ```
>>> SET_TESTS_PROPERTIES(testname PROPERTIES DEPENDS convert)
>>> ```
>>> doesn't do the trick: The target `convert` isn't executed before `ctest`.
>>>
>>> Any hints?
>>>
>>> Cheers,
>>> Nico
>>>
>>>
>>> On Sun, Nov 22, 2015 at 3:18 AM David Cole  wrote:
>>>
 Did you try using full path names for the add_custom_command file names?

 And the NAME/COMMAND form of the add_test command?

 Also, I've always found custom commands to work best when they're
 associated with a target. And if it was part of a target you could make the
 target depend on the external data target with add_dependencies if
 necessary.


 HTH,
 David C.


 On Saturday, November 21, 2015, Nico Schlömer 
 wrote:

> Hi everyone,
>
> I would like to create a CMake test that does the following:
>  * Download a file from an external resource
>  * Do something with the file
>  * compile an executable myTest
>  * execute myTest outputfile
>
> Using ExternalData for downloading the file works well, but the second
> step (file conversion, in this example cp for simplicity) does not work:
> ```
> cmake_minimum_required(VERSION 3.2)
>
> project(mytest)
>
> # Download the files
> INCLUDE(ExternalData)
> set(
>   ExternalData_URL_TEMPLATES
>   "https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)"
>   )
> ExternalData_Expand_Arguments(
>   testFetchData
>   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test.e}
>   )
> ExternalData_Add_Target(testFetchData)
>
> add_custom_command(
>   OUTPUT test.g
>   COMMAND cp test.e test.g
>   DEPENDS test.e
>   )
>
> ADD_EXECUTABLE("myTest" main.cpp)
>
> add_test(myTest test.g)
> ```
> I suppose I'm missing something about the dependencies here; after
> all, the `add_custom_command` has to wait for `testFetchData` to complete.
> Likewise, `add_test` has to wait for `add_custom_command` to complete.
>
> Hints appreciated.
>
> Cheers,
> Nico
>

-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] download file, modify, add test from it

2015-11-22 Thread David Cole via CMake
The DEPENDS property of a test is meant to ensure test running order in the
case of parallel testing... It simply ensures that one test runs before
another. It is not connected to the build system at all. It's different
than target dependencies.


D



On Sunday, November 22, 2015, David Cole  wrote:

> What do you mean by "depend" in this case? All libs and exes should be
> built during a "make" or "make all" or "make install" ... And all that
> should be done before any tests get run.
>
> Simply typing "ctest" to execute all the tests never does any building.
> The assumed workflow is that you build stuff first and then run the tests.
>
> If you want, you can add a custom target that runs a test, and make that
> custom target depend on any other targets, but ctest still won't know about
> it. Only "make custom_test_target" will...
>
>
> D
>
>
>
> On Sunday, November 22, 2015, Nico Schlömer  > wrote:
>
>> Thanks for the hints!
>> I'm almost there now, the only thing missing is to have my test depend on
>> the custom_target. This
>> ```
>> SET_TESTS_PROPERTIES(testname PROPERTIES DEPENDS convert)
>> ```
>> doesn't do the trick: The target `convert` isn't executed before `ctest`.
>>
>> Any hints?
>>
>> Cheers,
>> Nico
>>
>>
>> On Sun, Nov 22, 2015 at 3:18 AM David Cole  wrote:
>>
>>> Did you try using full path names for the add_custom_command file names?
>>>
>>> And the NAME/COMMAND form of the add_test command?
>>>
>>> Also, I've always found custom commands to work best when they're
>>> associated with a target. And if it was part of a target you could make the
>>> target depend on the external data target with add_dependencies if
>>> necessary.
>>>
>>>
>>> HTH,
>>> David C.
>>>
>>>
>>> On Saturday, November 21, 2015, Nico Schlömer 
>>> wrote:
>>>
 Hi everyone,

 I would like to create a CMake test that does the following:
  * Download a file from an external resource
  * Do something with the file
  * compile an executable myTest
  * execute myTest outputfile

 Using ExternalData for downloading the file works well, but the second
 step (file conversion, in this example cp for simplicity) does not work:
 ```
 cmake_minimum_required(VERSION 3.2)

 project(mytest)

 # Download the files
 INCLUDE(ExternalData)
 set(
   ExternalData_URL_TEMPLATES
   "https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)"
   )
 ExternalData_Expand_Arguments(
   testFetchData
   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test.e}
   )
 ExternalData_Add_Target(testFetchData)

 add_custom_command(
   OUTPUT test.g
   COMMAND cp test.e test.g
   DEPENDS test.e
   )

 ADD_EXECUTABLE("myTest" main.cpp)

 add_test(myTest test.g)
 ```
 I suppose I'm missing something about the dependencies here; after all,
 the `add_custom_command` has to wait for `testFetchData` to complete.
 Likewise, `add_test` has to wait for `add_custom_command` to complete.

 Hints appreciated.

 Cheers,
 Nico

>>>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] download file, modify, add test from it

2015-11-22 Thread David Cole via CMake
What do you mean by "depend" in this case? All libs and exes should be
built during a "make" or "make all" or "make install" ... And all that
should be done before any tests get run.

Simply typing "ctest" to execute all the tests never does any building. The
assumed workflow is that you build stuff first and then run the tests.

If you want, you can add a custom target that runs a test, and make that
custom target depend on any other targets, but ctest still won't know about
it. Only "make custom_test_target" will...


D



On Sunday, November 22, 2015, Nico Schlömer 
wrote:

> Thanks for the hints!
> I'm almost there now, the only thing missing is to have my test depend on
> the custom_target. This
> ```
> SET_TESTS_PROPERTIES(testname PROPERTIES DEPENDS convert)
> ```
> doesn't do the trick: The target `convert` isn't executed before `ctest`.
>
> Any hints?
>
> Cheers,
> Nico
>
>
> On Sun, Nov 22, 2015 at 3:18 AM David Cole  > wrote:
>
>> Did you try using full path names for the add_custom_command file names?
>>
>> And the NAME/COMMAND form of the add_test command?
>>
>> Also, I've always found custom commands to work best when they're
>> associated with a target. And if it was part of a target you could make the
>> target depend on the external data target with add_dependencies if
>> necessary.
>>
>>
>> HTH,
>> David C.
>>
>>
>> On Saturday, November 21, 2015, Nico Schlömer > > wrote:
>>
>>> Hi everyone,
>>>
>>> I would like to create a CMake test that does the following:
>>>  * Download a file from an external resource
>>>  * Do something with the file
>>>  * compile an executable myTest
>>>  * execute myTest outputfile
>>>
>>> Using ExternalData for downloading the file works well, but the second
>>> step (file conversion, in this example cp for simplicity) does not work:
>>> ```
>>> cmake_minimum_required(VERSION 3.2)
>>>
>>> project(mytest)
>>>
>>> # Download the files
>>> INCLUDE(ExternalData)
>>> set(
>>>   ExternalData_URL_TEMPLATES
>>>   "https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)"
>>>   )
>>> ExternalData_Expand_Arguments(
>>>   testFetchData
>>>   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test.e}
>>>   )
>>> ExternalData_Add_Target(testFetchData)
>>>
>>> add_custom_command(
>>>   OUTPUT test.g
>>>   COMMAND cp test.e test.g
>>>   DEPENDS test.e
>>>   )
>>>
>>> ADD_EXECUTABLE("myTest" main.cpp)
>>>
>>> add_test(myTest test.g)
>>> ```
>>> I suppose I'm missing something about the dependencies here; after all,
>>> the `add_custom_command` has to wait for `testFetchData` to complete.
>>> Likewise, `add_test` has to wait for `add_custom_command` to complete.
>>>
>>> Hints appreciated.
>>>
>>> Cheers,
>>> Nico
>>>
>>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] download file, modify, add test from it

2015-11-21 Thread David Cole via CMake
Did you try using full path names for the add_custom_command file names?

And the NAME/COMMAND form of the add_test command?

Also, I've always found custom commands to work best when they're
associated with a target. And if it was part of a target you could make the
target depend on the external data target with add_dependencies if
necessary.


HTH,
David C.


On Saturday, November 21, 2015, Nico Schlömer 
wrote:

> Hi everyone,
>
> I would like to create a CMake test that does the following:
>  * Download a file from an external resource
>  * Do something with the file
>  * compile an executable myTest
>  * execute myTest outputfile
>
> Using ExternalData for downloading the file works well, but the second
> step (file conversion, in this example cp for simplicity) does not work:
> ```
> cmake_minimum_required(VERSION 3.2)
>
> project(mytest)
>
> # Download the files
> INCLUDE(ExternalData)
> set(
>   ExternalData_URL_TEMPLATES
>   "https://downloads.sourceforge.net/project/noshdata/%(algo)/%(hash)"
>   )
> ExternalData_Expand_Arguments(
>   testFetchData
>   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test.e}
>   )
> ExternalData_Add_Target(testFetchData)
>
> add_custom_command(
>   OUTPUT test.g
>   COMMAND cp test.e test.g
>   DEPENDS test.e
>   )
>
> ADD_EXECUTABLE("myTest" main.cpp)
>
> add_test(myTest test.g)
> ```
> I suppose I'm missing something about the dependencies here; after all,
> the `add_custom_command` has to wait for `testFetchData` to complete.
> Likewise, `add_test` has to wait for `add_custom_command` to complete.
>
> Hints appreciated.
>
> Cheers,
> Nico
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] [CDash] CTEST_CUSTOM_WARNING_EXECPTION

2015-11-05 Thread David Cole via CMake
Looks to me like it might be (I'm hopeful) working at ignoring the
line which matches the expression ".*vcl_deprecated_header.h.*" ...

But then, the following line is:

 # warning "deprecated"

Since that line does not match any of your expressions, maybe that's
the one triggering this warning slipping through as unignored?


HTH,
D




On Thu, Nov 5, 2015 at 10:01 AM, Rashad M  wrote:
> yes.
>
> On Thu, Nov 5, 2015 at 1:46 PM, David Cole  wrote:
>>
>> Does your ctest -S script call ctest_read_custom_files
>> https://cmake.org/cmake/help/v3.4/command/ctest_read_custom_files.html after
>> ctest_configure?
>>
>>
>> On Thursday, November 5, 2015, Rashad M 
>> wrote:
>>>
>>> Hello all,
>>>
>>> I have CTestCustom.cmake.in file in source tree with the following
>>> contents
>>>
>>>
>>> https://git.orfeo-toolbox.org/otb.git/blob/refs/heads/develop:/CMake/CTestCustom.cmake.in
>>>
>>> during ctest build CTestCustom.cmake file is getting generated inside the
>>> build tree.
>>>
>>> But however the warnings are not filtered out on the dashboard. For
>>> instance, see the dashboard submission
>>> http://dash.orfeo-toolbox.org/viewBuildError.php?type=1&buildid=206112
>>>
>>> and see the exception for vcl_deprecated_header
>>>
>>>
>>> https://git.orfeo-toolbox.org/otb.git/blob/refs/heads/develop:/CMake/CTestCustom.cmake.in#l69
>>>
>>> The warning appears on dashobard anyway. Can someone point me in the
>>> right direction. ?
>>>
>>> Thanks in advance.
>>>
>>>
>>> CMake Version:
>>> 2.8.12.2
>>>
>>> CDash Version:
>>> 2.2.3
>>>
>>> uname -a
>>> Linux ubuntu
>>>
>>>  3.13.0-65-generic #106-Ubuntu SMP Fri Oct 2 22:08:27 UTC 2015 x86_64
>>> x86_64 x86_64 GNU/Linux
>>> --
>>> Regards,
>>>Rashad
>
>
>
>
> --
> Regards,
>Rashad
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] [CDash] CTEST_CUSTOM_WARNING_EXECPTION

2015-11-05 Thread David Cole via CMake
Does your ctest -S script call ctest_read_custom_files
https://cmake.org/cmake/help/v3.4/command/ctest_read_custom_files.html
after ctest_configure?


On Thursday, November 5, 2015, Rashad M  wrote:

> Hello all,
>
> I have CTestCustom.cmake.in file in source tree with the following
> contents
>
>
> https://git.orfeo-toolbox.org/otb.git/blob/refs/heads/develop:/CMake/CTestCustom.cmake.in
>
> during ctest build CTestCustom.cmake file is getting generated inside the
> build tree.
>
> But however the warnings are not filtered out on the dashboard. For
> instance, see the dashboard submission
> http://dash.orfeo-toolbox.org/viewBuildError.php?type=1&buildid=206112
>
> and see the exception for vcl_deprecated_header
>
>
> https://git.orfeo-toolbox.org/otb.git/blob/refs/heads/develop:/CMake/CTestCustom.cmake.in#l69
>
> The warning appears on dashobard anyway. Can someone point me in the right
> direction. ?
>
> Thanks in advance.
>
>
> CMake Version:
> 2.8.12.2
>
> CDash Version:
> 2.2.3
>
> uname -a
> Linux ubuntu
>
>  3.13.0-65-generic #106-Ubuntu SMP Fri Oct 2 22:08:27 UTC 2015 x86_64
> x86_64 x86_64 GNU/Linux
> --
> Regards,
>Rashad
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Cmake not working for VS13

2015-11-05 Thread David Cole via CMake
What version of Visual Studio do you have installed?


On Thursday, November 5, 2015, Nikita Barawade <
nikita.baraw...@einfochips.com> wrote:

> Hi,
>
>
> New to cmake utility,
>
> I am trying to build sample program given here
> https://cognitivewaves.wordpress.com/cmake-and-visual-studio/ with VS13
> on windows 7.
>
> Getting following error:
>
> CMake Error at CMakeLists.txt:5 (project): No CMAKE_C_COMPILER could be
> found.
>
> CMake Error at CMakeLists.txt:5 (project): No CMAKE_CXX_COMPILER could be
> found.
>
>
> I searched on Internet but not getting required info.
>
>
> Note:
>
> cmake version 3.4.0
>
> using native compiler option to configure.
>
>
>
> Can anyone give some pointers ?
>
>
> CMake and Visual Studio | Cognitive Waves
> 
> cognitivewaves.wordpress.com
> Introduction Visual Studio to CMake Mapping Example Source Structure
> Execute CMake Visual Studio Solution Explorer View Build and Run
>
>
>
> Regards,
> Nikita
>
> *
> eInfochips Business Disclaimer: This e-mail message and all attachments
> transmitted with it are intended solely for the use of the addressee and
> may contain legally privileged and confidential information. If the reader
> of this message is not the intended recipient, or an employee or agent
> responsible for delivering this message to the intended recipient, you are
> hereby notified that any dissemination, distribution, copying, or other use
> of this message or its attachments is strictly prohibited. If you have
> received this message in error, please notify the sender immediately by
> replying to this message and please delete it from your computer. Any views
> expressed in this message are those of the individual sender unless
> otherwise stated. Company has taken enough precautions to prevent the
> spread of viruses. However the company accepts no liability for any damage
> caused by any virus transmitted by this email.
> *
>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] add_custom_command not triggered

2015-10-31 Thread David Cole via CMake
Oh wait, I read it wrong...

Try ${} to get the value of the variable. (It contains a file name, right?)


D



On Saturday, October 31, 2015, David Cole  wrote:

> Because you're giving DEPENDS as a target name, this is only an ordering
> dependency, stating that the command should run after the target is built.
> But not necessarily re-build whenever the target is re-built...
>
> If you want to re-run the command based on a file changing instead, then
> use the full path to a file name as your DEPENDS argument. The downloaded
> file itself, or the extracted data file the command uses would probably be
> reasonable choices.
>
> Read the DEPENDS section of
> https://cmake.org/cmake/help/v3.3/command/add_custom_command.html
> carefully.
>
>
> HTH,
> David C.
>
>
> On Saturday, October 31, 2015, Nico Schlömer  > wrote:
>
>> After downloading a file with ExternalData_Expand_Arguments [1], I would
>> like to execute a command on the data to produce another file. So far, I
>> have
>> ```
>> ExternalData_Expand_Arguments(
>>   noshTestFetchData
>>   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test/data/${file}}
>> )
>> ExternalData_Add_Target(noshTestFetchData)
>>
>> add_custom_command(
>>   OUTPUT ${CMAKE_BINARY_DIR}/test/data/pacman.e.2.0
>>   COMMAND decomp -p 2 ${CMAKE_BINARY_DIR}/test/data/pacman.e
>>   DEPENDS noshTestFetchData
>> )
>> ```
>> The file is downloaded alright, but the `add_custom_command` is never
>> triggered. Why not?
>>
>> This is with CMake 3.2.2.
>>
>> Cheers,
>> Nico
>>
>> [1] https://cmake.org/cmake/help/v3.3/module/ExternalData.html
>>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] add_custom_command not triggered

2015-10-31 Thread David Cole via CMake
Because you're giving DEPENDS as a target name, this is only an ordering
dependency, stating that the command should run after the target is built.
But not necessarily re-build whenever the target is re-built...

If you want to re-run the command based on a file changing instead, then
use the full path to a file name as your DEPENDS argument. The downloaded
file itself, or the extracted data file the command uses would probably be
reasonable choices.

Read the DEPENDS section of
https://cmake.org/cmake/help/v3.3/command/add_custom_command.html carefully.


HTH,
David C.


On Saturday, October 31, 2015, Nico Schlömer 
wrote:

> After downloading a file with ExternalData_Expand_Arguments [1], I would
> like to execute a command on the data to produce another file. So far, I
> have
> ```
> ExternalData_Expand_Arguments(
>   noshTestFetchData
>   OUT_DATA DATA{${CMAKE_SOURCE_DIR}/test/data/${file}}
> )
> ExternalData_Add_Target(noshTestFetchData)
>
> add_custom_command(
>   OUTPUT ${CMAKE_BINARY_DIR}/test/data/pacman.e.2.0
>   COMMAND decomp -p 2 ${CMAKE_BINARY_DIR}/test/data/pacman.e
>   DEPENDS noshTestFetchData
> )
> ```
> The file is downloaded alright, but the `add_custom_command` is never
> triggered. Why not?
>
> This is with CMake 3.2.2.
>
> Cheers,
> Nico
>
> [1] https://cmake.org/cmake/help/v3.3/module/ExternalData.html
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] include_external_msproject, add_dependencies and build type (debug/release)

2015-10-27 Thread David Cole via CMake
CMAKE_BUILD_TYPE is not typically used/useful with the Visual Studio
generators. You may want to look into using the CMAKE_CFG_INTDIR
variable instead.

https://cmake.org/cmake/help/v3.3/variable/CMAKE_CFG_INTDIR.html



On Tue, Oct 27, 2015 at 8:06 AM, Holzinger, Axel  (ALC NetworX GmbH)
 wrote:
> Hi list,
>
> I'm on my wits end with include_external_msproject, add_dependencies and 
> build type.
>
> This is the situation: I have a CMake project with an external static library 
> A which is included in the build via include_external_msproject, a static 
> library B and a binary C.
>
> B is depemding on A
> C is depending on B
>
> My upper (above the directories for B and C) CMakeLists.txt looks like this:
>
> include_external_msproject(A ${CMAKE_SOURCE_DIR}/A.vcxproj)
>
> The CMakeLists.txt for B has these (and other) parts:
>
> cmake_policy(GET CMP0046 cmp)
> if (NOT cmp STREQUAL "OLD")
> cmake_policy(SET CMP0046 OLD)
> endif ()
> add_dependencies (B A)
> cmake_policy(SET CMP0046 NEW)
> target_link_libraries(B ${CMAKE_BINARY_DIR}/Win32/${CMAKE_BUILD_TYPE}/A.lib)
>
> The CMakeLists.txt for C has these (and other) parts:
>
> target_link_libraries(C B)
>
> In reality there are othe libs too. I reduced complexity to make it easier to 
> understand the scenario.
>
> The stuff above works fine for CMAKE_BUILD_TYPE=Debug, meaning in Visual 
> Studio 2013 in the project build dependencies for B I see that it's depending 
> on A and so the build order is A first then B. The project build dependencies 
> for C say that the binary is depending on B and A and the build oreder is A 
> first, then B and then C.
>
> Perfect.
>
> But with CMAKE_BUILD_TYPE=Release I see that B is depending on A, but C is 
> ONLY depending on B, but NOT on A.
>
> Can anybody explain what's going on? Any hint would be greatly appreciated.
>
> Thank you
> Axel
>
> PS: I know that setting policies to OLD isn't the nice way, but I don't know 
> of any other solution the depend on a external Visual Studio project.
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] CMake 3.3 and 3.2 bootstrap fails on OS X Yosemite

2015-10-01 Thread David Cole via CMake
The "-1" bz2 files are for Cygwin...

Try the plain old .tar.gz instead.


David

> On Oct 1, 2015, at 7:51 PM, Damian Rouson  
> wrote:
> 
> All,
> 
> Could someone advise me on building CMake from source on OS X 10.10.5 
> (Yosemite)?  At the bottom of this email is the tail of the output from the 
> following build script: 
> 
> #!/bin/bash
> version=3.3
> wget http://www.cmake.org/files/v$version/cmake-$version.0-1-src.tar.bz2 &&
> tar xvjf cmake-$version.0-1-src.tar.bz2 &&
> tar xvjf cmake-$version.0.tar.bz2 &&
> cd cmake-$version.0  &&
> ./bootstrap --prefix=${PWD} >&1 | tee build.log
> 
> An identical script completes successfully on Linux (Lubuntu).   The complete 
> output of the above script in the “build.log” file at 
> https://github.com/sourceryinstitute/AdHoc/tree/master/src/cmake/bug-.  A 
> link to the resulting “cmake_bootstrap.log” file is on the same page. 
> 
> I get the same error with CMake 3.2.3 and have reported this behavior in 
> CMake bug report 0015762 (https://cmake.org/Bug/view.php?id=15762).
> 
> 
> 
> Damian Rouson, Ph.D., P.E.
> President, Sourcery Institute
> http://www.sourceryinstitute.org
> +1-510-600-2992 (mobile)
> 
> 
> 
> 
> g++ 
> -I/Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Bootstrap.cmk
>  
> -I/Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Source
>  
> -I/Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Bootstrap.cmk
>  -c 
> /Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Source/cmBootstrapCommands1.cxx
>  -o cmBootstrapCommands1.o
> In file included from /usr/include/dispatch/dispatch.h:51:0,
> from 
> /System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15,
> from 
> /System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13,
> from 
> /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55,
> from 
> /Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Source/cmFindProgramCommand.cxx:16,
> from 
> /Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Source/cmBootstrapCommands1.cxx:52:
> /usr/include/dispatch/object.h:143:15: error: expected unqualified-id before 
> '^' token
> typedef void (^dispatch_block_t)(void);
>   ^
> /usr/include/dispatch/object.h:143:15: error: expected ')' before '^' token
> /usr/include/dispatch/object.h:362:3: error: 'dispatch_block_t' has not been 
> declared
>   dispatch_block_t notification_block);
>   ^
> make: *** [cmBootstrapCommands1.o] Error 1
> -
> Error when bootstrapping CMake:
> Problem while running make
> -
> Log of errors: 
> /Users/rouson/Code/sourceryinstitute/AdHoc/src/cmake/bug-/cmake-3.3.0/Bootstrap.cmk/cmake_bootstrap.log
> 
> 
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] CDash [Safe Numerics] - Administration

2015-09-27 Thread David Cole via CMake
This message is sent when an unparseable xml file is submitted to CDash.
The email says the contents are as follows, with nothing (the empty string)
following... So, usually, this is some bot sending garbage to your CDash
url. There is nothing for you to do, but ignore these. If they are too
frequent, and coming from a suspicious IP address, you can ban submissions
from that IP address.

HTH,
David C.


On Sunday, September 27, 2015, Robert Ramey  wrote:

> I see that some people are posting results to my dashboard
> http://my.cdash.org/index.php?project=Safe+Numerics&filtercount=1&showfilters=1&field1=buildstarttime/date&compare1=83&value1=1%20year%20ago
> - but lately I’ve been getting the following message.  Unfortunately, the
> message doesn’t tell me what to change to make this work!  So I need some
> help.  Any suggestions appreciated.
>
>
> Begin forwarded message:
>
> From: CDash 
> Subject: CDash [Safe Numerics] - Administration
> Date: September 23, 2015 at 2:54:51 PM PDT
> To: ad...@cdash.org, ra...@rrsd.com
> Reply-To: nore...@cdash.org
>
> Object: Cannot create handler based on XML content
> An XML submission from 41.220.69.175 to the project Safe Numerics cannot
> be parsed. The content of the file is as follow:
>
> -CDash on my.cdash.org
>
>
> Robert Ramey
> Robert Ramey Software Development
> (805)569-3793
> ra...@rrsd.com
> www.rrsd.com
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Imported libraries and cross platform target names

2015-08-21 Thread David Cole via CMake
Find_library results are cached. If you want to re-find a potentially moved
library every time you run, you would have to unset the cache variable
prior to finding it.

D


On Thursday, August 20, 2015, Ette, Anthony (CDS) <
anthony.r.e...@controlsdata.com> wrote:

> Ok so I’ve got this going now (kind of) but FIND_LIBRARY doesn’t seem to
> update when the specified PATH changes.  Since we are developing and
> releasing our own static libraries on a separate development cycle from the
> final applications, a final application may use a different library release
> than another.  This means the application developer needs a method to point
> to different library releases (different locations on the filesystem).
> We’ve always used environment variables for this and the developer issues a
> “workon” prior to developing an application.  The workon sets up all the
> necessary env vars but FIND_LIBRARY doesn’t update when the env var does.
> For example, using either method 1 or 2 below to set an internal cmake
> variable doesn’t do the trick for the FIND_LIBRARY command to pick up a new
> libtest file in the new location.
>
>
>
>
>
> 1)  FILE(TO_CMAKE_PATH $ENV{LIB_DIR} LIB_D)
>
> 2)  SET(LIB_D $ENV{LIB_DIR} CACHE STRING "lib dir" FORCE)
>
>
>
> FIND_LIBRARY(libtest NAMES test PATHS {LIB_D} NO_DEFAULT_PATH)
>
>
>
>
>
>
>
> I’ve also tried using the env string directly in the FIND_LIBRARY command
> as below, but the library being used in the build tree Makefiles still does
> not get updated.  I’ve also confirmed that the env var *is*  updated when
> CMake is rerun using MESSAGE command, so I believe it is merely a problem
> with triggering a change to the FIND_LIBRARY command.  How does this
> triggering work?  How can I force FIND_LIBRARY to check again each time
> CMake runs?
>
>
>
> FIND_LIBRARY(libtest NAMES test PATHS $ENV{LIB_DIR}
> NO_DEFAULT_PATH)
>
>
>
>
>
> Thanks,
>
>
> *Anthony Ette *Control Systems Engineer
>
>
>
> Rolls-Royce Controls and Data Services
>
> 7661 N Perimeter Rd
>
> Indianapolis, IN 46241
>
> tel: +1 (317) 230-6943
>
> mob: +1 (317) 864-7975
>
> email: anthony.r.e...@controlsdata.com
> 
>
>
>
> *From:* Parag Chandra [mailto:pa...@ionicsecurity.com
> ]
> *Sent:* Tuesday, August 18, 2015 3:08 PM
> *To:* Ette, Anthony (CDS); CMake@cmake.org
> 
> *Subject:* Re: [CMake] Imported libraries and cross platform target names
>
>
>
> Yes, very similar. When I set out to convert our existing build system,
> which consists of many individual .sln and .vcxproj files, I got a
> requirement that the developers do not all want to work out of the same
> “uber” Xcode workspace/VS solution that contains all of the projects. They
> want to continue working with solutions that contain only the library of
> interest plus its associated test project. So when a developer runs CMake,
> a dependency like “timer” may refer to another CMake-generated project
> within the current build system, or it may refer to an
> already-built/downloaded dependency of the same name.
>
>
> *Parag Chandra*
> Senior Software Engineer, Mobile Team
> Mobile: +1.919.824.1410
>
> 
>
> Ionic Security Inc.
> 1170 Peachtree St. NE STE 400, Atlanta, GA 30309
>
>
>
> *From: *, "Anthony (CDS)"  >
> *Date: *Tuesday, August 18, 2015 at 2:59 PM
> *To: *Parag Chandra  >, "
> CMake@cmake.org " <
> CMake@cmake.org >
> *Subject: *RE: [CMake] Imported libraries and cross platform target names
>
>
>
> Thank you, I will take a look at find_library.  The static libraries are
> ones we build in-house but in a separate CMake-generated build system.  The
> reason we use a separate build system is because our common library code is
> used by all applications and, as such, is on a separate development cycle
> than the applications themselves.  In other words, while there may be
> advantages to combining them, I don’t think it would really make sense in
> our case….any thoughts?  Are you in a similar situation?
>
>
>
>
> *Anthony Ette *Control Systems Engineer
>
>
>
> Rolls-Royce Controls and Data Services
>
> 7661 N Perimeter Rd
>
> Indianapolis, IN 46241
>
> tel: +1 (317) 230-6943
>
> mob: +1 (317) 864-7975
>
> email: anthony.r.e...@controlsdata.com
> 
>
>
>
> *From:* Parag Chandra [mailto:pa...@ionicsecurity.com
> ]
> *Sent:* Tuesday, August 18, 2015 2:45 PM
> *To:* Ette, Anthony (CDS); CMake@cmake.org
> 
> *Subject:* Re: [CMake] Imported libraries and cross platform target names
>
>
>
> You just specify the “basename” of the library, so something like this:
>
>
>
> find_library (timer NAMES timer PATHS your/library/directory)
>
> target_link_libraries(test timer)
>
>
>
> And Cmake takes care of the rest. It’s even easier if “timer” is also part
> of the same CMake-generated build system. In that case, the find_library
> isn’t even needed.
>
>
>
> Things do get a little more complicated when you want to distinguish
> between release/debug variants of the same library. For that you can use
> the DEBUG and OPTIMI

Re: [CMake] Does SET_TARGET_PROPERTIES(foo PROPERTIES INSTALL_RPATH /path1; /path2) still silently ignore path2?

2015-08-11 Thread David Cole via CMake
A totally reasonable suggestion. Patches welcome. ;-)


On Tuesday, August 11, 2015, Dan Kegel  wrote:

> Aha.  Well, how about sanity checks on the names of the properties?
> Maybe a new policy could be added that property names have to be
> declared (and the ones supported by cmake itself would be predeclared,
> of course), and setting an undeclared one would throw an error.
>
> On Tue, Aug 11, 2015 at 6:57 AM, David Cole  > wrote:
> > The final args to set_target_properties are any number of name/value
> pairs:
> >
> > http://www.cmake.org/cmake/help/v3.3/command/set_target_properties.html
> >
> > The only thing we could do there is look for an even number of args, and
> > catch possible problems half the time... I'm not sure if there are any
> > restrictions on property names, but for this command, and its historical
> > args composition, we are stuck with "prop1 value1 prop2 value2 ..." as
> the
> > final args.
> >
> > Having said all that, there are some checks on the args to the function,
> so
> > it looks like you got "unlucky" with the number of paths in the prop
> value.
> > I would advise against playing roulette for a while... ;-)
> >
> >
> https://github.com/Kitware/CMake/blob/422d3f68/Source/cmSetTargetPropertiesCommand.cxx#L36-L40
> >
> >
> > HTH,
> > David C.
> >
> >
> > On Tuesday, August 11, 2015, Dan Kegel >
> wrote:
> >>
> >> Thanks.  Should set_target_properties throw an error if given too many
> >> arguments, to catch this problem?
> >>
> >> Am 10.08.2015 11:43 nachm. schrieb "Nils Gladitz" <
> nilsglad...@gmail.com >:
> >>>
> >>> On 08/11/2015 12:51 AM, Dan Kegel wrote:
> 
>  With cmake 2.8.12.2,
> 
>  SET_TARGET_PROPERTIES (foo PROPERTIES INSTALL_RPATH
> ${my_install_rpath})
> 
>  silently only obeys the first directory in the rpath, but
> 
>  SET_TARGET_PROPERTIES (foo PROPERTIES INSTALL_RPATH
>  "${my_install_rpath}")
> 
>  works.  Is it still that way in the latest cmake, and is there
>  already a bug for this?  I looked,
>  but didn't see one.
> >>>
> >>>
> >>> It should still be this way.
> >>>
> >>> The command takes any number of key value pairs where each key and
> value
> >>> are a single argument.
> >>>
> >>> A CMake list when expanded unquoted results in one argument per list
> >>> item.
> >>>
> >>> When a list is quoted it is a single argument.
> >>>
> >>> Expansion of variables happens before the command itself gets its
> >>> arguments.
> >>>
> >>> Without the quotes the first item in my_install_rpath will be
> interpreted
> >>> as a value while the second will be a key etc.
> >>>
> >>> It might therefor be more of a language rather than command specific
> >>> issue.
> >>>
> >>> One clean alternative is to use set_property() instead since unlike
> >>> set_target_properties() it takes a single key but any number of value
> >>> arguments.
> >>>
> >>> 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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Does SET_TARGET_PROPERTIES(foo PROPERTIES INSTALL_RPATH /path1; /path2) still silently ignore path2?

2015-08-11 Thread David Cole via CMake
The final args to set_target_properties are any number of name/value pairs:

http://www.cmake.org/cmake/help/v3.3/command/set_target_properties.html

The only thing we could do there is look for an even number of args, and
catch possible problems half the time... I'm not sure if there are any
restrictions on property names, but for this command, and its historical
args composition, we are stuck with "prop1 value1 prop2 value2 ..." as the
final args.

Having said all that, there are some checks on the args to the function, so
it looks like you got "unlucky" with the number of paths in the prop value.
I would advise against playing roulette for a while... ;-)

https://github.com/Kitware/CMake/blob/422d3f68/Source/cmSetTargetPropertiesCommand.cxx#L36-L40


HTH,
David C.


On Tuesday, August 11, 2015, Dan Kegel  wrote:

> Thanks.  Should set_target_properties throw an error if given too many
> arguments, to catch this problem?
> Am 10.08.2015 11:43 nachm. schrieb "Nils Gladitz"  >:
>
>> On 08/11/2015 12:51 AM, Dan Kegel wrote:
>>
>>> With cmake 2.8.12.2,
>>>
>>> SET_TARGET_PROPERTIES (foo PROPERTIES INSTALL_RPATH ${my_install_rpath})
>>>
>>> silently only obeys the first directory in the rpath, but
>>>
>>> SET_TARGET_PROPERTIES (foo PROPERTIES INSTALL_RPATH
>>> "${my_install_rpath}")
>>>
>>> works.  Is it still that way in the latest cmake, and is there
>>> already a bug for this?  I looked,
>>> but didn't see one.
>>>
>>
>> It should still be this way.
>>
>> The command takes any number of key value pairs where each key and value
>> are a single argument.
>>
>> A CMake list when expanded unquoted results in one argument per list item.
>>
>> When a list is quoted it is a single argument.
>>
>> Expansion of variables happens before the command itself gets its
>> arguments.
>>
>> Without the quotes the first item in my_install_rpath will be interpreted
>> as a value while the second will be a key etc.
>>
>> It might therefor be more of a language rather than command specific
>> issue.
>>
>> One clean alternative is to use set_property() instead since unlike
>> set_target_properties() it takes a single key but any number of value
>> arguments.
>>
>> 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://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] emulating cmake-gui behaviour with cmake commandline on windows

2015-08-07 Thread David Cole via CMake
It's in the bug database here:
http://www.cmake.org/Bug/view.php?id=15134

Not sure how easy it would be to fix...

Also, this CLOSED bug is in there (and some related issues):
http://www.cmake.org/Bug/view.php?id=10072


D



On Fri, Aug 7, 2015 at 12:37 PM, Johannes Schauer  wrote:
> Hi,
>
> Quoting David Cole (2015-08-07 18:27:40)
>> Put your source in a sub-directory. CMake simply does not work at the
>> root of a drive letter on Windows. CMakeLists.txt MUST be in at least
>> one sub-directory underneath a root drive letter path.
>
> oh wow that was a simple fix. Thanks for the quick reply!
>
> Is this documented anywhere?
>
> Maybe there could be a warning somewhere if one attempts to have the source
> directory directly at the root of a drive letter on windows?
>
> But then why does it work with cmake-gui on windows?
>
> Is this a bug that can be fixed?
>
> Thanks!
>
> cheers, josch
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] emulating cmake-gui behaviour with cmake commandline on windows

2015-08-07 Thread David Cole via CMake
Put your source in a sub-directory. CMake simply does not work at the
root of a drive letter on Windows. CMakeLists.txt MUST be in at least
one sub-directory underneath a root drive letter path.


HTH,
David C.



On Fri, Aug 7, 2015 at 5:08 AM, Johannes Schauer  wrote:
> Hi,
>
> I am trying to build the CMake project 3dtk with the following CMakeLists.txt:
> https://sourceforge.net/p/slam6d/code/HEAD/tree/trunk/CMakeLists.txt
>
> This works well on linux with ccmake and also on windows with cmake-gui.
>
> Now I'm trying to let it work on windows with the cmake command line program 
> to
> automate the configuration. Unfortunately I'm running into a problem with 
> cmake
> on windows that I did not encounter with cmake-gui.
>
> The CMakeLists.txt file at several occasions uses the add_subdirectory
> directive but always without the second argument (the build_dir). This seems 
> to
> work fine for cmake-gui on windows and ccmake on linux. But with cmake on
> windows I now get the following message for every add_subdirectory directive:
>
> CMake Error at Z:/CMakeLists.txt:471 (add_subdirectory):
>   add_subdirectory not given a binary directory but the given source
>   directory "Z:/src/slam6d" is not a subdirectory of "Z:/". When specifying
>   an out-of-tree source a binary directory must be explicitly specified.
>
> This error message is also strange because clearly, "Z:/src/slam6d" is a
> subdirectory of "Z:/".
>
> I would like to know the command line option that I have to supply to cmake on
> windows to get the same behaviour as with cmake-gui on windows.
>
> In my case, the source is in Z:/ and in cmake-gui I specify
> "Z:/lib64-msvc-12.0" as the value of "Where to build the binaries" and as
> explained above this works completely well.
>
> But after successfully configuring and generating the project in
> "Z:/lib64-msvc-12.0" using the cmake-gui method, when I cd into
> "Z:/lib64-msvc-12.0" and just run "cmake .." I get the error messages above.
>
> Same happens when I create a new directory "Z:/cmaketest", cd into it and then
> run "cmake ..", I again get the errors above.
>
> So in summary, with or without an existing CMakeCache.txt, I'm running into 
> the
> error messages above on windows when using cmake (and not cmake-gui). So I
> suspect that I'm missing an option to cmake to make it behave like cmake-gui.
>
> I don't think my CMakeLists.txt is the culprit because that one works totally
> fine on linux and also works well with cmake-gui.
>
> What could the problem be?
>
> Thanks!
>
> cheers, josch
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] on cmake supporting one arch per project (from CMake IR)

2015-08-04 Thread David Cole via CMake
There's nothing wrong with that approach, per se, it simply "doesn't
feel natural" to Xcode and Visual Studio users.

Xcode and Visual Studio users building modern apps for multiple
targeted platforms (phone, tablet, simulated phone/tablet, desktop,
other) are used to switching the target platform in the IDE somewhere
**within a single project file** for non-CMake-generated project
files. Forcing them to have multiple Xcode or VS project files, one
each for each of their platforms (and configs) feels like a lot of
work somehow.

The only thing "wrong" with your approach is you have to spend a lot
of time convincing people that CMake is worth it, when all they want
to do is open a project file and build. They don't want to have to
manage a slew of build trees and project files, when it seems like it
ought to be "done already" with what's readily available in the UI...

I totally understand this, and get it. And I still love CMake despite
this particular shortcoming. ;-)


David C.




On Tue, Aug 4, 2015 at 5:10 PM, Tamás Kenéz  wrote:
> On 2015-07-30 11:51:54 GMT, Nagy-Egri Máté Ferenc via CMake wrote:
>
>> how on Earth am I going to build x86/x64/ARM targets from one VS solution?
>> [...]
>> the way how CMake has been designed immediately rules it out from ~75% of
>> application development going on in the world in the future (mobile app
>> devel)
>
> Well, we are building Android and iOS projects with CMake and we simply
> configure separate build dirs for each architecture. We even need to
> configure seperate dirs for Debug and Release builds for the makefile
> generators.
>
> It doesn't feel like a problem for us. We simply adapt our workflows to it.
> Is there anything wrong with this approach we don't recognize?
>
> Tamas Kenez
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] ARGVx "inherited" by sub-functions?

2015-08-03 Thread David Cole via CMake
You could argue bug or feature depending on your point of view. (I'd lean
toward bug, as it is rather unexpected...) However, it has been that way
for quite some time, (ever since function was added?), so it may require a
new policy to fix, since some function calls from inside functions may be
accidentally depending on the current behavior.


D


On Monday, August 3, 2015, Paul Smith  wrote:

> Is this a known thing, or a bug (I'm using cmake 3.1.0):
>
> I create this CMakeLists.txt:
>
>   cmake_minimum_required(VERSION 3.1.0)
>   project(ArgTest)
>
>   function(FOO one two)
> message(STATUS "extra args are ${ARGN}")
> message(STATUS "third arg is ${ARGV2}")
>   endfunction()
>
>   function(BAR one)
> FOO(${one} TWO)
> message(STATUS "do something with ${ARGN}")
>   endfunction()
>
>   BAR(ONE N1 N2 N3 N4)
>
> Note how I invoke BAR() with 5 arguments, but BAR invokes FOO with only
> two arguments.  I would expect that the third argument ${ARGV3} would be
> empty in function FOO.
>
> However, when I run cmake on this file it shows:
>
>   -- extra args are
>   -- third arg is N2
>   -- do something with N1;N2;N3;N4
>
> So the ARGN for function FOO is correct (nothing there) but FOO has
> "inherited" the extra ARGVx arguments beyond the first two, that I
> passed to function BAR!
>
> That's rather unexpected.  Bug or feature?
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] CDash problems

2015-08-03 Thread David Cole via CMake
OK, I finally have a build of boost I can rely on which enables me to
try this out for you again.

Using the following source tree, I am able to get a successful build &
test of Safe Numerics, other than a couple of warnings, and it
actually submits to the CDash dashboard, no problem.


Source tree:

davidcole@TRIVET /c/dev/repos/safe_numerics (master)
$ git log -1
commit 569dc083c96845f06c5bf7a9d9d6756fd45d43bd
Author: Robert Ramey 
Date:   Sun Feb 1 21:14:12 2015 -0800

updated html documentation


Script used to build and submit dashboard (w/ CMake 3.3.0, ninja, MS
compiler from Visual Studio 2013, and a boost install with "system"
layout):

@rem Windows cmd script "build-SafeNumerics.cmd"
setlocal

set build_dir=%~n0
rmdir /q /s "%build_dir%"
mkdir "%build_dir%"

pushd "%build_dir%"
cmake ^
  -DBOOST_ROOT=C:\dev\NSB\x86\Release\boost ^
  -DCMAKE_BUILD_TYPE=Release ^
  -G Ninja C:\dev\repos\safe_numerics\CMake
ninja Experimental
popd

endlocal


Results:

http://my.cdash.org/buildSummary.php?buildid=803237


When I update to most recent master (source at commit 78111d12), it
still submits, but there are build errors in it:

http://my.cdash.org/buildSummary.php?buildid=803238


The CMake/CDash stuff looks reasonable from my perspective. I haven't
dug into all the details or anything, but it basically works, provided
you have a boost install to point it to. I have no problems at all
submitting dashboards for this project. If you want, I actually have a
machine at work that is already submitting some open source dashboards
-- if you'd like, I can add a Nightly run for Safe Numerics in this
Windows/VS2013 environment since it is small and quick to run.


HTH,
David C.


On Thu, Jun 25, 2015 at 12:16 PM, David Cole  wrote:
> I cloned your project [Safe
> Numerics](https://github.com/robertramey/safe_numerics) to try to help
> you out by attempting to reproduce this problem.
>
> I see the most recent activity is in the "policies" branch, but I
> don't see anything in the whole repo, in either 'master' or 'policies'
> branches that refer to how to build it via CMake, or how to attempt to
> submit a CDash build...
>
> I browsed through the html docs and did a 'git grep -i experimental'
> to no avail.
>
> Do you have build instructions? Should I just configure using the
> "CMake/CMakeLists.txt" file and then try to build the Experimental
> target? Will it build ok on Windows with VS 2013, or Ninja plus that
> compiler?
>
>
> Thx,
> David C.
>
>
> On Thu, Jun 25, 2015 at 10:44 AM, Robert Ramey  wrote:
>> I set up a project on the cdash.org website.
>>
>> When I invoke the "experimental" target it runs the tests and uploads the
>> results to cdash.org.  So far so good. In my github project and
>> documentation I've encouraged uses of this project to use CMake to build it
>> and test it and run the "experimental" target so that their test results
>> will also appear on the cdash dashboard.  But when someone other than myself
>> tries to do this, I get an emal from ad...@cdhash.org which says:
>>
>> Object: Cannot create handler based on XML content
>> An XML submission from 42.156.137.83 to the project Safe Numerics cannot be
>> parsed. The content of the file is as follow:
>>
>> -CDash on my.cdash.org
>>
>> What do I have to do to find out the problem and fix this?
>>
>> The project is "Safe Numerics"
>>
>> http://my.cdash.org/index.php?project=Safe+Numerics
>>
>>
>> Robert Ramey
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] List of files not containing string

2015-07-30 Thread David Cole via CMake
Get the list of all files, loop over them, and filter out the ones
that DO have the string in the name ...?



On Thu, Jul 30, 2015 at 4:05 PM, Crast, Nicholas
 wrote:
> All,
>
>
>
> This seems like a pretty simple task, but I cannot figure out a good way to
> do it. I want to get a list of all files in a directory that do not have a
> certain string in the filename.
>
>
>
> Can someone help?
>
>
>
> -Nick
>
>
>
> 
>
> Nick Crast
>
> Software Engineer
>
> Saab Sensis Corporation
>
> Phone: 315-445-5703
>
> Email: nicholas.cr...@saabsensis.com
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] [cmake-developers] CMake IR

2015-07-30 Thread David Cole via CMake
json is SOOO much sexier than XML. ;-)

On Thu, Jul 30, 2015 at 10:10 AM, Dan Kegel  wrote:
>>> The big selling point would be the ability to introduce arbitrary
>>> front-ends to CMake, not just CMakelists.txt. Every developer could
>>> choose an input language that suits their project/needs/skills.
>>
>> I don't like that idea.
>>
>> Many different languages would make supporting (as in helping
>> someone with his project) and understanding arbitrary CMake projects much 
>> harder.
>
> +1
>
> Also, adding XML of any sort to CMake would instantly taint it with 
> ugly-stink.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] CMake IR

2015-07-29 Thread David Cole via CMake
And I wouldn't give up just yet on building support for this into
CMake, if not building the entire thing into a future CMake. Perhaps
there are valid objections, or perhaps people just need convincing.

D


On Wed, Jul 29, 2015 at 8:51 AM, Nagy-Egri Máté Ferenc  wrote:
> Hi Nico,
>
> thank you for the idea. That idea occured to me too, trying to generate the
> CMakelists.txt script from the desired front-end. Having taken a deep dive
> into XML schemas, hardcore people even criticise W3C XML Schemas for not
> having a mathematical foundation which make it difficult to reason about
> backward compatibility of change to the schema. Using the CMake script, a
> stateful, imperative script language as an intermediate introduces even more
> threats, than using a not so well defined, but at least stateless
> datastructure like XML.
>
> Seeing that people want this idea as a seperate project more than a part of
> CMake, I thought of:
>
> defining the XML Schema of building a C++ application
> defining the XML Schema of a particluar compiler toolchain
> write a front-end in a script language of choice
> write a generator for a back-end of choice
> provide a prototype of a CMakelists.txt >> XML front-end as a
> proof-of-concept
>
>
> That way CMakelists.txt files could be used in a completeley alternate
> toolchain.
>
> Feladó: Nicolas Desprès
> Elküldve: ‎szerda‎, ‎2015‎. ‎július‎ ‎29‎. ‎13‎:‎43
> Címzett: Nagy-Egri Máté Ferenc
> Másolat: cmake@cmake.org
>
> Hi Máté,
>
> One way of doing would be to write a tool using whatever language you like,
> reading an input script written in whatever language you like, that
> generates cmake code. In such case, the modification to cmake would be
> smaller but not that simple.
>
> You can see this thread from the archive for further details:
> http://www.cmake.org/pipermail/cmake-developers/2014-May/010450.html
>
> Cheers,
> Nico
>
>
> On Wed, Jul 29, 2015 at 9:49 AM, Nagy-Egri Máté Ferenc 
> wrote:
>>
>> Dear CMake devs/users,
>>
>> I wanted to ask your opinion on something that has been troubling me
>> since… well, ever since I started using CMake. I have not found a single
>> person alive who would have said:
>>
>> “The script language of CMake is nice, intuitive and productive. Authoring
>> scripts is easy, and writing custom macros is not difficult either.”
>>
>> There are gazillions of scripting languages one could have chosen for
>> CMake (Python, Perl, Ruby, Powershell, Bash, etc.) that would allow
>> developers to reuse existing skills, or learn one that is useful elsewhere,
>> not just in terms of CMake. These languages have a lot of thought put into
>> them. They are superior to CMake’s own in just about every regard.
>>
>> I came up with an idea presented here: http://1drv.ms/1MsufbF
>>
>> Enhancements such a change could bring about:
>>
>> The big selling point would be the ability to introduce arbitrary
>> front-ends to CMake, not just CMakelists.txt. Every developer could choose
>> an input language that suits their project/needs/skills.
>> (It would also ease the custom implementations of cmake.exe itself in any
>> language, but that is just a side-effect.)
>> It would modularize the internals of CMake in a cleaner fashion
>> Facilitate the introduction of new languages understood by CMake (such as
>> work put into C# and Swift currently)
>> Would allow for configure-time validating of compiler-specific options
>> Use deferred makefile generation by default (making the implementation of
>> tools like Cotire for precompiled headers trivial to implement, as well
>> NMake batch mode, or detecting multiple/cyclic linkage, by making use of
>> global information about the build process)
>> Many features could automatically be reused by all generators. (Imagine
>> Swift, and Fortran libraries being compiled as NuGet packages and publishing
>> them without any hassle on user side, or having to implement anything in the
>> XCode generator.)
>> SIGNIFICANTLY increase interoperability with other tools. Implementing GUI
>> front-ends (such as in CLion, or Visual Studio (work in progress)) are
>> orders of magnitude simpler by generating a stateless IR, as opposed to
>> generating a stateful script.
>>
>>
>> While it is a refactor of the entire toolchain, it is something that could
>> be done incrementally, with the existing parts functioning normally.
>>
>> I believe CMake is an invaluable tool, but it could do far better. 0/10
>> CMake users I’ve met say they are “happy” CMake users. The learning curve is
>> steep, and the skills gained are not reusable. CMake could gain even greater
>> momentum (not by ditching, but) by offering alternate input languages with
>> entities (classes, functions, macros, etc.) that feel natural in the given
>> context.
>>
>> Initial feedback in my vicinity was favorable, even those with zealous
>> CMake opposition aggreed this were something awesome to pull off (though
>> they expressed their disbelief in Kitware and the community approving

Re: [CMake] CMake IR

2015-07-29 Thread David Cole via CMake
This all seems like a very good idea, and also like it will take an
enormous amount of time and effort. I'd like to help, but I have quite
limited available time these days. Let us know if there are specific
things you need help with in advancing towards an implementation of
these ideas.


David C.


On Wed, Jul 29, 2015 at 6:02 AM, Nagy-Egri Máté Ferenc  wrote:
> How many people have I asked? We are a group of 5, and have several fellows
> who have drifted off to companies each with their respective dev teams of
> 5-15 people. General tendency is that everywhere, there is 1 CMake guru, the
> rest would be better off not touching the scripts, because they do more harm
> than good.
>
> I can believe that someone coming from the autotools or GNU Make find CMake
> to be a salvation. But someone being used to Visual Studio’s Solution
> Explorer (and things generally working out-of-the-box) finds hand authoring
> scripts in a unique language that’s been documented only 2 months ago… Don’t
> get me wrong, I am an admin and spend a considerable amount of time
> scripting in various languages. It’s not the fact that I have to touch
> scripts. It’s the fact that doing so is a pain.
>
> The reason I suggested this as a CMake 4.0 feature is because I am the 11th
> person out of 10 who actually “likes” CMake a bit and cares for it. I’d
> rather empower a tool I use on a daily basis than spawn an alternative and
> spend half my life trying to winning the world over. As is the case with
> operating systems, they have accumulated so much code, there is no point in
> trying to write a new one, rather than fixing the ones that exist. Every
> respectable cross-platform project uses CMake and I have no intention of
> going against that. I’ve neither the resources (time mostly) to do that,
> neither do I like the fact of spawning ‘yet another build system’ when
> nothing prevents from enhancing one that is almost perfect.
>
> With enough feedback like yours, I might just brew something similar in a
> few years time (on the expense of my free time). I could do something just
> like the author of Invoke-Build did and brew something that only I in the
> entire world would use, even though that in some sense Invoke-Build is far
> better than GNU Make or NMake in its foundations (being a processor of
> inter-dependent jobs, and nothing else).
>
> I understand your concern with people trying to hijack a community project
> and alter it to their personal ideals. However the fact that there are
> people fighting a war for CMake-izing Boost 2.0, and the fact that Boost 1.x
> failed two attempts at doing so is because the Boost developers were
> reluctant to pick up CMake as a build system, even though it is superior to
> Boost Build in every aspect. That too, is a build system used only in Boost,
> and nowhere else in the world. (I even had an email discussion with the
> authors of such an attempt. He handed all the working scripts to the devs,
> all they should’ve do was type cmake.exe ../src, but they did not.) One of
> the reasons these attempts failed was because of the Boost dev’s love for
> their ‘own child’ (Boost Build). The other is that CMake is unfriendly for
> devs. It is better than many others, but worse than many others. When it
> works, it’s great. But getting it to work is not always as easy as one might
> like.
>
> I had an idea I felt would benefit the community (the CMake community that
> is), I thought I’d share it as an idea.
>
> ps.: I also had an email encounter with the dev of Invoke-Build about
> cooking up an Invoke-Build back-end to CMake. He had no idea CMake exists,
> but because he needed a scriptable (from Powershell that is) build system,
> he cooked up one of his own. If CMake had a PS front-end, maybe a whole
> bunch of people pick it up who don’t even know it exists because they live
> outside the cross-platform world.
>
> Feladó: Raymond Wan
> Elküldve: ‎szerda‎, ‎2015‎. ‎július‎ ‎29‎. ‎11‎:‎01
> Címzett: Nagy-Egri Máté Ferenc
> Másolat: cmake@cmake.org
>
> Hi Máté,
>
>
>
> On Wed, Jul 29, 2015 at 3:49 PM, Nagy-Egri Máté Ferenc 
> wrote:
>> I wanted to ask your opinion on something that has been troubling me
>> since…
>> well, ever since I started using CMake. I have not found a single person
>> alive who would have said:
>>
>> “The script language of CMake is nice, intuitive and productive. Authoring
>> scripts is easy, and writing custom macros is not difficult either.”
>
>
> I'm not much of an expert wih CMake but when someone says "I have not
> found a single person alive...", I would usually counter by asking how
> many people you've asked?  :-)
>
>
>> Initial feedback in my vicinity was favorable, even those with zealous
>> CMake
>> opposition aggreed this were something awesome to pull off (though they
>> expressed their disbelief in Kitware and the community approving such a
>> radical change). This mail along with the document only intends to get the
>> ball rolling and hopefully manifest 

Re: [CMake] Building gtest with ExternalProject at configure time

2015-07-25 Thread David Cole via CMake
Interesting idea.

I can say for sure one of the reasons we didn't take this approach when we
first built ExternalProject was to avoid spending significant time on
ANYTHING during the CMake configure of the main project. Deferring
everything time-consuming to build time, after the configure step, was
always top of mind...

Having said that, though, the line of division between an internal project
(add_subdirectory) and external projects has always been a source of
confusion for people coming into it fresh. So a blended approach like what
you propose here could be quite useful.

I wonder if we should add an entirely separate module for such a thing...?
Perhaps called ImportedProject or something similar.

I think adding to ExternalProject for this would be the wrong approach
because it's not really "external" anymore once you start using
add_subdirectory. I'm happy to go along with the consensus, though, if
most others think differently that this.

Thanks for your work on this idea!


David C.


On Saturday, July 25, 2015, Craig Scott  wrote:

> Hi all. I was surprised recently to find little in the way of a simple
> method to build gtest as part of a CMake project without having to either
> (a) add the gtest source to my own project or (b) use ExternalProject and
> then have to manually create import libraries for tests to link against.
> Since neither option was particularly appealing, I found a way to combine
> the best of both approaches without the downsides subsequently wrote a blog
> article showing how to do it. The general gist of it is to use
> ExternalProject to download at configure time and then add the gtest source
> to your project using add_subdirectory(). This means gtest builds with the
> same compiler and settings as the rest of your project, but it does not
> require adding the gtest source to your project tree. The gtest and
> gtest_main CMake targets are automatically available in your project
> without having to define any import libraries manually.
>
> The method I used was relatively straightforward, I create a sub-project
> in the main project's build area and build it as part of the main CMake
> step. All the sub-project does is use ExternalProject to download the gtest
> source to a defined location, so the main project then has the source
> already in place and can therefore use add_subdirectory() to bring gtest
> into your main project. It turns out that it was also easy to make the
> approach generic so it could be applied to any external CMake-based
> project. The blog article with all the details can be found here:
>
> http://crascit.com/2015/07/25/cmake-gtest/
>
> What struck me after investigating and implementing this was how useful it
> might be if ExternalProject had an option which made it run (at least some
> steps) at configure time (i.e. when CMake is run) rather than at build
> time. My approach seems to suggest it may not be all that hard, but the
> ExternalProject implementation is more involved than I wanted to pick
> apart. If anyone wants to explore it, my blog article probably shows you
> enough of a clue to how it might be possible to do it.
>
> --
> Craig Scott
> Melbourne, Australia
> http://crascit.com
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Getting Location of This File

2015-07-25 Thread David Cole via CMake
I think
http://www.cmake.org/cmake/help/v3.3/variable/CMAKE_CURRENT_LIST_FILE.html
is exactly what you're asking for, and will work in most contexts you're
thinking of. (Configuring from a top level or sub-directory CMakeLists
file, in an included file, running a CMake -P script file...)

The only thing I'd say you should watch out for is using it inside a
function you define. I think it evaluates to the location where the
function is being called from, so in that case, it would NOT be the file
it's defined in (necessarily)... I could be wrong on this point, though, so
you should double check experimentally. Or by analyzing the CMake source.


HTH,
David C.


On Saturday, July 25, 2015, J Decker  wrote:

>
>
> On Fri, Jul 24, 2015 at 9:30 PM, Daniel Dilts  > wrote:
>
>> Yes, ${CMAKE_CURRENT_SOURCE_DIR} has the path to the CMakeLists.txt file
>> that has the include() command.  Is there a variable with the path of the
>> file referenced by the include() command?
>>
> Could define such a variable before the include... then the included file
> could reference that variable?
>
>>
>> On Fri, Jul 24, 2015 at 7:40 PM, J Decker > > wrote:
>>
>>> ${CMAKE_SOURCE_DIR}  - path of the root cmake file called
>>> ${CMAKE_CURRENT_SOURCE_DIR} - path of the current cmakelists
>>>
>>> On Fri, Jul 24, 2015 at 3:02 PM, Daniel Dilts >> > wrote:
>>>
 I have a set of CMake commands that I want to place in a single file
 and have other projects use it.  The commands in the file must affect the
 scope that references it, so the declared functions, include_directories,
 etc. must affect things in the scope that includes it.

 I attempted to place these things in a file and use
 include(filename.cmake) to add the file.  This appears to work until the
 file with the include() is in a different location.

 I need the include_directories to be relative to the location of
 filename.cmake, not the CMakeLists.txt that included it.

 Is there any way to accomplish this?

 --

 Powered by www.kitware.com

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

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

 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

>>>
>>>
>>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Visual Studio solution folders with 1 item in them

2015-07-23 Thread David Cole via CMake
CMake only puts projects (libraries, executables, custom targets) inside of
solution folders. There's currently no way to add an individual file in
them directly.


D



On Thu, Jul 23, 2015 at 11:24 AM, Andrei Porumb 
wrote:

>  Hello Parag,
>
>
>
> I am very sorry to say that your suggestion achieves
> something different (similar, but different). SOURCE_GROUP creates a
> "project filter" (that's an entity under a project). A "project filter" is
> not a "solution folder" (yeah, they look very similar). Picture included
> with a solution folder and a project filter.
>
>
>
> What I want is to place some random files under the
> solution folder. These files are not CMake targets.
>
>
>
>
>
> Best Regards,
>
> Andrei Porumb
>
>
>
> "a skhizein equals to 1 software rename/dev cycle"
>
>
>
> *From:* Parag Chandra [mailto:pa...@ionicsecurity.com]
> *Sent:* Thursday, July 23, 2015 7:28 AM
> *To:* Andrei Porumb ; J Decker 
> *Cc:* cmake@cmake.org
> *Subject:* Re: [CMake] Visual Studio solution folders with 1 item in them
>
>
>
> Couldn’t you use the source_group() command to do this? That is how I
> arbitrarily group my source files into folders within Visual Studio.
>
>
>
>
> *Parag Chandra*
> Senior Software Engineer, Mobile Team
> Mobile: +1.919.824.1410
>
> [image: Image removed by sender.] 
>
> Ionic Security Inc.
> 1170 Peachtree St. NE STE 400, Atlanta, GA 30309
>
>
>
> *From: *Andrei Porumb 
> *Date: *Wednesday, July 22, 2015 at 11:27 PM
> *To: *J Decker 
> *Cc: *"cmake@cmake.org" 
> *Subject: *Re: [CMake] Visual Studio solution folders with 1 item in them
>
>
>
> What you are suggesting will  add some previously build targets to the
> solution inside a solution folder. What I want is to simply have a file
> inside a solution folder.
>
>
>
> Best Regards,
>
> Andrei Porumb
>
>
>
> "a skhizein equals to 1 software rename/dev cycle"
>
>
>
> *From:* J Decker [mailto:d3c...@gmail.com ]
> *Sent:* Wednesday, July 22, 2015 7:13 PM
> *To:* Andrei Porumb 
> *Cc:* cmake@cmake.org
> *Subject:* Re: [CMake] Visual Studio solution folders with 1 item in them
>
>
>
> globally set
>
>
>
> set_property(GLOBAL PROPERTY USE_FOLDERS On)
>
>
>
>
>
> SET_TARGET_PROPERTIES( PROPERTIES
>
>   FOLDER "folder name"
>
> )
>
>
>
>
>
>
>
>
>
> On Wed, Jul 22, 2015 at 3:04 PM, Andrei Porumb 
> wrote:
>
>  Hello CMake,
>
>
>
> Thank you for everything so far!
>
>
>
> I am migrating some cross platform projects to CMake.
> Naturally our devs (myself included) like things to look "in a certain
> way". And if "certain way" can be produced by CMake then adoption is
> smoothened.
>
>
>
> That being said, this is the issue at hand. How can I
> instruct CMake to produce some harmless Visual Studio solution folders
> having some non-target items in them? (I know how to insert targets under
> Visual Studio solution folders, but I need simple files). Like in the
> picture below. Notice that "Specs" solution folder contains 3 items, a text
> file, a bitmap and a sequenceDiagram, none of which are CMake targets.
>
>
>
>
>
> Any help is greatly appreciated.
>
>
>
> Best Regards,
>
> Andrei Porumb
>
>
>
> "a skhizein equals to 1 software rename/dev cycle"
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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 Cour

Re: [CMake] Changes to CMAKE_CXX_FLAGS_RELEASE not reflected in GUI

2015-07-23 Thread David Cole via CMake
However, be aware of two things if you do use FORCE:

If CMAKE_CXX_FLAGS_RELEASE already contains "-xHost" you will be
appending it *again* each time CMake is run in a given build tree...
So you may want some "if(NOT CMAKE_CXX_FLAGS_RELEASE MATCHES
"-xHost")" logic in there as well.

Also, using FORCE unconditionally essentially eliminates the
possibility of having an end user modify that cache value in the
cmake-gui, since you'll be overwriting it with your value. Consider
making it INTERNAL rather than having it appear in the GUI if you
really need to control its value from CMakeLists rather than allowing
end users to edit it.


HTH,
David C.



On Thu, Jul 23, 2015 at 8:22 AM, Chuck Atkins  wrote:
>> Is this the intended behavior?
>
>
> Yes.  The GUI is essentially an editor for the CMake cache.  These variables
> are persistent with global scope.  As such, only the cache values are
> reflected in the GUI.  When you set the CMAKE_CXX_FLAGS_RELEASE with this
> form of the set command, you are changing it's value in the current scope,
> but not in the cache, hence no updated value in the GUI.
>
>
>>
>> Is there a way to specify additional
>> release build flags in CMakeLists.txt and have them reflected in the
>> GUI?
>
>
> You can update the cache entry with the alternate signature for set:
>
> set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -xHost" CACHE STRING
> "Flags used by the compiler during release builds." FORCE)
>
> The "FORCE" option is necessary to change an existing cache entry.  See
> details for setting cache values here:
> http://www.cmake.org/cmake/help/v3.3/command/set.html
>
>
>> Thank you for your recommendations!
>
>
> You're welcome :-)
>
> - Chuck
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Rerun CMake partially in Visual Studio

2015-07-23 Thread David Cole via CMake
Nope.

CMake has no way of knowing whether you have logic in the lower level
CMakeLists file which affects later included projects, or which might
even possibly affect global (top level project) CMakeCache settings.
Without adding facilities to track such interconnections, the entire
tree from the top level down must be re-processed to figure out what
to generate.


HTH,
David C.



On Thu, Jul 23, 2015 at 3:01 AM, Jakob van Bethlehem
 wrote:
> Dear users,
>
> CMake has a very nice integration with Visual Studio. One problem I often
> encounter with reasonably large solutions is that one I change only one
> CMakeLists.txt file, the full solution gets regenerated. Would it possible
> somehow to *only* regenerate the project(s) that are affected by the
> CMakeLists.txt file I changed?
>
> Sincerely,
> Jakob
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] OS X framework headers with capital letters

2015-07-21 Thread David Cole via CMake
Try putting ${FOO_HEADER_FILES} in the add_library call, too.

I reproduced this by adding a file, with **ANY** name, to the
PUBLIC_HEADER list of the
[CMake/Tests/Framework/CMakeLists.txt](https://github.com/Kitware/CMake/blob/master/Tests/Framework/CMakeLists.txt)
file... but NOT adding it to the list of sources given to add_library.

It would appear from this experiment that the header files for a
framework must be listed as sources of the library **and** added to
the PUBLIC_HEADER target property.

(I am guessing that you have the other header files that are working
already in your FOO_SOURCE_FILES variable. Either that, or I'm missing
something still...)


HTH,
David C.



On Tue, Jul 21, 2015 at 1:39 PM, Steven Wilson
 wrote:
> I am saying the file does not exist in the either installed framework or in
> the framework in the build directory.   CMake is not moving the header files
> that start with a capital letter into the framework headers directory.   Now
> I did double check and it *is* moving the .hpp header that matches the name
> of the framework (Foo.hpp in the example case), but it is not copying Foo.h.
> In addition I tried adding two more arbitrary headers called AnotherHeader.h
> and AnotherHeader.hpp and neither of those get included in the framework
> either.
>
> The example I have posted is just an example.  My actual source files do not
> share names where case sensitivity is a problem.   The file names in the
> real project do not collide in any form.   I am running on a a Mac with the
> HFS+ system without case sensitivity.
>
>
>
> On Tue, Jul 21, 2015 at 12:51 PM, David Cole  wrote:
>>
>> Are you saying the file does not exist in the installed framework, or
>> that you do not see "copying Foo.h" in the install output ...? This
>> seems very unlikely. The header files are supposed to be in the
>> framework in the build tree, and the built framework in its entirety
>> is supposed to be recursively copied at install time ...
>>
>> Are you running on a Mac volume with a case sensitive file system or not?
>>
>> Are the source header files in question named with the case you've
>> listed in the CMakeLists file?
>>
>> Does this reproduce if you add another header file named
>> "AnotherHeader.h" and add it into the mix, say listing it first in the
>> list of header files?
>>
>>
>>
>>
>>
>> On Tue, Jul 21, 2015 at 12:15 PM, Steven Wilson
>>  wrote:
>> > Not to be picky, but the issue of case sensitivity ignores the original
>> > question.
>> >
>> > If it helps someone think about the issue better, change:
>> >
>> > set(FOO_HEADER_FILES "foo.h;bar.h;bat.h;Foo.h;Foo.hpp")
>> >
>> > to
>> >
>> > set(FOO_HEADER_FILES "bar.h;bat.h;Foo.h;Foo.hpp")
>> >
>> >
>> > Thanks,
>> >
>> > Steve
>> >
>> > On Tue, Jul 21, 2015 at 10:59 AM, Michael Jackson
>> >  wrote:
>> >>
>> >> to be very precise,
>> >> OS X is a "Case Preserving but NOT Case sensitive" be default. OS X
>> >> can be made to be case sensitive but no one actually recommends it.
>> >>
>> >> this means that on OS X foo.h and Foo.h resolve to be the same file,
>> >> where
>> >> as on Linux they would be 2 different files. You would have the same
>> >> issues
>> >> on Windows.
>> >>
>> >> Mike Jackson
>> >>
>> >>
>> >> On Jul 21, 2015, at 10:35 AM, Dan Kegel  wrote:
>> >>
>> >> It can't installiert both foo.h and Foo.h in the mac, better correct
>> >> your
>> >> example.
>> >>
>> >> Am 21.07.2015 5:19 vorm. schrieb "Steven Wilson"
>> >> :
>> >>>
>> >>> I've noticed that CMake 3.3.0-rc3 will not install a header file in a
>> >>> Mac
>> >>> OS X framework if the header file starts with a capital letter (either
>> >>> that
>> >>> or has the same name as the framework).
>> >>>
>> >>> For example if I have the following:
>> >>>
>> >>>
>> >>> set(FOO_HEADER_FILES "foo.h;bar.h;bat.h;Foo.h;Foo.hpp")
>> >>>
>> >>> add_library(Foo SHARED ${FOO_SOURCE_FILES})
>> >>>
>> >>> set_target_properties(Foo PROPERTIES
>> >>> FRAMEWORK ON
>> >>> OUTPUT_NAME Foo
>> >>> PUBLIC_HEADER "${FOO_HEADER_FILES}"
>> >>> )
>> >>>
>> >>> install(TARGETS Foo
>> >>>   FRAMEWORK DESTINATION "frameworks")
>> >>>
>> >>>
>> >>> Then when running 'make install' or the install target from Xcode, the
>> >>> installation step silently does not install Foo.h or Foo.hpp.
>> >>>
>> >>> This behavior seems arbitrary, wrong, and completely annoying.
>> >>>
>> >>> Comments?
>> >>>
>> >>> --
>> >>>
>> >>> 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.c

Re: [CMake] OS X framework headers with capital letters

2015-07-21 Thread David Cole via CMake
Are you saying the file does not exist in the installed framework, or
that you do not see "copying Foo.h" in the install output ...? This
seems very unlikely. The header files are supposed to be in the
framework in the build tree, and the built framework in its entirety
is supposed to be recursively copied at install time ...

Are you running on a Mac volume with a case sensitive file system or not?

Are the source header files in question named with the case you've
listed in the CMakeLists file?

Does this reproduce if you add another header file named
"AnotherHeader.h" and add it into the mix, say listing it first in the
list of header files?





On Tue, Jul 21, 2015 at 12:15 PM, Steven Wilson
 wrote:
> Not to be picky, but the issue of case sensitivity ignores the original
> question.
>
> If it helps someone think about the issue better, change:
>
> set(FOO_HEADER_FILES "foo.h;bar.h;bat.h;Foo.h;Foo.hpp")
>
> to
>
> set(FOO_HEADER_FILES "bar.h;bat.h;Foo.h;Foo.hpp")
>
>
> Thanks,
>
> Steve
>
> On Tue, Jul 21, 2015 at 10:59 AM, Michael Jackson
>  wrote:
>>
>> to be very precise,
>> OS X is a "Case Preserving but NOT Case sensitive" be default. OS X
>> can be made to be case sensitive but no one actually recommends it.
>>
>> this means that on OS X foo.h and Foo.h resolve to be the same file, where
>> as on Linux they would be 2 different files. You would have the same issues
>> on Windows.
>>
>> Mike Jackson
>>
>>
>> On Jul 21, 2015, at 10:35 AM, Dan Kegel  wrote:
>>
>> It can't installiert both foo.h and Foo.h in the mac, better correct your
>> example.
>>
>> Am 21.07.2015 5:19 vorm. schrieb "Steven Wilson"
>> :
>>>
>>> I've noticed that CMake 3.3.0-rc3 will not install a header file in a Mac
>>> OS X framework if the header file starts with a capital letter (either that
>>> or has the same name as the framework).
>>>
>>> For example if I have the following:
>>>
>>>
>>> set(FOO_HEADER_FILES "foo.h;bar.h;bat.h;Foo.h;Foo.hpp")
>>>
>>> add_library(Foo SHARED ${FOO_SOURCE_FILES})
>>>
>>> set_target_properties(Foo PROPERTIES
>>> FRAMEWORK ON
>>> OUTPUT_NAME Foo
>>> PUBLIC_HEADER "${FOO_HEADER_FILES}"
>>> )
>>>
>>> install(TARGETS Foo
>>>   FRAMEWORK DESTINATION "frameworks")
>>>
>>>
>>> Then when running 'make install' or the install target from Xcode, the
>>> installation step silently does not install Foo.h or Foo.hpp.
>>>
>>> This behavior seems arbitrary, wrong, and completely annoying.
>>>
>>> Comments?
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

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

Re: [CMake] Using ExternalProject_Add when CMakeFiles.txt is not in the root directory.

2015-07-18 Thread David Cole via CMake
The split technique should be able to help in this scenario as well,
because for the second project, which builds the code downloaded by the
first project, you can specify a different SOURCE_DIR value... (A sub
directory of the first project's source dir, for example.)

It would be nice if EP stuff were more compose-able. If you have any good
ideas for making it so, this and the dev list are the right places
to mention them.


D

On Friday, July 17, 2015, Klaim - Joël Lamotte  wrote:

>
>
> On 17 July 2015 at 20:06, Bradley Lowekamp  > wrote:
>
>> Hello,
>>
>> David Cole just said the solution in another post.
>>
>> You can split the project into two, with the first one being just the
>> download step, the second is the configuration and build. This should allow
>> you to configure the paths for your project correctly.
>>
>>
> I am not 100% sure that the split can solve this problem too, but I will
> try it.
>
> Now that I have the split trick in mind, it seems to match my initial
> assumption that ExternalProjects should have a "download only"
> function/macro
> separated from the other steps, so that it is possible to compose complex
> setup in easier ways than hacking ExternalProjects_Add parametters and
> using clunky patches.
>
>
>> I need to do this for my project too. Thanks for the question to get me
>> paying attention here, and finding the answer is another post :)
>>
>> Brad
>>
>> On Jul 14, 2015, at 5:14 PM, Klaim - Joël Lamotte > > wrote:
>>
>> I am attempting to use ExternalDependencies_Add with the last Protobuf
>> version (v3.0.0) which is in alpha3 (I'm using the master branch
>> actually)[1].
>> If you don't already know: contrary to previous Protobuf version, v3.x
>> provides
>> cmake scripts (and also makes CMake's FindProtobuf module unusuable if
>> you build Protobuf using CMake BTW).
>>
>> I am having trouble figuring out how to ExternalProject_add work in this
>> case:
>> the CMakeFiles.txt is not in the root directory of Protobuf sources, it
>> is in ./cmake/ [2]
>> So at build time, after download, I obviously get:
>>
>> >CUSTOMBUILD : CMake error : The source directory
>> "blahblah/install_protobuf" does not appear to contain CMakeLists.txt.
>>
>> I tried several approaches using this as a base:
>>
>> ExternalProject_Add( install_protobuf
>> PREFIX ${NETRUSH_DEPENDENCIES_DIR}/protobuf
>> GIT_REPOSITORY https://github.com/google/protobuf.git
>> GIT_TAG master
>>
>> CMAKE_CACHE_ARGS
>> -DBUILD_TESTING:bool=FALSE
>> )
>>
>>
>> I tried setting SOURCE_DIR but failed to make it work mainly because I'm
>> not sure what value to set exactly, and
>>
>>SOURCE_DIR cmake
>>
>> Does not seem to work.
>>
>> I was wondering if there is some args I could pass to CMake using
>> CMAKE_ARGS
>> but from the cmake[3] page in the doc I don't see anything that match
>> exactly, or
>> I might be misunderstanding something.
>>
>> I found this recommandation from Miklos Espak from 8th February 2015:
>> "Specify a patch command that creates a toplevel cmake list with one
>> 'add_subdirectory(A)'  line."
>>
>> It seems to work, but it also means that the repository is modified,
>> which is something
>> I want to avoid. Also it's really a hack for passing the right working
>> directory to cmake.
>>
>> Is there a simpler way to do it that I missed?
>>
>> Thanks for your time.
>>
>> Joël Lamotte
>>
>>
>> [1] https://github.com/google/protobuf
>> [2] https://github.com/google/protobuf/tree/master/cmake
>> [3]
>> http://www.cmake.org/cmake/help/v3.3/manual/cmake.1.html#manual:cmake(1)
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake
>>
>>
>>
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] ExternalProject_Add_StepDependencies parallel download/cloning

2015-07-17 Thread David Cole via CMake
I have adopted the technique of splitting a project into two
ExternalProject_Add calls, the first of which is named
"download-${projectName}" with empty configure, build and install
stages, and the second of which is named ${projectName} with an empty
download step (using DOWNLOAD_COMMAND "").

Then, the "real" project depends on the download-only project, and ALL
download-only projects can occur in parallel (to the limit of the
number of parallel jobs...)

The other benefit of doing it this way is you can have a single
"download-all" external project which depends on all your individual
download-only projects. This comes in handy if you want to download
everything all at once and then go offline with it. Or, if you want to
share the same download step with multiple downstream
configure/build/install commands (for example, ALL configurations for
ALL architectures, each combination of which is a separate EP_Add
call...)


HTH,
David C.



On Fri, Jul 17, 2015 at 12:53 PM, Klaim - Joël Lamotte
 wrote:
> I am setting up a bunch of dependencies using ExternalProject module.
> One of the dependencies, say A, needs another dependency B to be built
> before A can be built.
> ExternalProject_Add_StepDependencies solves the problem fine.
>
> However, I did it this way:
>
> ExternalProject_Add_StepDependencies( A configure B )
>
> Because I wanted A and B repositories to be cloned in parallel, as it should
> be
> safe to do so. Only A's configure step require that B be built and installed
> first.
> As A and B have very big repositories, it might help to have them be
> downloaded
> concurrently.
>
> Is there a way to do this?
>
> Joël Lamotte
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Is there any way to set a build-type specific install path for multiconfig tools?

2015-07-14 Thread David Cole via CMake
Most of the variables that have a per-config variation on the name end
with "_" ( see the page documenting CMake variables, and
search it for "config" to get a sense of which variables these are...
http://www.cmake.org/cmake/help/v3.3/manual/cmake-variables.7.html )
-- s, if you do prepare any patches for consideration, I would say
use "CMAKE_INSTALL_PREFIX_" as the names of the alternate
variables.

I don't know what the consensus opinion will be, but I think
CMAKE_INSTALL_PREFIX is already difficult to understand fully as-is,
and I would hesitate to add per-config complexity to it. I am certain
there are others with different opinions on the matter, though. We'll
see if anybody else chimes in.


D




On Tue, Jul 14, 2015 at 7:52 AM, Clifford Yapp  wrote:
> On Mon, Jul 13, 2015 at 1:45 PM, David Cole  wrote:
>
>> The other "no need to modify CMake" way to achieve this (although it
>> may be considered "too ugly" or non-ideal by some) would be to force
>> the use of a single configuration per build tree, and use the proper
>> value for CMAKE_INSTALL_PREFIX in each build tree.
>>
>> Your developers may not like that, but it would sure make the problem
>> at hand disappear.
>
> It would, but I think I would agree that's a fairly ugly solution - at
> least, it violates assumptions a dev might reasonably make in the
> multi-config workflow.  What I have in place now does the job and
> works (or at least, it did the last time I tried it) so I can stick
> with it if need be, but I figured it was worth raising the question to
> see if there either already existed a cleaner way or there was a way
> to add a "clean" way that would be acceptable to the devs.
>
>> The other thing to consider is that the file cmake_install.cmake,
>> generated at the top of your build tree contains code like the
>> following:
>>
>> # Set the install prefix
>> if(NOT DEFINED CMAKE_INSTALL_PREFIX)
>>   set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Tutorial")
>> endif()
>>
>> In the end, installing your project is ultimately a call of some sort
>> to "cmake -P cmake_install.cmake" -- you could simply install your
>> project with a custom call to that script which passes in the proper
>> value for CMAKE_INSTALL_PREFIX using -D... The above generated code
>> allows you to override it by passing it in when the script is called.
>>
>> The Visual Studio command for the INSTALL project looks like this:
>>
>> "C:\Program Files (x86)\CMake\bin\cmake.exe"
>> -DBUILD_TYPE=$(Configuration) -P cmake_install.cmake
>>
>> You could easily write a custom target / custom command that is an
>> alternate "configuration-prefixed" install as:
>>
>> "C:\Program Files (x86)\CMake\bin\cmake.exe"
>> -DBUILD_TYPE=$(Configuration)
>> -DCMAKE_INSTALL_PREFIX=config-specific-value-here -P
>> cmake_install.cmake
>
> Can that bit of code be controlled from the CMakeLists.txt file, or
> would I need to manually overwrite it in some fashion after it is
> generated?
>
> If a patch were prepared to use variables like
> CMAKE_DEBUG_INSTALL_PREFIX, would the devs consider it?  That still
> feels to me like it's probably the "right" solution given how CMake
> handles this for things like C flags, unless it causes too many other
> problems...
>
> Thanks,
> CY
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Why does changing -G not change generators?

2015-07-14 Thread David Cole via CMake
It's just something you can't change without wiping the build tree
entirely. It should probably actually produce an error or warning of
some sort to avoid confusion such as this...

D


On Tue, Jul 14, 2015 at 11:01 AM, Paul Smith  wrote:
> We have a situation where people are sometimes wanting to switch between
> different generators: from Xcode to Unix Makefiles, or from Visual
> Studio 2010 to Visual Studio 2012, etc.
>
> If they have an already-configured workspace then run "cmake -G" with a
> different generator, it appears to be a no-op: no error is generated but
> no changes are made and the previous generator is still used.
>
> This doesn't seem right to me... shouldn't giving a new generator type
> on the command line change the output for the new generator?  I'm using
> CMake 3.1.0... maybe this has changed since?
>
> Cheers!
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Is there any way to set a build-type specific install path for multiconfig tools?

2015-07-13 Thread David Cole via CMake
A few more ideas:


The other "no need to modify CMake" way to achieve this (although it
may be considered "too ugly" or non-ideal by some) would be to force
the use of a single configuration per build tree, and use the proper
value for CMAKE_INSTALL_PREFIX in each build tree.

Your developers may not like that, but it would sure make the problem
at hand disappear.


The other thing to consider is that the file cmake_install.cmake,
generated at the top of your build tree contains code like the
following:

# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/Tutorial")
endif()

In the end, installing your project is ultimately a call of some sort
to "cmake -P cmake_install.cmake" -- you could simply install your
project with a custom call to that script which passes in the proper
value for CMAKE_INSTALL_PREFIX using -D... The above generated code
allows you to override it by passing it in when the script is called.

The Visual Studio command for the INSTALL project looks like this:

"C:\Program Files (x86)\CMake\bin\cmake.exe"
-DBUILD_TYPE=$(Configuration) -P cmake_install.cmake

You could easily write a custom target / custom command that is an
alternate "configuration-prefixed" install as:

"C:\Program Files (x86)\CMake\bin\cmake.exe"
-DBUILD_TYPE=$(Configuration)
-DCMAKE_INSTALL_PREFIX=config-specific-value-here -P
cmake_install.cmake


HTH,
David C.


On Mon, Jul 13, 2015 at 12:29 PM, Clifford Yapp  wrote:
> On Mon, Jul 13, 2015 at 12:05 PM, David Cole  wrote:
>> I think this should be achievable somehow with CMAKE_INSTALL_PREFIX
>> set to "/parent_dirs" and then using appropriate DESTINATION and
>> CONFIGURATIONS arguments to the CMake install commands.
>>
>> Have you tried using the CONFIGURATIONS args to the install command?
>
> We haven't tried altering the install commands, but there's a
> difficulty there - we don't always control all the CMake code in our
> build.  We include some 3rd party libraries and try to keep their code
> as close to "vanilla" as possible, which means it would be vastly
> preferable not to need to track down and redo all the install commands
> in that code whenever we needed to re-sync.
>
> Thanks,
> CY
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Is there any way to set a build-type specific install path for multiconfig tools?

2015-07-13 Thread David Cole via CMake
I think this should be achievable somehow with CMAKE_INSTALL_PREFIX
set to "/parent_dirs" and then using appropriate DESTINATION and
CONFIGURATIONS arguments to the CMake install commands.

Have you tried using the CONFIGURATIONS args to the install command?



On Mon, Jul 13, 2015 at 10:26 AM, Clifford Yapp  wrote:
> One challenge we've experienced with CMake is properly controlling the
> installation path when using multi-config tools like Visual Studio or
> Xcode.  Since I'm in the middle of re-examining our more gnarly CMake
> logic anyway, I thought I'd raise this one and see if anybody knows of
> a good solution.
>
> The problem is as follows - for multi-config build tools, the build
> profile (Release, Debug, etc.) is selected at build time, not CMake
> configure time.  Consequently, if one wishes to change the
> CMAKE_INSTALL_PREFIX based on the current build configuration (our
> convention for default install paths is to use
> /parent_dirs/rel- for release builds and
> /parent_dirs/dev- for development builds) that change has to
> happen at build time.
>
> To the best of my knowledge there is no good way to do this in CMake
> currently.  The closest I could come when I tried originally was to
> insert a variable into the CMAKE_INSTALL_PREFIX path that evaluated to
> the current build configuration (IIRC) but that wasn't quite correct
> per our convention.  I finally settled on a rather scary trick where I
> created a custom build target that would manually rewrite all of the
> generated CMake build files (via running a CMake script) to use the
> desired path, and that build target becomes flagged for a re-run every
> time the build configuration in the build tool is changed.  In
> essence, I'm post processing the CMake generated build files.
>
> The "preferred" solution to this (I think) would be to have
> CMAKE_${CFG_TYPE}_INSTALL_PREFIX variables that could be set the same
> way the C/CXX flag variables have per-configuration versions.  That
> way the CMakeLists.txt file could simply specify the target install
> paths for each configuration and have then written directly to the
> appropriate output build files.  However, to the best of my knowledge
> there is no existing CMake feature that currently supports this.
>
> Has anyone else encountered the problem?  If not, would the devs
> consider adding a per-config CMAKE_INSTALL_PREFIX feature for the
> multi-config tools?
>
> Thanks,
> CY
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] CDash problems

2015-06-25 Thread David Cole via CMake
I cloned your project [Safe
Numerics](https://github.com/robertramey/safe_numerics) to try to help
you out by attempting to reproduce this problem.

I see the most recent activity is in the "policies" branch, but I
don't see anything in the whole repo, in either 'master' or 'policies'
branches that refer to how to build it via CMake, or how to attempt to
submit a CDash build...

I browsed through the html docs and did a 'git grep -i experimental'
to no avail.

Do you have build instructions? Should I just configure using the
"CMake/CMakeLists.txt" file and then try to build the Experimental
target? Will it build ok on Windows with VS 2013, or Ninja plus that
compiler?


Thx,
David C.


On Thu, Jun 25, 2015 at 10:44 AM, Robert Ramey  wrote:
> I set up a project on the cdash.org website.
>
> When I invoke the "experimental" target it runs the tests and uploads the
> results to cdash.org.  So far so good. In my github project and
> documentation I've encouraged uses of this project to use CMake to build it
> and test it and run the "experimental" target so that their test results
> will also appear on the cdash dashboard.  But when someone other than myself
> tries to do this, I get an emal from ad...@cdhash.org which says:
>
> Object: Cannot create handler based on XML content
> An XML submission from 42.156.137.83 to the project Safe Numerics cannot be
> parsed. The content of the file is as follow:
>
> -CDash on my.cdash.org
>
> What do I have to do to find out the problem and fix this?
>
> The project is "Safe Numerics"
>
> http://my.cdash.org/index.php?project=Safe+Numerics
>
>
> Robert Ramey
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Running CTest with Xcode build results in Error

2015-06-18 Thread David Cole via CMake
CMake does not generate it.

You may have received it as a "suggestion" from CDash when you set the
project up, and then you put it in your top level source tree and
forget about it usually.

But I don't think CDash would suggest using -j with "if(NOT WIN32)
logic" (although I could be wrong)... so I'd suspect committers of
that file in your source tree.

Glad you found it -- stuff like that is frustrating.


D



On Thu, Jun 18, 2015 at 3:46 PM, Michael Jackson
 wrote:
> And I will follow that up quickly with ".. it was buried down in our 
> project….".
>
> Thanks for the help.
>
> Mike J.
>
> On Jun 18, 2015, at 3:45 PM, Michael Jackson  
> wrote:
>
>> Found the source. the generated CTestConfig.cmake is the following:
>>
>>
>> ## This file should be placed in the root directory of your project.
>> ## Then modify the CMakeLists.txt file in the root directory of your
>> ## project to incorporate the testing dashboard.
>> ## # The following are required to uses Dart and the Cdash dashboard
>> ##   ENABLE_TESTING()
>> ##   INCLUDE(CTest)
>> set(CTEST_PROJECT_NAME "DREAM3D")
>> set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
>>
>> set(CTEST_DROP_METHOD "http")
>> set(CTEST_DROP_SITE "my.cdash.org")
>> set(CTEST_DROP_LOCATION "/submit.php?project=DREAM3D")
>> set(CTEST_DROP_SITE_CDASH TRUE)
>>
>> # Use multiple CPU cores to build
>> include(ProcessorCount)
>> ProcessorCount(N)
>> if(NOT N EQUAL 0)
>>  if(NOT WIN32)
>>set(CTEST_BUILD_FLAGS "-j${N}")
>>  endif(NOT WIN32)
>>  set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
>>
>> endif()
>>
>> So that explains where it is coming from. Does CMake generate this or does 
>> my project generate this?
>>
>> Mike J
>>
>> On Jun 18, 2015, at 3:40 PM, David Cole  wrote:
>>
>>> The error shown in your CDash build error output page could be coming
>>> from something that is built within your project as an
>>> ExternalProject.
>>>
>>> Do you have any of those?
>>>
>>> Have you grepped your source tree for -j yet?
>>>
>>>
>>> On Thu, Jun 18, 2015 at 3:17 PM, Michael Jackson
>>>  wrote:
>>>> I will have to admit that I don't pretend to completely understand the 
>>>> CMake file that I am using as I started with something from VTK and 
>>>> changed things to work with our project and setup. I will attach the files 
>>>> to the email. Maybe you can see something that I am missing:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Thanks
>>>> Mike Jackson
>>>>
>>>> On Jun 18, 2015, at 3:08 PM, David Cole via CMake  wrote:
>>>>
>>>>> Are you using Eclipse or Kate?
>>>>>
>>>>> Did you do a grep -E "\-j" on all of the files included by the script
>>>>> that drives the build? (And in your source tree?)
>>>>>
>>>>> The only -j possibilities that look likely in CMake itself are shown
>>>>> in the git grep results from a CMake checkout:
>>>>>
>>>>> $ git grep -E "\-j"
>>>>>
>>>>> Modules/CMakeFindEclipseCDT4.cmake:# Try to find out how many CPUs we
>>>>> have and set the -j
>>>>> Modules/CMakeFindEclipseCDT4.cmake:# Only set -j if we are under UNIX
>>>>> and if the make-tool
>>>>> Modules/CMakeFindEclipseCDT4.cmake:
>>>>> set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLI
>>>>> Modules/CMakeFindEclipseCDT4.cmake:set(CMAKE_ECLIPSE_MAKE_ARGUMENTS
>>>>> "${_CMAKE_ECLIPSE_INIT
>>>>> Modules/CMakeFindKate.cmake:# Try to find out how many CPUs we have
>>>>> and set the -j argumen
>>>>> Modules/CMakeFindKate.cmake:# Only set -j if we are under UNIX and if
>>>>> the make-tool used a
>>>>> Modules/CMakeFindKate.cmake:  set(_CMAKE_KATE_INITIAL_MAKE_ARGS
>>>>> "-j${_CMAKE_KATE_PROCESSOR
>>>>> Modules/CMakeFindKate.cmake:set(CMAKE_KATE_MAKE_ARGUMENTS
>>>>> "${_CMAKE_KATE_INITIAL_MAKE_ARGS
>>>>>
>>>>> And it looks like those try to restrict it to a "make" tool, so they
>>>>> shouldn't be using it in the case of xcodebuild...
>>>>>
>>>>> Mystery. We're missing something.
>>>&

Re: [CMake] Running CTest with Xcode build results in Error

2015-06-18 Thread David Cole via CMake
The error shown in your CDash build error output page could be coming
from something that is built within your project as an
ExternalProject.

Do you have any of those?

Have you grepped your source tree for -j yet?


On Thu, Jun 18, 2015 at 3:17 PM, Michael Jackson
 wrote:
> I will have to admit that I don't pretend to completely understand the CMake 
> file that I am using as I started with something from VTK and changed things 
> to work with our project and setup. I will attach the files to the email. 
> Maybe you can see something that I am missing:
>
>
>
>
>
> Thanks
> Mike Jackson
>
> On Jun 18, 2015, at 3:08 PM, David Cole via CMake  wrote:
>
>> Are you using Eclipse or Kate?
>>
>> Did you do a grep -E "\-j" on all of the files included by the script
>> that drives the build? (And in your source tree?)
>>
>> The only -j possibilities that look likely in CMake itself are shown
>> in the git grep results from a CMake checkout:
>>
>> $ git grep -E "\-j"
>>
>> Modules/CMakeFindEclipseCDT4.cmake:# Try to find out how many CPUs we
>> have and set the -j
>> Modules/CMakeFindEclipseCDT4.cmake:# Only set -j if we are under UNIX
>> and if the make-tool
>> Modules/CMakeFindEclipseCDT4.cmake:
>> set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLI
>> Modules/CMakeFindEclipseCDT4.cmake:set(CMAKE_ECLIPSE_MAKE_ARGUMENTS
>> "${_CMAKE_ECLIPSE_INIT
>> Modules/CMakeFindKate.cmake:# Try to find out how many CPUs we have
>> and set the -j argumen
>> Modules/CMakeFindKate.cmake:# Only set -j if we are under UNIX and if
>> the make-tool used a
>> Modules/CMakeFindKate.cmake:  set(_CMAKE_KATE_INITIAL_MAKE_ARGS
>> "-j${_CMAKE_KATE_PROCESSOR
>> Modules/CMakeFindKate.cmake:set(CMAKE_KATE_MAKE_ARGUMENTS
>> "${_CMAKE_KATE_INITIAL_MAKE_ARGS
>>
>> And it looks like those try to restrict it to a "make" tool, so they
>> shouldn't be using it in the case of xcodebuild...
>>
>> Mystery. We're missing something.
>>
>>
>>
>> On Thu, Jun 18, 2015 at 12:23 PM, Michael Jackson
>>  wrote:
>>> Nope. Neither one of those are on my environment. I am also running at Root 
>>> for this build and I have a clean .bashrc for both accounts. There must be 
>>> something in my chest.cmake file that makes CTest think it is running with 
>>> a makefile generator.
>>>
>>> Should I post my various files?
>>>
>>> Mike Jackson
>>>
>>>> On Jun 18, 2015, at 9:56 AM, David Cole  wrote:
>>>>
>>>> Is there a MAKEFLAGS or CTEST_BUILD_FLAGS in your environment?
>>>>
>>>> Where does the -j16 come from? (CTest should not be injecting that
>>>> unless you are telling it to somehow, so it either comes from one of
>>>> your scripts, or your environment...)
>>>>
>>>> grep for just "\-j" -- the value 16 may come from a variable evaluation.
>>>>
>>>>
>>>> HTH,
>>>> David C.
>>>>
>>>>
>>>> On Thu, Jun 18, 2015 at 8:51 AM, Michael Jackson
>>>>  wrote:
>>>>> We have a nightly build for our project as reported here 
>>>>> http://my.cdash.org/viewBuildError.php?buildid=781789 which is producing 
>>>>> an error. The short of it is that CTest is using xcodebuild (which is 
>>>>> correct) but is trying to pass the “-j16” style that normal “MakeFiles” 
>>>>> would use. I have looked through our CTest scripts (Which were adapted 
>>>>> from VTK’s nightly builds) but I am not seeing anything about that flag 
>>>>> being explicitly called out.
>>>>>
>>>>> Could anyone with nightly build experience help us out?
>>>>>
>>>>> Thanks
>>>>> Mike Jackson
>>>>> BlueQuartz Software
>>>>> --
>>>>>
>>>>> 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
>>>>>

Re: [CMake] Recursively include target include directories only

2015-06-18 Thread David Cole via CMake
Did you read through the pointed to stack overflow question and answers?

Is the information there misleading or incorrect?, ... because it
seems to say there is a way to do it with MSVC...



On Thu, Jun 18, 2015 at 3:16 PM, Robert Dailey  wrote:
> On Thu, Jun 18, 2015 at 12:02 PM, Dan Liew  wrote:
>>> Can you explain what you mean by "strong" and "weak" symbols?
>>
>>
>> Google is your friend
>>
>> https://en.wikipedia.org/wiki/Weak_symbol
>>
>> http://stackoverflow.com/questions/2290587/gcc-style-weak-linking-in-visual-studio
>
> Normally Google is my friend, but today it hates me. Because no such
> feature exists for MSVC that I saw.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [CMake] Running CTest with Xcode build results in Error

2015-06-18 Thread David Cole via CMake
Are you using Eclipse or Kate?

Did you do a grep -E "\-j" on all of the files included by the script
that drives the build? (And in your source tree?)

The only -j possibilities that look likely in CMake itself are shown
in the git grep results from a CMake checkout:

$ git grep -E "\-j"

Modules/CMakeFindEclipseCDT4.cmake:# Try to find out how many CPUs we
have and set the -j
Modules/CMakeFindEclipseCDT4.cmake:# Only set -j if we are under UNIX
and if the make-tool
Modules/CMakeFindEclipseCDT4.cmake:
set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLI
Modules/CMakeFindEclipseCDT4.cmake:set(CMAKE_ECLIPSE_MAKE_ARGUMENTS
"${_CMAKE_ECLIPSE_INIT
Modules/CMakeFindKate.cmake:# Try to find out how many CPUs we have
and set the -j argumen
Modules/CMakeFindKate.cmake:# Only set -j if we are under UNIX and if
the make-tool used a
Modules/CMakeFindKate.cmake:  set(_CMAKE_KATE_INITIAL_MAKE_ARGS
"-j${_CMAKE_KATE_PROCESSOR
Modules/CMakeFindKate.cmake:set(CMAKE_KATE_MAKE_ARGUMENTS
"${_CMAKE_KATE_INITIAL_MAKE_ARGS

And it looks like those try to restrict it to a "make" tool, so they
shouldn't be using it in the case of xcodebuild...

Mystery. We're missing something.



On Thu, Jun 18, 2015 at 12:23 PM, Michael Jackson
 wrote:
> Nope. Neither one of those are on my environment. I am also running at Root 
> for this build and I have a clean .bashrc for both accounts. There must be 
> something in my chest.cmake file that makes CTest think it is running with a 
> makefile generator.
>
> Should I post my various files?
>
> Mike Jackson
>
>> On Jun 18, 2015, at 9:56 AM, David Cole  wrote:
>>
>> Is there a MAKEFLAGS or CTEST_BUILD_FLAGS in your environment?
>>
>> Where does the -j16 come from? (CTest should not be injecting that
>> unless you are telling it to somehow, so it either comes from one of
>> your scripts, or your environment...)
>>
>> grep for just "\-j" -- the value 16 may come from a variable evaluation.
>>
>>
>> HTH,
>> David C.
>>
>>
>> On Thu, Jun 18, 2015 at 8:51 AM, Michael Jackson
>>  wrote:
>>> We have a nightly build for our project as reported here 
>>> http://my.cdash.org/viewBuildError.php?buildid=781789 which is producing an 
>>> error. The short of it is that CTest is using xcodebuild (which is correct) 
>>> but is trying to pass the “-j16” style that normal “MakeFiles” would use. I 
>>> have looked through our CTest scripts (Which were adapted from VTK’s 
>>> nightly builds) but I am not seeing anything about that flag being 
>>> explicitly called out.
>>>
>>> Could anyone with nightly build experience help us out?
>>>
>>> Thanks
>>> Mike Jackson
>>> BlueQuartz Software
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> Please keep messages on-topic and check the CMake FAQ at: 
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Kitware offers various services to support the CMake community. For more 
>>> information on each offering, please visit:
>>>
>>> CMake Support: http://cmake.org/cmake/help/support.html
>>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>>
>>> Visit other Kitware open-source projects at 
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] Running CTest with Xcode build results in Error

2015-06-18 Thread David Cole via CMake
Is there a MAKEFLAGS or CTEST_BUILD_FLAGS in your environment?

Where does the -j16 come from? (CTest should not be injecting that
unless you are telling it to somehow, so it either comes from one of
your scripts, or your environment...)

grep for just "\-j" -- the value 16 may come from a variable evaluation.


HTH,
David C.


On Thu, Jun 18, 2015 at 8:51 AM, Michael Jackson
 wrote:
> We have a nightly build for our project as reported here 
> http://my.cdash.org/viewBuildError.php?buildid=781789 which is producing an 
> error. The short of it is that CTest is using xcodebuild (which is correct) 
> but is trying to pass the “-j16” style that normal “MakeFiles” would use. I 
> have looked through our CTest scripts (Which were adapted from VTK’s nightly 
> builds) but I am not seeing anything about that flag being explicitly called 
> out.
>
> Could anyone with nightly build experience help us out?
>
> Thanks
> Mike Jackson
> BlueQuartz Software
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Re: [CMake] [cmake-developers] Virtual folders in Visual studio get expanded on reload

2015-06-15 Thread David Cole via CMake
I think I have seen this behavior in pure (non-CMake-generated) VS
projects... Perhaps it's simply a Visual Studio issue, and has nothing
to do with CMake.

D

On Fri, Jun 12, 2015 at 7:55 AM, Roman Wüger  wrote:
> @kgt: Thank you for this great hint. :-)
> I had overlooked this button in Visual Studio
>
> @mjklaim: I didn't see this behavior in older CMake versions.
>
> Roman
>
>> -Ursprüngliche Nachricht-
>> Von: Thompson, KT [mailto:k...@lanl.gov]
>> Gesendet: Dienstag, 02. Juni 2015 15:52
>> An: Roman Wüger; CMake MailingList
>> Betreff: RE: [cmake-developers] Virtual folders in Visual studio get expanded
>> on reload
>>
>> Roman,
>>
>> I have the same complaint. My project has about 300 targets arranged in two
>> dozen folders.  I use the "collapse all"  button in Visual Studio's Solution
>> Explorer window (looks like a stack of 3 squares in VS2013).
>>
>> kt
>>
>> -Original Message-
>> From: cmake-developers [mailto:cmake-developers-boun...@cmake.org]
>> On Behalf Of Roman Wüger
>> Sent: Monday, June 01, 2015 5:00 PM
>> To: CMake Developer MailingList; CMake MailingList
>> Subject: [cmake-developers] Virtual folders in Visual studio get expanded on
>> reload
>>
>> Hi,
>>
>> I noticed that sometimes when a target is reloaded, that the virtual folders
>> and targets for the complete visual studio solution get expanded.
>> For a small project this isn't a problem, but in a large project (~ 100 
>> targets)
>> this is a really big problem to close all targets every time.
>>
>> Did anybody noticed this behavior and has a solution for it?
>>
>> Thanks
>>
>> Best Regards
>> Roman
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> http://public.kitware.com/mailman/listinfo/cmake-developers
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

  1   2   3   >