Re: [CMake] Time each target

2016-08-25 Thread Michael Ellery

> On Aug 25, 2016, at 9:58 AM, Moreland, Kenneth  wrote:
> 
> Does anyone know of a simple way to get CMake to time how long it takes to 
> compile each target? As it stands now, when compiling a CMake-managed project 
> a status is printed before each target is built. What I am looking for is a 
> way to get CMake to print a second status message after the target finishes 
> building with a note on what the wall time of the build was.
>  
> -Ken
>  

I don’t know of any built-in support for this. I think Visual Studio projects 
might have a setting to generate timing info, but I suspect you are not using 
Visual Studio/MSbuild.

Here is an example of some build timing:

https://github.com/PointCloudLibrary/pcl/blob/master/CMakeLists.txt#L98
https://github.com/PointCloudLibrary/pcl/blob/master/cmake/custom_output.sh

..but I think it is providing timing for each compile command, not at the 
target level. In any event, this technique of using RULE_LAUNCH_COMPILE seems 
interesting - perhaps you can adopt it somehow.

The only other thing I can think of is to add custom targets around your real 
targets where  POST depends on REAL which DEPENDS on PRE and the PRE and POST 
targets just print some timing info. Kludgy to be sure. HTH.

-Mike

-- 

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] Only install one component in cpack

2016-08-25 Thread tonka tonka
Thx. Works perfectly :-D

Am 25.08.2016 13:56 schrieb "Eric Noulard" :

> Hi Tonka,
>
> You should read the doc here:
> https://cmake.org/cmake/help/v3.5/module/CPackComponent.html
>
> for the ZIP generator you should
>
> set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
> this is necessary because archive generator are "MONOLITHIC" by default.
>
> set(CPACK_COMPONENTS_GROUPING IGNORE)
> with this grouping you get on package per component
> (the default is to have one package per component **group**)
>
> This should produce one zip file per component.
> Other grouping variant are possible, read the previous doc.
>
> 2016-08-25 13:45 GMT+02:00 tonka tonka :
>
>> Hey,
>>
>> I want to create a zip file with only one component in it. Installers
>> like nsis respect the CPACK_COMPONENTS_ALL settings, but the zip generator
>> ignores it.
>>
>> Can I do that?
>>
>> Alternatively I would like to split every component into a single zip
>> file, I know that it is possible but I forgot how to do that.
>>
>> Greetings
>> Tonka
>>
>> --
>>
>> 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
>>
>
>
>
> --
> 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

[CMake] Time each target

2016-08-25 Thread Moreland, Kenneth
Does anyone know of a simple way to get CMake to time how long it takes to 
compile each target? As it stands now, when compiling a CMake-managed project a 
status is printed before each target is built. What I am looking for is a way 
to get CMake to print a second status message after the target finishes 
building with a note on what the wall time of the build was.

-Ken

     Kenneth Moreland
***  Sandia National Laboratories
***
*** *** ***  email: kmo...@sandia.gov
**  ***  **  phone: (505) 844-8919
***  web:   http://kennethmoreland.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

[CMake] Erroneous CMP0022 warning for transitive conditional link dependencies?

2016-08-25 Thread Daniel Lueken
Hi all,

As it seems you get an erroneous CMP0022 warning in the following scenario, due 
to a generator expression not being resolved before string comparison.
Confirmed with versions 3.5.1 and rev 00a583ac6833 . (2016-08-24 06:01:04) on 
Ubuntu Xenial using the Unix Makefile generator.

- Create a library
- Create a shared library and publicly conditionally (optimized | debug) link 
it to that library
- Create an executable
- Link the executable to the shared library, thus creating a transitive 
conditional dependency on the first library

Running CMake on this setup yields the following warning during generation:



> ./cmake .
.
CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
  interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  Target "testso" has an INTERFACE_LINK_LIBRARIES property which differs from
  its LINK_INTERFACE_LIBRARIES properties.

  INTERFACE_LINK_LIBRARIES:

$<$>:testlib>

  LINK_INTERFACE_LIBRARIES:

testlib



CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)

project(libtest_project)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

add_library(testlib STATIC testlib.cpp)

add_library(testso SHARED sharedlib.cpp)

target_link_libraries(testso PUBLIC optimized testlib)

add_executable(testexe exe.cpp)

target_link_libraries(testexe testso)



Simplified stack trace:
cmGeneratorTarget (Target: testso)::GetLinkInterfaceLibraries("", target 
testexe, usage requirements only)
TargetPropertyNode::Evaluate(testso, INTERFACE_SOURCES)
GeneratorExpressionContent 
($)::Evaluate()
cmCompiledGeneratorExpression 
($)::EvaluateWithContext()
cmCompiledGeneratorExpression 
($)::Evaluate()
processSources()
cmGeneratorTarget (Target: testexe)::GetSourceFiles(config: "")
cmGeneratorTarget (Target: testexe)::GetSourceFiles(config: "")
cmTargetTraceDependencies (Target: textexe)::ctor()
cmGeneratorTarget (Target: testexe)::TraceDependencies()
cmLocalGenerator (/src)::TraceDependencies()
cmGlobalGenerator::Compute()
cmake::Generate()
cmake::Run()
main()



.or is this intended behavior?

Best regards

-- 
BMW Car IT GmbH
Daniel Lüken
Spezialist Entwicklung
Moosacher Straße 86
80809 München

Tel.:  +49 89 189311-35
Fax:  +49 89 189311-20
Mail: daniel.lue...@bmw-carit.de
Web: http://www.bmw-carit.de
-
BMW Car IT GmbH
Geschäftsführer: Michael Würtenberger und Alexis Trolin
Sitz und Registergericht: München HRB 134810
-


-- 

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] CUDA: COMPILE_DEFINITIONS not picked up

2016-08-25 Thread Karl Ljungkvist
Hi all,

if I do something like this,


ADD_EXECUTABLE(myprog myprog.cpp)

SET_PROPERTY(TARGET myprog APPEND PROPERTY
  COMPILE_DEFINITIONS "DEF1;DEF2"
  )


then the two macros DEF1 and DEF2 will be defined at compilation.
However, if I switch to the corresponding CUDA setup,


CUDA_ADD_EXECUTABLE(myprog myprog.cu)

SET_PROPERTY(TARGET myprog APPEND PROPERTY
  COMPILE_DEFINITIONS "DEF1;DEF2"
  )

then they are not defined. Is this the intended behavior, and if so, how
can I make the cuda version pick up the COMPILE_DEFINITIONS

Best regards,
Karl

-- 
Karl Ljungkvist
PhD student

Uppsala University
Dept. of Information Technology
Div. of Scientific Computing
Box 337
SE-751 05 Uppsala, Sweden
Email: karl.ljungkv...@it.uu.se
Phone:  +46 18 471 2967
Mobile: +46 70 200356

-- 

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] Only install one component in cpack

2016-08-25 Thread Eric Noulard
Hi Tonka,

You should read the doc here:
https://cmake.org/cmake/help/v3.5/module/CPackComponent.html

for the ZIP generator you should

set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
this is necessary because archive generator are "MONOLITHIC" by default.

set(CPACK_COMPONENTS_GROUPING IGNORE)
with this grouping you get on package per component
(the default is to have one package per component **group**)

This should produce one zip file per component.
Other grouping variant are possible, read the previous doc.

2016-08-25 13:45 GMT+02:00 tonka tonka :

> Hey,
>
> I want to create a zip file with only one component in it. Installers like
> nsis respect the CPACK_COMPONENTS_ALL settings, but the zip generator
> ignores it.
>
> Can I do that?
>
> Alternatively I would like to split every component into a single zip
> file, I know that it is possible but I forgot how to do that.
>
> Greetings
> Tonka
>
> --
>
> 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
>



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

[CMake] Only install one component in cpack

2016-08-25 Thread tonka tonka
Hey,

I want to create a zip file with only one component in it. Installers like
nsis respect the CPACK_COMPONENTS_ALL settings, but the zip generator
ignores it.

Can I do that?

Alternatively I would like to split every component into a single zip file,
I know that it is possible but I forgot how to do that.

Greetings
Tonka
-- 

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] Problems running npm-based tests on Windows

2016-08-25 Thread Andrey Fedorov
As demonstrated here https://github.com/QIICR/dcmqi/pull/79, the
problem is resolved when .cmd versions of the commands are used.

On Wed, Aug 24, 2016 at 1:10 PM, Andrey Fedorov
 wrote:
> Hi,
>
> we are running ctest's on appveyor using npm-installed packages.
> Specifically, we run jsonlint and ajv on json files to validate the
> content.
>
> Packages are installed in this line:
> https://github.com/QIICR/dcmqi/blob/master/appveyor.yml#L12-L13 of the
> appveyor configuration.
>
> The installed packages can be run wihtout problems when invoked
> directly from command line on appveyor. These lines
> https://github.com/QIICR/dcmqi/blob/master/appveyor.yml#L35-L36 both
> work fine on appveyor:
> https://ci.appveyor.com/project/fedorov/dcmqi/build/0.0.251#L1203.
>
> The path to the ajv package used by ctest is identical to the one that
> works when invoked directly from the cmd shell; here is the location
> where ctest is 
> invoked:https://github.com/QIICR/dcmqi/blob/master/appveyor.yml#L37,
> and this is the where it is being run by appveyor:
> https://ci.appveyor.com/project/fedorov/dcmqi/build/0.0.251#L1662.
>
> Bottom line: ajv works when invoked directly from the appveyor windows
> cmd shell, but not when called by ctest.
>
> Why is ctest failing to run the test with "Not Run/BAD_COMMAND" status?
>
> AF
-- 

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