[cmake-developers] speed up package with mingw on Windows host

2016-06-18 Thread laurent
Hello,

I would like to share my experience about speed up package with BundleUtilities 
on Windows host using mingw32 env.
My test setup :
- Windows 7
- cmake 3.4.1
- msys2 i686-20160205

Currently my project take about 40 min to package. This is not acceptable. The 
main reason is about deep dependencies analyse with objdump.

1/ There is already a patch trying to resolve this issue : 
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f01a8823 

But this patch use grep. grep is a unix utility not provided by Windows.
grep could be replaced by findstr on Windows. This way we can achieve the same 
level of filtering with the same criteria.


2/ Regarding fixup_bundle flow, we can observe multi recursive analyse call to 
the same library. This is an huge time consumer. 
This simple patch disable analyse of already processed libraries. (The time to 
package my project drop down to 4 min with this patch)

--- GetPrerequisites.cmake  2016-04-15 15:41:21.0 +0200
+++ GetPrerequisites.cmake.new  2016-06-18 17:36:19.0 +0200

@@ -727,7 +727,11 @@
 set(gp_regex_fallback "")
 set(gp_regex_cmp_count 1)
 # objdump generaates copious output so we create a grep filter to 
pre-filter results
-find_program(gp_grep_cmd grep)
+if(WIN32)
+  find_program(gp_grep_cmd findstr)
+else()
+  find_program(gp_grep_cmd grep)
+endif()
 if(gp_grep_cmd)
   set(gp_cmd_maybe_filter COMMAND ${gp_grep_cmd} "^[[:blank:]]*DLL Name: ")
 endif()
@@ -920,9 +924,18 @@
 list(SORT ${prerequisites_var})
   endif()
   if(${recurse})
+GET_PROPERTY(MyLocalVariable GLOBAL PROPERTY MY_PREREQUISE)
+list(APPEND analysed ${MyLocalVariable} ${target})
+list(REMOVE_DUPLICATES analysed)
+SET_PROPERTY(GLOBAL PROPERTY MY_PREREQUISE ${analysed})
+
 set(more_inputs ${unseen_prereqs})
 foreach(input ${more_inputs})
-  get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} 
${recurse} "${exepath}" "${dirs}" "${rpaths}")
+  GET_PROPERTY(MyTmp GLOBAL PROPERTY MY_PREREQUISE)
+  list (FIND MyTmp ${input} is_found)
+  if(${is_found} EQUAL -1)
+   get_prerequisites("${input}" ${prerequisites_var} ${exclude_system} 
${recurse} "${exepath}" "${dirs}" "${rpaths}")
+  endif()
 endforeach()
   endif()
 
Laurent-- 

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-developers] FindPkgConfig and IMPORTED_TARGET in 3.6.0

2016-06-18 Thread Rolf Eike Beer
Ben Boeckel wrote:
> Hi,
> 
> Nils, the IMPORTED_TARGET feature in pkg_check_modules is nice! Thanks
> for that. However, it is hidden behind the check that pkg_check_modules
> uses to see if it already ran:
> 
> if (NOT DEFINED __pkg_config_checked_${_prefix} OR
> __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR
> NOT ${_prefix}_FOUND)
> 
> which means that on the second configure, the target is not created
> causing build faiures. Could you please look at reordering the logic so
> that the imported target is always created (if requested)? Thanks.
> 
> Brad, this is in the rc releases; what should be done? Block the
> release, undocument the feature, or wait for a patch?

Please check if 
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3213b747a84a4e584e9edc6bd8c114b809b18bec
 
fixes it for you.

Eike
-- 

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

Powered by www.kitware.com

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

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

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

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

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

[cmake-developers] How to set startup project in Visual Studio

2016-06-18 Thread Stephen Kelly
Hi, 

the outcome of 

 https://cmake.org/Bug/view.php?id=15578

seems to be 

 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=78ec0461 

a DIRECTORY property VS_STARTUP_PROJECT which sets the start up project in 
Visual Studio. I tried it in the 3.6 RC and it works fine if I set the 
property in the top-level directory, so thanks for that.

However, the documentation does not say which directory to set it in, or why 
it is a DIRECTORY property. 

Why is this not a GLOBAL property?

Thanks,

Steve.


-- 

Powered by www.kitware.com

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

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

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

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

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


[cmake-developers] CMake 32 and 64 bit packages on Windows

2016-06-18 Thread Stephen Kelly
Hi,

I tried the CMake 3.6 RC on Windows yesterday. I initially downloaded the 64 
bit version, and the installer uninstalled my CMake 3.5 (32 bit).

Then, in my 'Visual Studio 14 2015 64 bit command prompt', the cmake 
executable was no longer found. I think the difference is that the 64 bit 
cmake is installed to 'Program Files (x64)', whereas the 32 bit version is 
installed to 'Program Files'. I installed the 3.6 RC 32 bit and that worked 
fine with my command prompt.

It is possible that I somehow made a mistake or messed up my visual studio 
command prompt environment (I don't recall doing that), but it didn't seem 
to be looking in the 64 bit location for cmake. It might be something for 
someone more familiar with Windows to look into.

Thanks,

Steve.


-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [cmake-developers] [Patch] Two trivial patches fixing type in CPack/DEB testcase

2016-06-18 Thread mail6543210--- via cmake-developers
My bad. It's exactly a dot when that file is within an SELinux context.

I forgot the backslash.

Here're the refreshed patches.

BR,
Patrick

2016-06-16 20:45 GMT+08:00 Rolf Eike Beer :

> Am 2016-06-16 13:37, schrieb mail6543210--- via cmake-developers:
>
>> Hi there,
>>
>> Here're two trivial patches for testing of CPack/DEB.
>>
>> One is for building cmake on SELinux-enabled system, and other is for a
>> typo in the same file form the former one.
>>
>> These patches is based on commit 83ae7944
>>
>> First patch:
>>
>> When building cmake on an SELinux-enabled system, there will be an extra
>> dot at the end of permission field of `ls -l` like this:
>> -rwxrwxrwx.
>>   ^ this dot
>> This makes the testing RunCMake.CPack_DEB fail.
>>
>> This patch add an optional dot in the regex to fix it.
>>
>
> If it is exactly a dot and not "some random character", than you need to
> escape that in the regular expression as dot is the wildcard character
> there.
>
> Greetings,
>
> Eike
>
From b90c84cbfd21551859547f07cf3533247e529851 Mon Sep 17 00:00:00 2001
From: mail6543210 
Date: Thu, 16 Jun 2016 17:18:40 +0800
Subject: [PATCH 1/2] Enable building on SELinux-enabled system

---
 Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
index 5f929ff..da8983c 100644
--- a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
@@ -1,17 +1,17 @@
 set(foo_preinst "^echo default_preinst$")
-set(foo_preinst_permissions_regex "-rwxr-xr-x .*")
+set(foo_preinst_permissions_regex "-rwxr-xr-x\.? .*")
 set(foo_prerm "^echo default_prerm$")
-set(foo_prerm_permissions_regex "-rwxr-xr-x .*")
+set(foo_prerm_permissions_regex "-rwxr-xr-x\.? .*")
 verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm")
 
 set(bar_preinst "^echo bar_preinst$")
-set(bar_prerm_permissions_regex "-rwx-- .*")
+set(bar_prerm_permissions_regex "-rwx--\.? .*")
 set(bar_prerm "^echo bar_prerm$")
-set(bar_prerm_permissions_regex "-rwx-- .*")
+set(bar_prerm_permissions_regex "-rwx--\.? .*")
 verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm")
 
 set(bas_preinst "^echo default_preinst$")
-set(bas_prerm_permissions_regex "-rwxr-xr-x .*")
+set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*")
 set(bas_prerm "^echo default_prerm$")
-set(bas_prerm_permissions_regex "-rwxr-xr-x .*")
+set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*")
 verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm")
-- 
1.9.1

From 4c74501d0522dad68180f04be9e2a117abac9de5 Mon Sep 17 00:00:00 2001
From: mail6543210 
Date: Thu, 16 Jun 2016 17:29:40 +0800
Subject: [PATCH 2/2] Fix typos of testing data in CPack/DEB

---
 Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
index da8983c..95c7ee2 100644
--- a/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEB_EXTRA-VerifyResult.cmake
@@ -5,13 +5,13 @@ set(foo_prerm_permissions_regex "-rwxr-xr-x\.? .*")
 verifyDebControl("${FOUND_FILE_1}" "foo" "preinst;prerm")
 
 set(bar_preinst "^echo bar_preinst$")
-set(bar_prerm_permissions_regex "-rwx--\.? .*")
+set(bar_preinst_permissions_regex "-rwx--\.? .*")
 set(bar_prerm "^echo bar_prerm$")
 set(bar_prerm_permissions_regex "-rwx--\.? .*")
 verifyDebControl("${FOUND_FILE_2}" "bar" "preinst;prerm")
 
 set(bas_preinst "^echo default_preinst$")
-set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*")
+set(bas_preinst_permissions_regex "-rwxr-xr-x\.? .*")
 set(bas_prerm "^echo default_prerm$")
 set(bas_prerm_permissions_regex "-rwxr-xr-x\.? .*")
 verifyDebControl("${FOUND_FILE_3}" "bas" "preinst;prerm")
-- 
1.9.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-developers