[Cmake-commits] CMake branch, master, updated. v3.6.1-471-g09a86b3

2016-07-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  09a86b392e6eb7ffa1c697b225c436e07d21d7da (commit)
  from  73c618be7036c693cbff764b3765de1bf4626cfb (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=09a86b392e6eb7ffa1c697b225c436e07d21d7da
commit 09a86b392e6eb7ffa1c697b225c436e07d21d7da
Author: Kitware Robot <kwro...@kitware.com>
AuthorDate: Thu Jul 28 00:01:04 2016 -0400
Commit: Kitware Robot <kwro...@kitware.com>
CommitDate: Thu Jul 28 00:01:04 2016 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 65cc83c..8d3746f 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 6)
-set(CMake_VERSION_PATCH 20160727)
+set(CMake_VERSION_PATCH 20160728)
 #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


[CMake] exporting targets from build tree

2016-07-27 Thread Michael Legleux
I have 2 projects (one built with cmake, one in the process of being
converted to using it)

Project A (built with cmake) builds lib_a that Project B requires.
I'm thinking I'm doing something wrong around here:
project(lib_a)
...
add_library(lib_a STATIC ${SRC})
 target_link_libraries(${PROJECT_NAME}
   PRIVATE lib_b
   )
export(TARGETS lib_a FILE lib_a.cmake)

cmake complains that lib_b is not in the target export set. I do not WANT
it exported and it is not required by project b.
I simply want lib_a to be found/used by Project B via find_package(Project
A)

I do not want to have to install/ or create a package for this behavior,
just allow another project to reference the libs in the build tree and
headers in the source tree.

I can't seem to find the correct way to express this with cmake despite
looking at many solutions of near similar functionality.
-- 

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, next, updated. v3.6.1-989-g10aeccb

2016-07-27 Thread Daniel Pfeifer
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, next has been updated
   via  10aeccbfbd4d34050a470f59757a81cd553f0eb2 (commit)
   via  7a649111cdea2b10f2ec57084416be619867fbfb (commit)
   via  5d0d980d9949daf596e10715d686adc95c1c232b (commit)
   via  73c618be7036c693cbff764b3765de1bf4626cfb (commit)
   via  8f884f2146132a3815b0295b1bfbfde1 (commit)
  from  e752540b9f56d82cc5527c681c3883df66730c48 (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=10aeccbfbd4d34050a470f59757a81cd553f0eb2
commit 10aeccbfbd4d34050a470f59757a81cd553f0eb2
Merge: e752540 7a64911
Author: Daniel Pfeifer 
AuthorDate: Wed Jul 27 18:45:30 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Wed Jul 27 18:45:30 2016 -0400

Merge topic 'use-string-append' into next

7a649111 Use string(APPEND) in Tests
5d0d980d Use string(APPEND) in Modules
73c618be CMake Nightly Date Stamp
8f884f21 CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7a649111cdea2b10f2ec57084416be619867fbfb
commit 7a649111cdea2b10f2ec57084416be619867fbfb
Author: Daniel Pfeifer 
AuthorDate: Thu Jul 28 00:43:04 2016 +0200
Commit: Daniel Pfeifer 
CommitDate: Thu Jul 28 00:43:04 2016 +0200

Use string(APPEND) in Tests

Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'

diff --git a/Tests/AliasTarget/CMakeLists.txt b/Tests/AliasTarget/CMakeLists.txt
index 47ccbdc..f9ae03a 100644
--- a/Tests/AliasTarget/CMakeLists.txt
+++ b/Tests/AliasTarget/CMakeLists.txt
@@ -8,7 +8,7 @@ set(CMAKE_CXX_STANDARD 98)
 # template support also need a flag to use the newer C++ library.
 if (CMAKE_CXX_COMPILER_ID STREQUAL HP AND
 CMAKE_CXX98_STANDARD_COMPILE_OPTION STREQUAL "+hpxstd98")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA")
+  string(APPEND CMAKE_CXX_FLAGS " -AA")
 endif ()
 
 # Clang/C2 in C++98 mode cannot properly handle some of MSVC headers
diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt 
b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
index 9528aa3..f058c19 100644
--- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
@@ -50,7 +50,7 @@ else ()
 endif ()
 
 if (CMAKE_COMPILER_IS_GNUCXX)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+  string(APPEND CMAKE_CXX_FLAGS " -O3")
   unset(CSE_RESULT_O3 CACHE)
   message(STATUS "Testing with optimization -O3")
 
diff --git a/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt 
b/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt
index f06d5c3..a584505 100644
--- a/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt
@@ -77,7 +77,7 @@ endforeach()
 set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
 
 if (CMAKE_COMPILER_IS_GNUCC)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+string(APPEND CMAKE_C_FLAGS " -O3")
 unset(CSHM_RESULT_O3 CACHE)
 unset(CSHM_RESULT_O3_C CACHE)
 unset(CSHM_RESULT_O3_CXX CACHE)
diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt 
b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
index 7656577..7f01463 100644
--- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt
@@ -39,7 +39,7 @@ else ()
 endif ()
 
 if (CMAKE_COMPILER_IS_GNUCC)
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+  string(APPEND CMAKE_C_FLAGS " -O3")
   unset(CSE_RESULT_O3 CACHE)
   message(STATUS "Testing with optimization -O3")
 
diff --git a/Tests/CMakeTests/ModuleNoticesTest.cmake.in 
b/Tests/CMakeTests/ModuleNoticesTest.cmake.in
index 8ecebd3..7bea0af 100644
--- a/Tests/CMakeTests/ModuleNoticesTest.cmake.in
+++ b/Tests/CMakeTests/ModuleNoticesTest.cmake.in
@@ -35,7 +35,7 @@ foreach(module ${all_modules})
   message(STATUS "module: ${module}")
   file(READ "${dir}/${module}" module_content)
   if(NOT "${module_content}" MATCHES "${notice_regex}")
-set(notice_missing "${notice_missing}  ${module}\n")
+string(APPEND notice_missing "  ${module}\n")
   endif()
 endforeach()
 
diff --git a/Tests/CMakeTests/WhileTest.cmake.in 
b/Tests/CMakeTests/WhileTest.cmake.in
index cc22978..9066544 100644
--- a/Tests/CMakeTests/WhileTest.cmake.in
+++ b/Tests/CMakeTests/WhileTest.cmake.in
@@ -2,13 +2,13 @@ set(NUMBERS "")
 set(COUNT 0)
 
 while(COUNT LESS 200)
-set(NUMBERS "${NUMBERS} ${COUNT}")
+string(APPEND NUMBERS " ${COUNT}")
 set(COUNT "2${COUNT}")
 
   

Re: [CMake] What is a utility target ?

2016-07-27 Thread Craig Scott
There may be a way to tell, but nothing is coming to mind at the moment.
Maybe someone else on the list can chime in?


On Thu, Jul 28, 2016 at 5:36 AM, Azharuddin Mohammed <
azhar...@codeaurora.org> wrote:

> Thanks for the explanation, Craig. Is there a way to detect if the target
> was a physical file created using add_library/add_executable, or a
> utility target created using add_custom_target  in order to conditionally
> call the target_link_libraries command ? There is the condition if(TARGET
> target-name) , but according to the documentation it returns true for any 
> existing
> logical target name such as those created by the *add_executable()*
> 
> , *add_library()*
> ,
> or *add_custom_target()*
> 
>  commands.
>
>
>
> *From:* Craig Scott [mailto:craig.sc...@crascit.com]
> *Sent:* Monday, July 25, 2016 1:52 PM
> *To:* Azharuddin Mohammed 
> *Cc:* CMake 
> *Subject:* Re: [CMake] What is a utility target ?
>
>
>
> In the context of that particular part of the CMake documentation, it is
> referring to targets that are not created by add_library() or
> add_executable(). Targets created by add_custom_target() are not something
> CMake knows what to do with if you give them to the target_link_libraries()
> command, since these custom targets may not (and typically won't)
> correspond to a physical file being created (that's what
> add_custom_command() is for). So the term *utility target* can be thought
> of as being a custom target you create for convenience, but not something
> which actually corresponds to a library or executable. Examples of utility
> targets that CMake will automatically create for you include things like
> *all*, *test*, *package*, etc.
>
>
>
>
>
> On Tue, Jul 26, 2016 at 6:39 AM, Azharuddin Mohammed <
> azhar...@codeaurora.org> wrote:
>
> Hi
>
>
>
> CMake Policy CMP0039 (
> https://cmake.org/cmake/help/v3.0/policy/CMP0039.html) mentions that “Utility
> targets may not have link dependencies” . Can someone please explain what
> does “utility targets” mean ?
>
>
>
> Thanks
>
>
>
> -
>
> Azhar
>
>
> --
>
> 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
>
>
>
>
>
> --
>
> Craig Scott
>
> Melbourne, Australia
>
> http://crascit.com
>



-- 
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] What is a utility target ?

2016-07-27 Thread Azharuddin Mohammed
Thanks for the explanation, Craig. Is there a way to detect if the target was a 
physical file created using add_library/add_executable, or a utility target 
created using add_custom_target  in order to conditionally call the 
target_link_libraries command ? There is the condition if(TARGET target-name) , 
but according to the documentation it returns true for any existing logical 
target name such as those created by the  

 add_executable(),  

 add_library(), or  

 add_custom_target() commands. 

 

From: Craig Scott [mailto:craig.sc...@crascit.com] 
Sent: Monday, July 25, 2016 1:52 PM
To: Azharuddin Mohammed 
Cc: CMake 
Subject: Re: [CMake] What is a utility target ?

 

In the context of that particular part of the CMake documentation, it is 
referring to targets that are not created by add_library() or add_executable(). 
Targets created by add_custom_target() are not something CMake knows what to do 
with if you give them to the target_link_libraries() command, since these 
custom targets may not (and typically won't) correspond to a physical file 
being created (that's what add_custom_command() is for). So the term utility 
target can be thought of as being a custom target you create for convenience, 
but not something which actually corresponds to a library or executable. 
Examples of utility targets that CMake will automatically create for you 
include things like all, test, package, etc.

 

 

On Tue, Jul 26, 2016 at 6:39 AM, Azharuddin Mohammed  > wrote:

Hi

 

CMake Policy CMP0039 (https://cmake.org/cmake/help/v3.0/policy/CMP0039.html) 
mentions that “Utility targets may not have link dependencies” . Can someone 
please explain what does “utility targets” mean ? 

 

Thanks

 

-

Azhar


--

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





 

-- 

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-developers] Autogen subdirectories patches

2016-07-27 Thread Sebastian Holtermann

Am 27.07.2016 um 19:31 schrieb Ben Boeckel:

On Wed, Jul 27, 2016 at 17:49:40 +0200, Sebastian Holtermann wrote:

Is there an error exit function in CMake?
Or just exit(-1);


Here's an example I found:

this->Makefile->IssueMessage(
  cmake::INTERNAL_ERROR, "fileFound is true but FileFound is empty!");

after that, it is treated as if an error occurred; this loop should
probably be bailed from.


Unfortunately the function is called in two places of which one
does not provide a Makefile (the cmake -E call).

It is very unlikely that an invalid character appears ever
and if it does it is likely that something else is very wrong.
In the patch I sent earlier in this case cmake just drops a note
via std::cerr and calls exit(-1). IMO this is sufficient.

-Sebastian


--

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] [PATCH v5] For consoles output on Windows use our own std::streambuf

2016-07-27 Thread Dāvis Mosāns
Currently Microsoft's C++ libraries implementation of std::cout/cerr
can't output Unicode characters but only ASCII or ANSI if locale is set
so we implement and use our own ConsoleBuf which can output Unicode
characters to console and it doesn't matter what locale or console's
codepage is set.
---
 CMakeLists.txt   |   1 +
 Source/cmakemain.cxx |   6 +
 Source/kwsys/CMakeLists.txt  |  17 +-
 Source/kwsys/ConsoleBuf.hxx.in   | 318 ++
 Source/kwsys/testConsoleBuf.cxx  | 424 +++
 Source/kwsys/testConsoleBuf.hxx  |  25 +++
 Source/kwsys/testConsoleBufChild.cxx |  59 +
 bootstrap|   1 +
 8 files changed, 850 insertions(+), 1 deletion(-)
 create mode 100644 Source/kwsys/ConsoleBuf.hxx.in
 create mode 100644 Source/kwsys/testConsoleBuf.cxx
 create mode 100644 Source/kwsys/testConsoleBuf.hxx
 create mode 100644 Source/kwsys/testConsoleBufChild.cxx

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ae5990e..792b5a5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -258,6 +258,7 @@ macro (CMAKE_BUILD_UTILITIES)
   set(KWSYS_USE_MD5 1)
   set(KWSYS_USE_Process 1)
   set(KWSYS_USE_CommandLineArguments 1)
+  set(KWSYS_USE_ConsoleBuf 1)
   set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
   set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
   add_subdirectory(Source/kwsys)
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 521a5bf..8b10d50 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -26,6 +26,7 @@
 #include "cmake.h"
 #include "cmcmd.h"
 #include 
+#include 
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
 static const char* cmDocumentationName[][2] = {
@@ -153,6 +154,11 @@ static void cmakemainProgressCallback(const char* m, float 
prog,
 
 int main(int ac, char const* const* av)
 {
+#if defined(_WIN32)
+  // Replace streambuf so we can output Unicode to console
+  cmsys::ConsoleBuf::Manager consoleOut(std::cout);
+  cmsys::ConsoleBuf::Manager consoleErr(std::cerr, true);
+#endif
   cmsys::Encoding::CommandLineArguments args =
 cmsys::Encoding::CommandLineArguments::Main(ac, av);
   ac = args.argc();
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 5fce50f..a211425 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -123,6 +123,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
   SET(KWSYS_USE_FStream 1)
   SET(KWSYS_USE_String 1)
   SET(KWSYS_USE_SystemInformation 1)
+  SET(KWSYS_USE_ConsoleBuf 1)
 ENDIF()
 
 # Enforce component dependencies.
@@ -154,6 +155,9 @@ ENDIF()
 IF(KWSYS_USE_FStream)
   SET(KWSYS_USE_Encoding 1)
 ENDIF()
+IF(KWSYS_USE_ConsoleBuf)
+  SET(KWSYS_USE_Encoding 1)
+ENDIF()
 
 # Setup the large file support default.
 IF(KWSYS_LFS_DISABLE)
@@ -673,7 +677,7 @@ SET(KWSYS_HXX_FILES Configure String ProcessOutput
 # Add selected C++ classes.
 SET(cppclasses
   Directory DynamicLoader Encoding Glob RegularExpression SystemTools
-  CommandLineArguments IOStream FStream SystemInformation
+  CommandLineArguments IOStream FStream SystemInformation ConsoleBuf
   )
 FOREACH(cpp ${cppclasses})
   IF(KWSYS_USE_${cpp})
@@ -926,6 +930,17 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
 testFStream
 )
 ENDIF()
+IF(KWSYS_USE_ConsoleBuf)
+  IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+add_compile_options(/utf-8)
+  ENDIF()
+  ADD_EXECUTABLE(testConsoleBufChild testConsoleBufChild.cxx)
+  SET_PROPERTY(TARGET testConsoleBufChild PROPERTY LABELS 
${KWSYS_LABELS_EXE})
+  TARGET_LINK_LIBRARIES(testConsoleBufChild ${KWSYS_NAMESPACE})
+  SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS}
+testConsoleBuf
+)
+ENDIF()
 IF(KWSYS_USE_SystemInformation)
   SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS} testSystemInformation)
 ENDIF()
diff --git a/Source/kwsys/ConsoleBuf.hxx.in b/Source/kwsys/ConsoleBuf.hxx.in
new file mode 100644
index 000..ed95bb0
--- /dev/null
+++ b/Source/kwsys/ConsoleBuf.hxx.in
@@ -0,0 +1,318 @@
+/*
+  KWSys - Kitware System Library
+  Copyright 2000-2016 Kitware, Inc., Insight Software Consortium
+
+  Distributed under the OSI-approved BSD License (the "License");
+  see accompanying file Copyright.txt for details.
+
+  This software is distributed WITHOUT ANY WARRANTY; without even the
+  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the License for more information.
+*/
+#ifndef @KWSYS_NAMESPACE@_ConsoleBuf_hxx
+#define @KWSYS_NAMESPACE@_ConsoleBuf_hxx
+
+#include <@KWSYS_NAMESPACE@/Configure.hxx>
+#include <@KWSYS_NAMESPACE@/Encoding.hxx>
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if defined(_WIN32)
+#  include 
+#  if __cplusplus >= 201103L
+#include 
+#  endif
+#endif
+
+namespace @KWSYS_NAMESPACE@
+{
+#if 

Re: [cmake-developers] Autogen subdirectories patches

2016-07-27 Thread Sebastian Holtermann

Am 27.07.2016 um 17:49 schrieb Sebastian Holtermann:



Doing so I found that Base64 allows '+' and '/' as characters which is
bad for directory names obviously.
For now these characters get replaced with 'A' and 'B'.


'_' and '@' would be better replacements (with comments why they are
used) since 'A' and 'B' are already characters in Base64.


Some quick research (aka googling) revealed
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278

It seems '_' and '-' are safer choices.


+// unexpected hexchar


This raise an internal error, not just be a comment.


Is there an error exit function in CMake?
Or just exit(-1);


+  }
+}
+hashBytes[ii] = hbyte[0] | (hbyte[1] << 4);
+  }
+}
+// Convert hash bytes to Base64 text string
+{
+  std::vector base64Bytes(hashBytes.size() * 2, 0);
+  cmsysBase64_Encode([0], hashBytes.size(),
[0], 0);
+  checksumBase64 = reinterpret_cast([0]);
+  // Base64 allows '+' and '/' characters. Replace these.


This comment should indicate it is because the string is used as part of
a path and that these characters tend to cause problems in paths.


Ok.



The patch.

-Sebastian


>From 30d0c7b61a2ffbc9004cd32a88330078ec8d75a4 Mon Sep 17 00:00:00 2001
From: Sebastian Holtermann 
Date: Tue, 26 Jul 2016 16:39:12 +0200
Subject: [PATCH] QtAutogen fix for too deep nested directory generation.

Instead of generating moc_* and qrc_* files in subdirectories
that reflect their source's location in the source tree
the files get generated solely in the TARGET_NAME_automoc.dir/
but get a Base64 encoded checksum suffix that was generated
from their source path and a few more seed strings.
---
 Source/cmQtAutoGeneratorInitializer.cxx |  79 +++-
 Source/cmQtAutoGenerators.cxx   | 215 +++-
 Source/cmQtAutoGenerators.h |  21 +++-
 3 files changed, 192 insertions(+), 123 deletions(-)

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index dd19760..6bbe29c 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -12,6 +12,7 @@
 */
 
 #include "cmQtAutoGeneratorInitializer.h"
+#include "cmQtAutoGenerators.h"
 
 #include "cmLocalGenerator.h"
 #include "cmMakefile.h"
@@ -53,49 +54,24 @@ static std::string GetAutogenTargetBuildDir(cmGeneratorTarget const* target)
   return targetDir;
 }
 
-static std::string GetSourceRelativePath(cmGeneratorTarget const* target,
- const std::string& fileName)
+static std::string GetQrcBuildPath(cmGeneratorTarget const* target,
+   const std::string& qrcSourceName)
 {
-  std::string pathRel;
-  // Test if the file is child to any of the known directories
+  std::string rccOutputPath = GetAutogenTargetBuildDir(target);
+  // Create output directory
+  cmSystemTools::MakeDirectory(rccOutputPath.c_str());
+
+  rccOutputPath += "qrc_";
   {
-const std::string fileNameReal = cmsys::SystemTools::GetRealPath(fileName);
-std::string parentDirectory;
-bool match(false);
-{
-  std::string testDirs[4];
-  {
-cmMakefile* makefile = target->Target->GetMakefile();
-testDirs[0] = makefile->GetCurrentSourceDirectory();
-testDirs[1] = makefile->GetCurrentBinaryDirectory();
-testDirs[2] = makefile->GetHomeDirectory();
-testDirs[3] = makefile->GetHomeOutputDirectory();
-  }
-  for (int ii = 0; ii != sizeof(testDirs) / sizeof(std::string); ++ii) {
-const ::std::string testDir =
-  cmsys::SystemTools::GetRealPath(testDirs[ii]);
-if (!testDir.empty() &&
-cmsys::SystemTools::IsSubDirectory(fileNameReal, testDir)) {
-  parentDirectory = testDir;
-  match = true;
-  break;
-}
-  }
-}
-// Use root as fallback parent directory
-if (!match) {
-  cmsys::SystemTools::SplitPathRootComponent(fileNameReal,
- );
-}
-pathRel = cmsys::SystemTools::RelativePath(
-  parentDirectory, cmsys::SystemTools::GetParentDirectory(fileNameReal));
+cmMakefile* makefile = target->Target->GetMakefile();
+rccOutputPath += cmQtAutoGeneratorUtil::BuildFileBase(
+  qrcSourceName, makefile->GetCurrentSourceDirectory(),
+  makefile->GetCurrentBinaryDirectory(), makefile->GetHomeDirectory(),
+  makefile->GetHomeOutputDirectory());
   }
-  // Sanitize relative path
-  if (!pathRel.empty()) {
-pathRel += '/';
-cmSystemTools::ReplaceString(pathRel, "..", "__");
-  }
-  return pathRel;
+  rccOutputPath += ".cpp";
+
+  return rccOutputPath;
 }
 
 static void SetupSourceFiles(cmGeneratorTarget const* target,
@@ -129,15 +105,7 @@ static void SetupSourceFiles(cmGeneratorTarget const* 

Re: [cmake-developers] Autogen subdirectories patches

2016-07-27 Thread Sebastian Holtermann



Doing so I found that Base64 allows '+' and '/' as characters which is
bad for directory names obviously.
For now these characters get replaced with 'A' and 'B'.


'_' and '@' would be better replacements (with comments why they are
used) since 'A' and 'B' are already characters in Base64.


Some quick research (aka googling) revealed
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278
It seems '_' and '-' are safer choices.


+// unexpected hexchar


This raise an internal error, not just be a comment.


Is there an error exit function in CMake?
Or just exit(-1);


+  }
+}
+hashBytes[ii] = hbyte[0] | (hbyte[1] << 4);
+  }
+}
+// Convert hash bytes to Base64 text string
+{
+  std::vector base64Bytes(hashBytes.size() * 2, 0);
+  cmsysBase64_Encode([0], hashBytes.size(), [0], 0);
+  checksumBase64 = reinterpret_cast([0]);
+  // Base64 allows '+' and '/' characters. Replace these.


This comment should indicate it is because the string is used as part of
a path and that these characters tend to cause problems in paths.


Ok.

-Sebastian

--

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] Autogen subdirectories patches

2016-07-27 Thread Ben Boeckel
On Tue, Jul 26, 2016 at 23:38:34 +0200, Sebastian Holtermann wrote:
> Doing so I found that Base64 allows '+' and '/' as characters which is 
> bad for directory names obviously.
> For now these characters get replaced with 'A' and 'B'.

'_' and '@' would be better replacements (with comments why they are
used) since 'A' and 'B' are already characters in Base64.

> +// unexpected hexchar

This raise an internal error, not just be a comment.

> +  }
> +}
> +hashBytes[ii] = hbyte[0] | (hbyte[1] << 4);
> +  }
> +}
> +// Convert hash bytes to Base64 text string
> +{
> +  std::vector base64Bytes(hashBytes.size() * 2, 0);
> +  cmsysBase64_Encode([0], hashBytes.size(), [0], 
> 0);
> +  checksumBase64 = reinterpret_cast([0]);
> +  // Base64 allows '+' and '/' characters. Replace these.

This comment should indicate it is because the string is used as part of
a path and that these characters tend to cause problems in paths.

--Ben
-- 

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-commits] CMake branch, next, updated. v3.6.1-984-ge752540

2016-07-27 Thread Chuck Atkins
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, next has been updated
   via  e752540b9f56d82cc5527c681c3883df66730c48 (commit)
   via  9e301f70e0f665aed783977a239d2712775a0aa0 (commit)
   via  3d57541d6d4fa094db0ceede2972d27d0a0a0246 (commit)
   via  ffc7c24b2e91ce47718237e6cc90a21358833426 (commit)
   via  d615d20a63ce4fae5ada3881f4d154bfc4385fd7 (commit)
  from  858f96eab547ea0970bc087d6d0b77c26f4a377a (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=e752540b9f56d82cc5527c681c3883df66730c48
commit e752540b9f56d82cc5527c681c3883df66730c48
Merge: 858f96e 9e301f7
Author: Chuck Atkins 
AuthorDate: Wed Jul 27 10:32:59 2016 -0400
Commit: CMake Topic Stage 
CommitDate: Wed Jul 27 10:32:59 2016 -0400

Merge topic 'add-findszip' into next

9e301f70 FindSZIP: Add a new find module to locate the SZIP library.
3d57541d CMake Nightly Date Stamp
ffc7c24b CMake Nightly Date Stamp
d615d20a CMake Nightly Date Stamp


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e301f70e0f665aed783977a239d2712775a0aa0
commit 9e301f70e0f665aed783977a239d2712775a0aa0
Author: Chuck Atkins 
AuthorDate: Mon Jul 25 13:07:02 2016 -0400
Commit: Chuck Atkins 
CommitDate: Wed Jul 27 10:23:44 2016 -0400

FindSZIP: Add a new find module to locate the SZIP library.

diff --git a/Modules/FindSZIP.cmake b/Modules/FindSZIP.cmake
new file mode 100644
index 000..872907d
--- /dev/null
+++ b/Modules/FindSZIP.cmake
@@ -0,0 +1,133 @@
+#.rst:
+# FindSZIP
+# -
+#
+# Find SZIP, a compression library developed by HDF5.
+#
+# Once done this will define
+#
+# ::
+#   SZIP_FOUND - System has SZIP
+#   SZIP_INCLUDE_DIRS - The SZIP include directories to use
+#   SZIP_LIBRARIES - Link these to use SZIP
+#   SZIP_VERSION - The version of SZIP found
+# ::
+#
+# The following imported target is also created:
+#
+# ::
+# SZIP::SZIP
+# ::
+#
+# The following variable can be set to guide the search for SZIP libraries and
+# includes:
+#   SZIP_ROOT_DIR -
+# Search order preference is SZIP_ROOT_DIR followed by ENV{SZIP_INSTALL}.
+# If SZIP_ROOT_DIR is specified then it is searched exclusively, ignoring
+# default search paths.
+
+#=
+# Copyright 2006-2016 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+function(_SZIP_get_version)
+  set(scratch_dir ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/szip)
+  set(test_file ${scratch_dir}/cmake_szip_version.c)
+  file(WRITE ${test_file}
+"#include \n"
+"#include \n"
+"int main(void) {\n"
+"  char const* info_ver = \"INFO\" \":\" SZLIB_VERSION;\n"
+"  return 0;\n"
+"}")
+  try_compile(szip_version_test ${scratch_dir} ${test_file}
+CMAKE_FLAGS -DINCLUDE_DIRECTORIES=${SZIP_INCLUDE_DIR}
+COPY_FILE ${scratch_dir}/cmake_szip_version)
+  if(szip_version_test)
+file(STRINGS ${scratch_dir}/cmake_szip_version INFO_VER
+  REGEX "^INFO:([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?)$")
+string(REGEX MATCH "^INFO:([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?)$"
+  INFO_VER "${INFO_VER}")
+set(SZIP_VERSION ${CMAKE_MATCH_1} PARENT_SCOPE)
+  endif()
+endfunction()
+
+# If the root dir is explicitly specified, then ONLY look there
+if(SZIP_ROOT_DIR)
+  set(SZIP_SEARCH_OPTS NO_DEFAULT_PATH)
+else()
+  # Otherwise initialize from an environment variable
+  set(SZIP_ROOT_DIR $ENV{SZIP_INSTALL})
+endif()
+
+# If we do have a root dir, use it as a hint
+if(SZIP_ROOT_DIR)
+  set(SZIP_SEARCH_PATHS HINTS ${SZIP_ROOT_DIR})
+endif()
+
+# Find the main header
+find_path(SZIP_INCLUDE_DIR NAMES szlib.h
+  ${SZIP_SEARCH_PATHS} ${SZIP_SEARCH_OPTS}
+  PATH_SUFFIXES include include/szip Include Include/szip)
+
+# Find the release library
+set(SZIP_LIBRARY_RELEASE_NAMES sz szip)
+if(WIN32)
+  list(APPEND SZIP_LIBRARY_RELEASE_NAMES libsz libszip)
+endif()
+find_library(SZIP_LIBRARY_RELEASE NAMES ${SZIP_LIBRARY_RELEASE_NAMES}
+  ${SZIP_SEARCH_PATHS} ${SZIP_SEARCH_OPTS}
+  PATH_SUFFIXES lib Lib)
+
+# Find the debug library