Re: [cmake-developers] Profile Cmake scripts

2015-12-27 Thread Alexander Neundorf
On Sunday, December 27, 2015 18:40:27 Dimitar Yordanov wrote:
> Hi all,
> 
> I was searching for a way to profile CMake scripts in order to find
> bottlenecks and possibilities to improve performance. I found out that
> someone already invested time on that [1] providing a minimal 
solution. The
> idea behind it is to use the cmake "--trace" option and to output a time
> stamp and a stack depth with each executed command. The trace log 
is
> afterwards used by a Python script, which transforms it into a more
> readable format.

I actually simply used valgrind/callgrind and got useful results from that.
Usually you see mostly string handling related functions.

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

[cmake-developers] Profile Cmake scripts

2015-12-27 Thread Dimitar Yordanov
Hi all,

I was searching for a way to profile CMake scripts in order to find
bottlenecks and possibilities to improve performance. I found out that
someone already invested time on that [1] providing a minimal solution. The
idea behind it is to use the cmake "--trace" option and to output a time
stamp and a stack depth with each executed command. The trace log is
afterwards used by a Python script, which transforms it into a more
readable format.

In [1] there existed already a patch for CMake 2.8. This can be easily
adapted for CMake 3.4. One of the issues with that approach is that the
add_subdirectory() command creates a new stack and thus starts the depth
count back from one again. I think it would be more appropriate to work
around that in the Python script, which does the processing. A time stamp
at the end of the whole execution would also be needed in order to
calculate the time needed for the last command.

Alternatively, the trace could output a time stamp at the beginning and at
the end of each command. But that would produce larger traces.

So, I would like to ask you for your opinion and if there is willingness to
integrate such a patch in CMake.

For the Python script itself I thought that it would maybe make sense to
create an output in the Callgrind format. No idea if it is possible
though.

1 - https://github.com/volo-zyko/cmake-profile-stats

Regards,
Dimitar
-- 

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

Re: [CMake] still having rpath problems on osx

2015-12-27 Thread Michael Jackson


> On Dec 24, 2015, at 2:24 AM, Boudewijn Rempt  wrote:
> 
> On Wed, 23 Dec 2015, Michael Jackson wrote:
> 
>>> 
>>> Hm... Okay -- so, since I all my dependencies myself as cmake external 
>>> projects, I guess I want all of them set to rpath. I guess that for boost, 
>>> with its own build system, I'll need to add a separate fix-up step to my 
>>> cmake externals project for boost. I have to check how I can fix the 
>>> dependencies that are still automake/autoconf based. And I'll try what you 
>>> suggest below for my own project.
>> 
>> I have written scripts to do things like that for boost and ITK where the 
>> libraries do not have anything like @rpath or the absolute path to the 
>> installed library. After installing I run those scripts to “fix” the 
>> libraries so when I debug I can just run the application. During packaging I 
>> then run CMake’s BundleUtilities to copy in the libraries and adjust the 
>> libraries to have @rpath or @executable_path.
>> 
>> When fixing up a library make sure you also fix all the dependent libraries 
>> that might be there. For things like Boost or ITK their higher level 
>> libraries depend on their lower level libraries. Using “otool -L” you can 
>> see this. Make sure you update EVERY path in the library.
>> 
>> Also using MacDeployQt will NOT fix up any NON-Qt libraries (like Boost, 
>> HDF5.. ) so you will still need to run/write something that fixes all of 
>> those libraries. For our project we wrote a pure CMake script that does 
>> everything we need to fix up our bundles so that everything is self 
>> contained.
> 
> Hm... And it all did work when my project was still Qt4-based and I built on 
> Mavericks... And I've got about 300 libraries in the project, including 
> plugins. Resetting the id of broken libraries and then rebuilding my project 
> works. Are your scripts public so I can take a look and maybe reuse them?

https://github.com/dream3d/DREAM3D/blob/develop/Support/cmp/OSX_Tools/CompleteBundle.cmake.in
 


Note that the file is “configured” during our make process but you should be 
able to figure out what we are doing. We also ensure ALL of our 3rd Party 
Libraries (except Qt) are built with absolute paths as their “install_name” so 
that BundleUtilities can more easily find the libraries. With additional 
arguments BundleUtilities can find about any library you need.

Mike Jackson

> 
> -- 
> Boudewijn Rempt | http://www.krita.org, http://www.valdyas.org-- 
> 
> 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-developers] Profile Cmake scripts

2015-12-27 Thread Dimitar Yordanov
2015-12-27 21:05 GMT+01:00 Alexander Neundorf :
>
> On Sunday, December 27, 2015 18:40:27 Dimitar Yordanov wrote:
>
> > Hi all,
>
> >
>
> > I was searching for a way to profile CMake scripts in order to find
>
> > bottlenecks and possibilities to improve performance. I found out that
>
> > someone already invested time on that [1] providing a minimal solution. The
>
> > idea behind it is to use the cmake "--trace" option and to output a time
>
> > stamp and a stack depth with each executed command. The trace log is
>
> > afterwards used by a Python script, which transforms it into a more
>
> > readable format.
>
>
>
> I actually simply used valgrind/callgrind and got useful results from that.

I agree with you. Running valgrind directly on the cmake binary
provides useful information: I can see which internal cmake functions
are used the most and consume most of the time.

Nevertheless, I think it would be useful to have a higher level
overview. E.g. to see if there are some issues with the scripts
themselves that I use in my project ...

> Usually you see mostly string handling related functions.

malloc and free are on the top of what I see for a random project used
mostly by std::string. Maybe we can optimize something here too?

Regards,
Dimitar
-- 

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


[CMake] How to check if CMake install script is being run by CPack?

2015-12-27 Thread Nazar Mishturak
Hi, I am new here! I have a problem with my install(SCRIPT), it does
fixup_bundle for all targets under ${CMAKE_INSTALL_PREFIX} and strip &
upx all executables + .dlls under it. But I want to do upx and strip
only when I am creating a package(make package, not make install).
I have tried using:

if(DEFINED CPACK_OUTPUT_CONFIG_FILE)
if(DEFINED CPACK_PROJECT_CONFIG_FILE)
if(DEFINED CPACK_GENERATOR)

As far as I understand CPack just installs using CMake somewhere into
package directory. But I don't know if its possible to use this.
Should I check these variables in CMakeLists.txt and use
configure_file to pass variables to the script?
-- 

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-commits] CMake branch, master, updated. v3.4.1-753-g9fdb66c

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

The branch, master has been updated
   via  9fdb66cff6c28fa279ff510ae9af6662b155524f (commit)
  from  1d73f6525c523661e51173829b327acf9de9dfc4 (commit)

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

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fdb66cff6c28fa279ff510ae9af6662b155524f
commit 9fdb66cff6c28fa279ff510ae9af6662b155524f
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Mon Dec 28 00:01:06 2015 -0500
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Mon Dec 28 00:01:06 2015 -0500

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 842b6ba..342fe0c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 4)
-set(CMake_VERSION_PATCH 20151227)
+set(CMake_VERSION_PATCH 20151228)
 #set(CMake_VERSION_RC 1)

---

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


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


Re: [CMake] How to get current visualstudio version?

2015-12-27 Thread Xi Shen
Yes, the official FindBoost works better xD


On Fri, Dec 25, 2015 at 8:40 PM Nils Gladitz  wrote:

> On 25.12.2015 10:36, Xi Shen wrote:
> > Hi,
> >
> > I know I can check MSVC to determine if the Visual Studio generator is
> > used. But how do I find out which version is been used?
>
> MSVC indicates that the Visual C++ compiler (or something compatible) is
> being used; which does not necessarily mean a Visual Studio generator.
> If you do need to make that distinction you can check MSVC_IDE [1] instead.
>
> >
> > The reason I want to find the the version of VS being used, is because
> > I need to link to the Boost libraries. Boost create its libraries with
> > suffixes like "-vs120-mt", etc. and "vs120" indicates Visual Studio 2013.
>
> Why aren't you using the Boost find module[2] included with CMake? It
> already accounts for Boost's library name mangling.
>
> The module uses e.g. the MSVC12 [3] variable to detect "vc120".
> But I am guessing CMAKE__COMPILER_VERSION [4] might work for this
> use case nowadays as well.
>
> Nils
>
> [1] https://cmake.org/cmake/help/v3.4/variable/MSVC_IDE.html
> [2] https://cmake.org/cmake/help/v3.4/module/FindBoost.html
> [3] https://cmake.org/cmake/help/v3.4/variable/MSVC12.html
> [4]
> https://cmake.org/cmake/help/v3.4/variable/CMAKE_LANG_COMPILER_VERSION.html
>
-- 

Regards,
David
-- 

Powered by www.kitware.com

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

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

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

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

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

Re: [CMake] How to get current visualstudio version?

2015-12-27 Thread Xi Shen
Strange, the FindBoost module expects boost libraries start with "boost_"
by default. But the libraries I got from the default build configuration
start with "libboost_". No wonder it did not work the first I tried.


Thanks,
David


On Mon, Dec 28, 2015 at 1:15 PM Xi Shen  wrote:

> Yes, the official FindBoost works better xD
>
>
> On Fri, Dec 25, 2015 at 8:40 PM Nils Gladitz 
> wrote:
>
>> On 25.12.2015 10:36, Xi Shen wrote:
>> > Hi,
>> >
>> > I know I can check MSVC to determine if the Visual Studio generator is
>> > used. But how do I find out which version is been used?
>>
>> MSVC indicates that the Visual C++ compiler (or something compatible) is
>> being used; which does not necessarily mean a Visual Studio generator.
>> If you do need to make that distinction you can check MSVC_IDE [1]
>> instead.
>>
>> >
>> > The reason I want to find the the version of VS being used, is because
>> > I need to link to the Boost libraries. Boost create its libraries with
>> > suffixes like "-vs120-mt", etc. and "vs120" indicates Visual Studio
>> 2013.
>>
>> Why aren't you using the Boost find module[2] included with CMake? It
>> already accounts for Boost's library name mangling.
>>
>> The module uses e.g. the MSVC12 [3] variable to detect "vc120".
>> But I am guessing CMAKE__COMPILER_VERSION [4] might work for this
>> use case nowadays as well.
>>
>> Nils
>>
>> [1] https://cmake.org/cmake/help/v3.4/variable/MSVC_IDE.html
>> [2] https://cmake.org/cmake/help/v3.4/module/FindBoost.html
>> [3] https://cmake.org/cmake/help/v3.4/variable/MSVC12.html
>> [4]
>>
>> https://cmake.org/cmake/help/v3.4/variable/CMAKE_LANG_COMPILER_VERSION.html
>>
> --
>
> Regards,
> David
>
-- 

Regards,
David
-- 

Powered by www.kitware.com

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

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

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

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

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