[Cmake-commits] CMake branch, master, updated. v3.13.2-807-g99a0a6d

2019-01-06 Thread Kitware Robot via Cmake-commits
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  99a0a6d8163f27daf08e53da95b8c685bcd5189e (commit)
   via  08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce (commit)
   via  52445300d67df73b5b8c288cc33c915053c7ba24 (commit)
   via  1bac4678eaf7beefb12ad91ecdea0e551b4d0fcf (commit)
   via  5072598f0795f44e157bef8423feda7de24c5504 (commit)
   via  428680da92b98755be1a908ee4a5d705d8753bb9 (commit)
  from  d3e0e65de3dc8fbc8b96ef9780bffe7390bf6b70 (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=99a0a6d8163f27daf08e53da95b8c685bcd5189e
commit 99a0a6d8163f27daf08e53da95b8c685bcd5189e
Merge: d3e0e65 08be74b
Author: Craig Scott 
AuthorDate: Sun Jan 6 20:05:18 2019 +
Commit: Kitware Robot 
CommitDate: Sun Jan 6 15:05:32 2019 -0500

Merge topic 'bundle_fixes'

08be74bfd7 GetPrerequisites: Fix handling of executable scripts
52445300d6 GetPrerequisites: Allow prefixed tools
1bac4678ea GetPrerequisites: Add GET_PREREQUISITES_VERBOSE to set verbose
5072598f07 BundleUtilites: Don't use hardcoded name for install_name_tool
428680da92 GetPrerequisites: Don't use hardcoded name for otool

Acked-by: Kitware Robot 
Merge-request: !2748


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce
commit 08be74bfd7e24af9ffdb64dddffd3d56bf52c3ce
Author: Alexander Grund 
AuthorDate: Sun Dec 16 18:05:23 2018 +0100
Commit: Craig Scott 
CommitDate: Sat Jan 5 09:09:39 2019 +1100

GetPrerequisites: Fix handling of executable scripts

Fixes: #18667

diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index d3b773c..fa6d75a 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -660,6 +660,15 @@ function(get_prerequisites target prerequisites_var 
exclude_system recurse exepa
 return()
   endif()
 
+  # Check for a script by extension (.bat,.sh,...) or if the file starts with 
"#!" (shebang)
+  file(READ ${target} file_contents LIMIT 5)
+  if(target MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" OR file_contents MATCHES 
"^#!")
+message(STATUS "GetPrequisites(${target}) : ignoring script file")
+# Clear var
+set(${prerequisites_var} "" PARENT_SCOPE)
+return()
+  endif()
+
   set(gp_cmd_paths ${gp_cmd_paths}
 
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/../../VC/bin"
 "$ENV{VS140COMNTOOLS}/../../VC/bin"
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt 
b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt
new file mode 100644
index 000..5a353d8
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt
@@ -0,0 +1,3 @@
+-- GetPrequisites\(.*script.sh\) : ignoring script file
+-- GetPrequisites\(.*script.bat\) : ignoring script file
+-- GetPrequisites\(.*script\) : ignoring script file
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake 
b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
new file mode 100644
index 000..d1bc9b1
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
@@ -0,0 +1,19 @@
+include(GetPrerequisites)
+
+function(check_script script)
+  set(prereqs "")
+  get_prerequisites(${script} prereqs 1 1 "" "")
+  if(NOT "${prereqs}" STREQUAL "")
+message(FATAL_ERROR "Prerequisites for ${script} not empty")
+  endif()
+endfunction()
+
+# Should not throw any errors
+# Regular executable
+get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "")
+# Shell script
+check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
+# Batch script
+check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat)
+# Shell script without extension
+check_script(${CMAKE_CURRENT_LIST_DIR}/script)
diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake 
b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
index 3856c54..a635e38 100644
--- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
 include(RunCMake)
 
 run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P 
${RunCMake_SOURCE_DIR}/TargetMissing.cmake)
+run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P 
${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake)
diff --git a/Tests/RunCMake/GetPrerequisites/script 
b/Tests/RunCMake/GetPrerequisites/script
new file mode 100755
index 000..23bf47c
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/script
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "Hello World"
diff --git a/Tests/RunCMake/GetPrerequisites/script.bat 
b/Tests/RunCMake/GetPrerequisites/script.bat

Re: [CMake] Check Build Type/Config Changed

2019-01-06 Thread frodak17
On Sun, Jan 6, 2019 at 10:00 AM Romain LEGUAY 
wrote:

> Thank you for your answer!
>
> What I found strange is that CMAKE_CONFIGURATION_TYPES and
> CMAKE_BUILD_TYPE are empty at the begining of the cmake script.
>
> When do those variables instanciated?
>
> The purpose to know if the build type changed is to reactivate a
> superbuild variable to build my external dependencies in the good build
> type.
>
>
Either of them can be set at the command line using -D or preloaded into
the cache.

Then either of them can be set by whatever CMakeLists.txt is doing.
For example I've seen some projects set CMAKE_BUILD_TYPE to RELEASE if it
wasn't already set by the user.

Then for Visual Studio generator it will set CMAKE_CONFIGURATION_TYPES if
it wasn't already set by something else when it processes the project()
command.

So for Makefile generators CMAKE_BUILD_TYPE it might never be set.  This
indicates its a generic build and not one of DEBUG/RELEASE/etc which adds
extra flags to the generic build.

CMAKE_CONFIGURATION_TYPES isn't really safe to check until after the
project() command.
But CMAKE_CONFIGURATION_TYPES is just a list of all possible build types is
does not contain the last chosen build.

You mentioned that you were using Visual Studio 2017 as the generator.
Then you should know since it's a multi config generator CMAKE_BUILD_TYPE
is ignored and has no bearing on the build type.
This is because the build type isn't known at configuration time but at
build time when the user selects the build type from the GUI.
Also a user could even change the build type per target if they don't just
do a build all.
-- 

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


[cmake-developers] help: any tools to create user id & password

2019-01-06 Thread dinofifa
Good morning,

I try to commercialize a Windows based application build with Cmake. Is
there any tools to achieve the following goals?
1. encrypt the whole build or certain sensitive files
2. generate user id and password for each customers
3. set expiration date for each user access

Jackie
-- 

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


Re: [CMake] Check Build Type/Config Changed

2019-01-06 Thread Romain LEGUAY
Thank you for your answer!

What I found strange is that CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE
are empty at the begining of the cmake script.

When do those variables instanciated?

The purpose to know if the build type changed is to reactivate a superbuild
variable to build my external dependencies in the good build type.

Le sam. 5 janv. 2019 à 17:35, frodak17  a écrit :

>
>
> On Sat, Jan 5, 2019 at 11:08 AM Romain LEGUAY 
> wrote:
>
>> Hi everyone,
>>
>>
>>
>> Is there a way to test if the build type changed?
>>
>>
>> I try to create a cache variable with CMAKE_BUILD_TYPE as value but I
>> found an unexpected result: CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES
>> are not defined (I'm working on Windows with Visual Studio 2017, Visual
>> Studio Code and Qt Creator).
>>
>>
>> Thank you,
>>
>>
>>
> CMAKE_CONFIGURATION_TYPES is used by multi-config generators and
> CMAKE_BUILD_TYPE isn't used.
> CMAKE_CONFIGURATION_TYPES should default to
> "Debug;Release;MinSizeRel;RelWithDebInfo" for Visual Studio generators
> unless it was explicitly set to something else.
>
> If you aren't using a multi-config generator then CMAKE_BUILD_TYPE will be
> empty unless it was set by the user or the CMakeLists.txt sets a default
> value if empty.
>
> When building with Visual Studio the build type probably could be written
> to a file using a post-build rule or something like that.
>
-- 

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