[Cmake-commits] CMake branch, master, updated. v3.16.0-rc3-175-g60e7e5b605

2019-11-01 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  60e7e5b60540dfbd1e67c415ee399e4aea59a369 (commit)
  from  6660926f22b940759954e74e2b4c0c3dd0ff1991 (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=60e7e5b60540dfbd1e67c415ee399e4aea59a369
commit 60e7e5b60540dfbd1e67c415ee399e4aea59a369
Author: Kitware Robot 
AuthorDate: Sat Nov 2 00:01:06 2019 -0400
Commit: Kitware Robot 
CommitDate: Sat Nov 2 00:01:06 2019 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7bb9f90075..17a23950bb 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 16)
-set(CMake_VERSION_PATCH 20191101)
+set(CMake_VERSION_PATCH 20191102)
 #set(CMake_VERSION_RC 0)
 set(CMake_VERSION_IS_DIRTY 0)
 

---

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
https://cmake.org/mailman/listinfo/cmake-commits


[CMake] Stray backslash appearing when CMAKE_CXX_FLAGS_RELEASE used in custom command

2019-11-01 Thread Stephen Morris
On 1 November at 10:02, Stephen Morris wrote:

> My approach is basically to set up a custom command thus:
> set(CXX_FLAGS ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})   .. or whatever, 
> depending on the current configuration..
> get_target_property(compile_options, mytarget, COMPILE_OPTIONS) 
> add_custom_command(OUTPUT myheader.h.gch
>  COMMAND ${CMAKE_CXX_COMPILER} 
> ${CXX_FLAGS} ${compile_options} -fPIC -std=gnu++17 -c myheader.h -o 
> myheader.h.gch
>   DEPENDS myheader.h) 
> add_custom_target(BuildMyPCH
> DEPENDS myheader.h.gch) 
> add_dependencies(mytarget, BuildMyPCH)

My earlier question still stands, but at the time I wrote it I had only tested 
it for Debug builds where ${CMAKE_CXX_FLAGS_DEBUG} consisted of a single item, 
'-g'.

I've since tried doing the same thing for a Release build, and this failed 
because ${CMAKE_CXX_FLAGS_RELEASE} has two items, '-O3 -DNDEBUG'. When the 
custom command is executed, this somehow becomes "-O3\ -DNDEBUG" on the command 
line, and the presence of the stray backslash causes the compilation to fail 
with the message,

"cc1plus: error: argument to '-O' should be a non-negative integer. 'g', 's' or 
'fast'"

So why isn't the cmake variable placed properly onto the command line, and what 
can I do to prevent this behaviour?
 

-- 

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-commits] CMake branch, master, updated. v3.16.0-rc3-174-g6660926f22

2019-11-01 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  6660926f22b940759954e74e2b4c0c3dd0ff1991 (commit)
   via  39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc (commit)
   via  80c2c9d14cf1c1a8f162e119bd00d5f483a94af2 (commit)
   via  0187e522448c8fe92c15d4a983afac36950d1d59 (commit)
  from  b42da462333aea986576d00bf9af7449aa6e8010 (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=6660926f22b940759954e74e2b4c0c3dd0ff1991
commit 6660926f22b940759954e74e2b4c0c3dd0ff1991
Merge: b42da46233 39ac8b4eb5
Author: Brad King 
AuthorDate: Fri Nov 1 13:55:09 2019 +
Commit: Kitware Robot 
CommitDate: Fri Nov 1 09:55:18 2019 -0400

Merge topic 'ctest-repeat-until-pass'

39ac8b4eb5 ctest: Add --repeat-after-timeout option
80c2c9d14c ctest: Add --repeat-until-pass option
0187e52244 cmCTestRunTest: Use inline member initializers

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc
commit 39ac8b4eb5c5ea99cf1053bd37e76d811f5122fc
Author: Brad King 
AuthorDate: Tue Oct 29 14:21:38 2019 -0400
Commit: Brad King 
CommitDate: Tue Oct 29 15:14:36 2019 -0400

ctest: Add --repeat-after-timeout option

Add an option to re-run tests if they timeout.  This will help tolerate
sporadic timeouts on busy machines.

diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 031b9a7636..0097cee148 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -268,9 +268,17 @@ Options
 
 ``--repeat-until-pass ``
  Allow each test to run up to  times in order to pass.
+ Repeats tests if they fail for any reason.
 
  This is useful in tolerating sporadic failures in test cases.
 
+``--repeat-after-timeout ``
+ Allow each test to run up to  times in order to pass.
+ Repeats tests only if they timeout.
+
+ This is useful in tolerating sporadic timeouts in test cases
+ on busy machines.
+
 ``--max-width ``
  Set the max width for a test name to output.
 
diff --git a/Help/release/dev/ctest-repeat-until-pass.rst 
b/Help/release/dev/ctest-repeat-until-pass.rst
index 003cdf2aec..d177247181 100644
--- a/Help/release/dev/ctest-repeat-until-pass.rst
+++ b/Help/release/dev/ctest-repeat-until-pass.rst
@@ -1,5 +1,6 @@
 ctest-repeat-until-pass
 ---
 
-* The :manual:`ctest(1)` tool learned a new ``--repeat-until-pass ``
-  option to help tolerate sporadic test failures.
+* The :manual:`ctest(1)` tool learned new ``--repeat-until-pass ``
+  and ``--repeat-after-timeout `` options to help tolerate sporadic
+  test failures.
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index ce9e13bbba..ba146532b6 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -345,7 +345,9 @@ bool cmCTestRunTest::NeedsToRerun()
   if ((this->RerunMode == cmCTest::Rerun::UntilFail &&
this->TestResult.Status == cmCTestTestHandler::COMPLETED) ||
   (this->RerunMode == cmCTest::Rerun::UntilPass &&
-   this->TestResult.Status != cmCTestTestHandler::COMPLETED)) {
+   this->TestResult.Status != cmCTestTestHandler::COMPLETED) ||
+  (this->RerunMode == cmCTest::Rerun::AfterTimeout &&
+   this->TestResult.Status == cmCTestTestHandler::TIMEOUT)) {
 this->RunAgain = true;
 return true;
   }
@@ -745,10 +747,11 @@ void cmCTestRunTest::WriteLogOutputTop(size_t completed, 
size_t total)
   // then it will never print out the completed / total, same would
   // got for run until pass.  Trick is when this is called we don't
   // yet know if we are passing or failing.
-  if ((this->RerunMode != cmCTest::Rerun::UntilPass &&
-   this->NumberOfRunsLeft == 1) ||
-  (this->RerunMode == cmCTest::Rerun::UntilPass &&
-   this->NumberOfRunsLeft == this->NumberOfRunsTotal) ||
+  bool const progressOnLast =
+(this->RerunMode != cmCTest::Rerun::UntilPass &&
+ this->RerunMode != cmCTest::Rerun::AfterTimeout);
+  if ((progressOnLast && this->NumberOfRunsLeft == 1) ||
+  (!progressOnLast && this->NumberOfRunsLeft == this->NumberOfRunsTotal) ||
   this->CTest->GetTestProgressOutput()) {
 outputStream << std::setw(getNumWidth(total)) << completed << "/";
 outputStream << std::setw(getNumWidth(total)) << total << " ";
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 7276d98fba..20445b0853 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1884,6 +1884,28 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
 }
   }
 
+  if (this->CheckArgument(arg, 

[CMake] Accessing -fPIC and -std settings within CMake definitions

2019-11-01 Thread Stephen Morris
I'm setting up a custom build step to build a precompiled header in gcc (yes I 
know that native support is coming with CMake 3.16, but I need to get something 
working on an older version).

My approach is basically to set up a custom command thus:

set_target_properties(mytarget PRIVATE CXX_STANDARD 17)
set_target_properties(mytarget PRIVATE  POSITION_INDEPENDENT CODE_1)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
...
...
set(CXX_FLAGS ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})   .. or whatever, 
depending on the current configuration..
get_target_property(compile_options, mytarget, COMPILE_OPTIONS)
add_custom_command(OUTPUT myheader.h.gch
   COMMAND ${CMAKE_CXX_COMPILER} 
${CXX_FLAGS} ${compile_options} -fPIC -std=gnu++17 -c myheader.h -o 
myheader.h.gch
   DEPENDS myheader.h)
add_custom_target(BuildMyPCH
 DEPENDS myheader.h.gch)
add_dependencies(mytarget, BuildMyPCH)

You'll note that in my custom command I've had to specify -fPIC and 
-std-gnu++17 explicitly, because they aren't included among either CXX_FLAGS or 
COMPILE_OPTIONS. I've looked for them among the  COMPILE_DEFINITIONS, 
COMPILE_FEATURES and COMPILE_FLAGS properties of my target as well, but there's 
no sign of them. And yet if I look at the verbose output when gcc builds other 
files using the CMake-generated makefile, I see that they are being included 
automatically.

So, my question: where is CMake storing these settings, and how can I apply 
them in my custom command without having to do so manually?

-- 

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] CMake variable to set stack size

2019-11-01 Thread Gautham B A via CMake
Hi,

Is there a CMake variable to set the stack size of a target?
Upon searching the issues, I came across this one - 
https://gitlab.kitware.com/cmake/cmake/issues/17572 . It says that there is a 
CMake variable CMAKE_CXX_STACK_SIZE, but it isn’t clear whether 
CMAKE_CXX_STACK_SIZE can be used.
Further, the CMake documentation doesn’t seem to have anything on 
CMAKE_CXX_STACK_SIZE - 
https://cmake.org/cmake/help/v3.16/search.html?q=CMAKE_CXX_STACK_SIZE_keywords=yes=default

I’ve managed to set the stack size by setting the linker flag based on the 
compiler –
if (MSVC)
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1000")
else ()
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,1000")
endif()

Having a CMake variable to set the stack size would greatly simplify things. 
Could anybody please give more info on this?

Thanks,
--Gautham
-- 

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