[Cmake-commits] CMake branch, master, updated. v3.16.0-rc2-112-g24703b11b4

2019-10-21 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  24703b11b41e2e95d566ee911f0f87bdb47d4883 (commit)
  from  48459ab820a3a72e83336a120327eb9425732865 (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=24703b11b41e2e95d566ee911f0f87bdb47d4883
commit 24703b11b41e2e95d566ee911f0f87bdb47d4883
Author: Kitware Robot 
AuthorDate: Tue Oct 22 00:01:07 2019 -0400
Commit: Kitware Robot 
CommitDate: Tue Oct 22 00:01:07 2019 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 7c3804df20..b966de986d 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 20191021)
+set(CMake_VERSION_PATCH 20191022)
 #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


Re: [CMake] Policy Stack within Macros/Functions

2019-10-21 Thread Kyle Edwards via CMake
On Mon, 2019-10-21 at 21:39 +0200, Sérgio Agostinho wrote:
> For further users with the same problem, you likely do not need need
> to invoke cmake_policy(PUSH)/cmake_policy(POP) from your shipped
> Config file, so just delete them and set whatever policies you need
> without concerns.

This has the caveat that CMP0011 must be set to NEW for it to work
(which should be the case with any sane project - CMP0011 was
introduced in 2.6, the oldest version recognized by
cmake_minimum_required().)

Kyle
-- 

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


Re: [CMake] Policy Stack within Macros/Functions

2019-10-21 Thread Sérgio Agostinho
Thank you for the tip. After rereading the documentation again, I
noticed the following quote in the docs

CMake also manages a new entry for scripts loaded by include()

and find_package()


commands except when invoked with the NO_POLICY_SCOPE option (see
also policy CMP0011
).

Config files are invoked as a result from |find_package()| calls and
indeed, as the documentation states, it automatically creates a new
entry in the stack.

For further users with the same problem, you likely do not need need to
invoke |cmake_policy(PUSH)|/|cmake_policy(POP)| from your shipped Config
file, so just delete them and set whatever policies you need without
concerns.

Sérgio

On 21/10/19 15:45, Kyle Edwards wrote:

> On Sun, 2019-10-20 at 19:25 +0200, Sérgio Agostinho wrote:
>> Hey everyone,
>>
>> I’m shipping a config file for my library and inside I set push/pop
>> specific policies so that me and the consumers of my library can
>> target different policies without us clashing against each other.
>> However I’m struggling with cmake_policy(PUSH)/cmake_policy(POP) once
>> they are invoked from macro/functions.
>>
>> Here’s a minimal failure example illustrating my problem
>>
>>
>> project(pcl-config-test)
>> cmake_minimum_required(VERSION 3.5)
>>
>> cmake_policy(PUSH)
>>
>> macro(return_early)
>>   # clean up code
>>   cmake_policy(POP)
>>   return()
>> endmacro()
>>
>> # 1. do a bunch of things. invoke a couple of macros/functions
>> # from within other macros/functions, etc...
>>
>> # 2. some error occurs
>> if(ERROR)
>>   return_early()
>> endif()
>>
>> # 3. Everything went well
>> cmake_policy(POP)
>> This produces the following output
>>
>>
>> CMake Error at CMakeLists.txt:27 (my_macro):
>>   cmake_policy POP without matching PUSH
>>
>> CMake Error in CMakeLists.txt:
>>   cmake_policy PUSH without matching POP
>>
>> -- Configuring incomplete, errors occurred!
>> I was counting on the policy stack being preserved for at least
>> macros, but that is not the case.
>>
>> Is there a way for me to return early from my config file from within
>> macros?
> If you're trying to set policies within a function, set them at the
> module level rather than at the function level. The module-level policy
> settings will automatically be pushed when you call the function. That
> way, there will be no need to do cmake_policy(POP) within
> return_early().
>
> Kyle

​


signature.asc
Description: OpenPGP digital signature
-- 

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


Re: [CMake] Custom installation of cmake

2019-10-21 Thread Mahmood Naderan via CMake
Thanks. I found it much easier to use the installer package (.sh file).
I wanted a new gcc for building cmake. since the system default is 4.8.5. 
The installer package is available and installed that to my custom folder.

Regards,
Mahmood 

On Sunday, October 20, 2019, 8:58:25 PM GMT+3:30, Raymond Wan 
 wrote:  
 
 Hi Mahmood,

Did you try typing "./bootstrap --help"?

Perhaps something there is what you need?

Ray

  -- 

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


Re: [CMake] How to properly add include directories?

2019-10-21 Thread David Aldrich
>
> >What generator are you using?
>

Ninja


> That thread seems to contain a lot of misunderstandings about the issue.
>
> If you are using the Makefile generator then refer to
> https://stackoverflow.com/questions/7461000/handling-header-files-dependencies-with-cmake.
> After building the project for the first time inspect the depend.make
> files that are generated to verify if the headers are being picked up
> correctly as a dependency.
>

Thanks, I made a mistake and was touching the wrong header file. Sorry
about that. Dependencies are correctly generated and working. There seems
to be no need to add the header files to the list of sources.

BTW It seems that dependencies for header files in the same path as the
sources are generated implicitly. Is that expected?

Thanks for your help.

>
>
-- 

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


Re: [CMake] [EXT] How to properly add include directories?

2019-10-21 Thread Bon, William
Hello,

Have you try to add the header files in the add_library command to explicitely 
add a dependency over it ?

add_library(MyLib SHARED my_source.cpp ../MyHeaders/header.hpp etc.)

On 10/21/19 4:16 PM, David Aldrich wrote:
WARNING: External email, please be mindful before clicking or replying.

Hi again,

My CMakeLists.txt file for my shared library contains:

add_library(MyLib SHARED my_source.cpp etc.)
target_include_directories( MyLib PRIVATE ../MyHeaders)

The library builds ok, but there is no dependency on directory ../MyHeaders - 
touching a header file does not result in a re-compile of dependent source 
files.

There's a discussion here:

https://stackoverflow.com/questions/13703647/how-to-properly-add-include-directories-with-cmake
Opinion seems divided over whether or not it is necessary to add the header 
files to the list of source files for the target, e.g.:

set(SOURCES file.cpp file2.cpp ${YOUR_DIRECTORY}/file1.h 
${YOUR_DIRECTORY}/file2.h)
add_library(test ${SOURCES})

Please will you tell me what is the best practice?


-- 

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-rc2-111-g48459ab820

2019-10-21 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  48459ab820a3a72e83336a120327eb9425732865 (commit)
   via  0bf7a93f91de33bee151fc36c373a9f64f5db6c2 (commit)
   via  fa1fe09dbbf8e18e02a67dc20adb3cb523418ef6 (commit)
   via  667f2861dcfc153caf7ae610a61b6b6bbc3445f0 (commit)
   via  53f95dc5fb161ed92fb9fcb8ecc31502c5e6417e (commit)
   via  8347c75d1e818154f13d7076966aedf3fb9f2c08 (commit)
   via  7b89ae8d7bb28d4e5a4fc64a12035d2db1f3765d (commit)
   via  ede1bebd50af00fd6c657e6c5173cbaa71cb704c (commit)
   via  eaebd4fc47e9f438607b5585b8a67df146dab8f6 (commit)
   via  308990b2bcf1a824cb641a31c7a63f0dbf8f7498 (commit)
   via  08173075c185da050f5aa58e4bd9b5fa6659c63e (commit)
   via  9276beae5e2ce958e4c88995af56fe580d894d8b (commit)
   via  f7acc1266c64be58793cf926b41f0d58b5a55e2a (commit)
   via  8065a686ddcb54b10fd6758eca24280f3e68926b (commit)
   via  409891baf77b909d414add64268d1e5530ff6086 (commit)
  from  61c6d49f5a2f3024aca81bb1535ab804f94adfba (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=48459ab820a3a72e83336a120327eb9425732865
commit 48459ab820a3a72e83336a120327eb9425732865
Merge: 0bf7a93f91 fa1fe09dbb
Author: Brad King 
AuthorDate: Mon Oct 21 11:29:45 2019 -0400
Commit: Brad King 
CommitDate: Mon Oct 21 11:29:45 2019 -0400

Merge branch 'release-3.16'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bf7a93f91de33bee151fc36c373a9f64f5db6c2
commit 0bf7a93f91de33bee151fc36c373a9f64f5db6c2
Merge: 667f2861dc 9276beae5e
Author: Brad King 
AuthorDate: Mon Oct 21 15:29:01 2019 +
Commit: Kitware Robot 
CommitDate: Mon Oct 21 11:29:12 2019 -0400

Merge topic 'ccmake-clear-help'

9276beae5e ccmake: Fully clear the 1st help line when processing

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=667f2861dcfc153caf7ae610a61b6b6bbc3445f0
commit 667f2861dcfc153caf7ae610a61b6b6bbc3445f0
Merge: 53f95dc5fb f7acc1266c
Author: Brad King 
AuthorDate: Mon Oct 21 15:23:53 2019 +
Commit: Kitware Robot 
CommitDate: Mon Oct 21 11:24:28 2019 -0400

Merge topic 'project-include-before'

f7acc1266c project: Add variable CMAKE_PROJECT__INCLUDE_BEFORE

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53f95dc5fb161ed92fb9fcb8ecc31502c5e6417e
commit 53f95dc5fb161ed92fb9fcb8ecc31502c5e6417e
Merge: 8347c75d1e 8065a686dd
Author: Brad King 
AuthorDate: Mon Oct 21 15:23:35 2019 +
Commit: Kitware Robot 
CommitDate: Mon Oct 21 11:23:47 2019 -0400

Merge topic 'export-compile-commands-environment-variable'

8065a686dd Initialize CMAKE_EXPORT_COMPILE_COMMANDS from envvar of the same 
name

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8347c75d1e818154f13d7076966aedf3fb9f2c08
commit 8347c75d1e818154f13d7076966aedf3fb9f2c08
Merge: 7b89ae8d7b eaebd4fc47
Author: Brad King 
AuthorDate: Mon Oct 21 11:21:50 2019 -0400
Commit: Brad King 
CommitDate: Mon Oct 21 11:21:50 2019 -0400

Merge branch 'release-3.16'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b89ae8d7bb28d4e5a4fc64a12035d2db1f3765d
commit 7b89ae8d7bb28d4e5a4fc64a12035d2db1f3765d
Merge: ede1bebd50 08173075c1
Author: Brad King 
AuthorDate: Mon Oct 21 11:21:43 2019 -0400
Commit: Brad King 
CommitDate: Mon Oct 21 11:21:43 2019 -0400

Merge branch 'release-3.15'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ede1bebd50af00fd6c657e6c5173cbaa71cb704c
commit ede1bebd50af00fd6c657e6c5173cbaa71cb704c
Merge: 61c6d49f5a 409891baf7
Author: Brad King 
AuthorDate: Mon Oct 21 15:20:17 2019 +
Commit: Kitware Robot 
CommitDate: Mon Oct 21 11:20:33 2019 -0400

Merge topic 'FindOpenMP-include-dir'

409891baf7 FindOpenMP: Allow try_compile() to find omp.h for AppleClang

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08173075c185da050f5aa58e4bd9b5fa6659c63e
commit 08173075c185da050f5aa58e4bd9b5fa6659c63e
Merge: 83dbef1135 c684db4ea8
Author: Brad King 
AuthorDate: Mon Oct 21 10:26:48 2019 -0400
Commit: Brad King 
CommitDate: Mon Oct 21 10:26:48 2019 -0400

Merge branch 'doc-genex-tweak' into release-3.15

Merge-request: !3939


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f7acc1266c64be58793cf926b41f0d58b5a55e2a
commit f7acc1266c64be58793cf926b41f0d58b5a55e2a
Author: Deniz Bahadir 
AuthorDate: Fri Oct 18 12:51:26 2019 

[Cmake-commits] CMake branch, release, updated. v3.16.0-rc2-6-gfa1fe09dbb

2019-10-21 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, release has been updated
   via  fa1fe09dbbf8e18e02a67dc20adb3cb523418ef6 (commit)
   via  eaebd4fc47e9f438607b5585b8a67df146dab8f6 (commit)
   via  308990b2bcf1a824cb641a31c7a63f0dbf8f7498 (commit)
   via  c684db4ea8d4763a7a70582d24c4bf5ac14cfea4 (commit)
   via  9276beae5e2ce958e4c88995af56fe580d894d8b (commit)
   via  409891baf77b909d414add64268d1e5530ff6086 (commit)
  from  92780281c2e8a46223b262b152caa9c8329373b1 (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 -
---

Summary of changes:
 Help/manual/cmake-generator-expressions.7.rst |  2 +-
 Modules/FindOpenMP.cmake  | 43 ++-
 Source/CursesDialog/cmCursesMainForm.cxx  |  2 +-
 Tests/FindOpenMP/Test/CMakeLists.txt  |  1 +
 4 files changed, 45 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


[Cmake-commits] CMake branch, master, updated. v3.16.0-rc2-96-g61c6d49f5a

2019-10-21 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  61c6d49f5a2f3024aca81bb1535ab804f94adfba (commit)
   via  50afd147f851aec03e203f2e8c413ab8a9e744c5 (commit)
   via  c684db4ea8d4763a7a70582d24c4bf5ac14cfea4 (commit)
   via  55a0bebdd3d253f81bd89782702d481ac81110b3 (commit)
   via  bcaecf6bcddfaec2b586bff870650a4a66b0ccc3 (commit)
   via  324988a6b101f29d148badc32b44964aedae1163 (commit)
   via  fd2c9fac101ec6d341db5b30e9d1eba64fa23116 (commit)
  from  a82a96f35b3970501cd552c36819f9313734f669 (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=61c6d49f5a2f3024aca81bb1535ab804f94adfba
commit 61c6d49f5a2f3024aca81bb1535ab804f94adfba
Merge: 50afd147f8 c684db4ea8
Author: Brad King 
AuthorDate: Mon Oct 21 15:19:37 2019 +
Commit: Kitware Robot 
CommitDate: Mon Oct 21 11:19:45 2019 -0400

Merge topic 'doc-genex-tweak'

c684db4ea8 Help: Fix COMPILE_LANG_AND_ID genex example

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=50afd147f851aec03e203f2e8c413ab8a9e744c5
commit 50afd147f851aec03e203f2e8c413ab8a9e744c5
Merge: a82a96f35b 55a0bebdd3
Author: Brad King 
AuthorDate: Mon Oct 21 15:11:58 2019 +
Commit: Kitware Robot 
CommitDate: Mon Oct 21 11:12:06 2019 -0400

Merge topic 'vs-per-config-sources'

55a0bebdd3 VS: Add support for per-config sources
bcaecf6bcd Teach check for single-language targets to consider all 
configurations
324988a6b1 cmGeneratorTarget: Add GetAllConfigCompileLanguages method
fd2c9fac10 cmGeneratorTarget: Return non-const sources from 
GetAllConfigSources

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c684db4ea8d4763a7a70582d24c4bf5ac14cfea4
commit c684db4ea8d4763a7a70582d24c4bf5ac14cfea4
Author: Alan W. Irwin 
AuthorDate: Mon Oct 21 10:21:16 2019 -0400
Commit: Brad King 
CommitDate: Mon Oct 21 10:25:41 2019 -0400

Help: Fix COMPILE_LANG_AND_ID genex example

Fix the `COMPILE_LANGUAGE/CXX_COMPILER_ID` variant of the example to
have the same meaning as the `COMPILE_LANG_AND_ID` variant.  The
inconsistency was introduced by commit 808b818063 (Genex: CompileLang
and CompileLangAndId now match against a list of ids, 2019-05-30,
v3.15.0-rc1~11^2~1).

Fixes: #19862

diff --git a/Help/manual/cmake-generator-expressions.7.rst 
b/Help/manual/cmake-generator-expressions.7.rst
index c0449fb4ae..e970379fad 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -195,7 +195,7 @@ Variable Queries
   .. code-block:: cmake
 
 target_compile_definitions(myapp
-  PRIVATE 
$<$,$>:COMPILING_CXX_WITH_CLANG>
+  PRIVATE 
$<$,$>:COMPILING_CXX_WITH_CLANG>
   
$<$,$>:COMPILING_CXX_WITH_INTEL>
   
$<$,$>:COMPILING_C_WITH_CLANG>
 )

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55a0bebdd3d253f81bd89782702d481ac81110b3
commit 55a0bebdd3d253f81bd89782702d481ac81110b3
Author: Brad King 
AuthorDate: Wed Oct 2 13:59:15 2019 -0400
Commit: Brad King 
CommitDate: Thu Oct 17 14:05:39 2019 -0400

VS: Add support for per-config sources

Since commit 97cc29c766 (VS: Teach generators how to mark per-config
source files, 2017-04-10, v3.9.0-rc1~268^2~2) the VS generators have
known how to generate per-config sources.  We've now converted most
other code paths to support per-config sources, so drop the check
that disallows it.

This leaves only per-config support for precompiled headers and unity
build transformations, but those are optional features that can be
addressed later.

Fixes: #18233
Issue: #19789

diff --git a/Help/release/dev/vs-per-config-sources.rst 
b/Help/release/dev/vs-per-config-sources.rst
new file mode 100644
index 00..bf7572b6ed
--- /dev/null
+++ b/Help/release/dev/vs-per-config-sources.rst
@@ -0,0 +1,5 @@
+vs-per-config-sources
+-
+
+* :ref:`Visual Studio Generators` learned to support per-config sources.
+  Previously only :ref:`Command-Line Build Tool Generators` supported them.
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx 
b/Source/cmGlobalVisualStudioGenerator.cxx
index 6569e5ef61..54124070d7 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -799,15 +799,6 @@ void RegisterVisualStudioMacros(const std::string& 
macrosFile,
 bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
   cmGeneratorTarget const* 

Re: [CMake] How to properly add include directories?

2019-10-21 Thread Fred Baksik


On Mon, Oct 21, 2019, at 10:16 AM, David Aldrich wrote:
> Hi again,
> 
> My CMakeLists.txt file for my shared library contains:
> 
> add_library(MyLib SHARED my_source.cpp etc.)
> target_include_directories( MyLib PRIVATE ../MyHeaders)
> 
> The library builds ok, but there is no dependency on directory ../MyHeaders - 
> touching a header file does not result in a re-compile of dependent source 
> files.
> 
> There's a discussion here:
> 
> https://stackoverflow.com/questions/13703647/how-to-properly-add-include-directories-with-cmake
>  
> Opinion seems divided over whether or not it is necessary to add the header 
> files to the list of source files for the target, e.g.:
> 
> set(SOURCES file.cpp file2.cpp ${YOUR_DIRECTORY}/file1.h 
> ${YOUR_DIRECTORY}/file2.h)
> add_library(test ${SOURCES})
> 
> Please will you tell me what is the best practice?
> -- 
> 

What generator are you using?
That thread seems to contain a lot of misunderstandings about the issue.

If you are using the Makefile generator then refer to 
https://stackoverflow.com/questions/7461000/handling-header-files-dependencies-with-cmake.
 After building the project for the first time inspect the `depend.make files 
that are generated to verify if the headers are being picked up correctly as a 
dependency.`

`--`
`F`-- 

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] How to properly add include directories?

2019-10-21 Thread David Aldrich
Hi again,

My CMakeLists.txt file for my shared library contains:

add_library(MyLib SHARED my_source.cpp etc.)
target_include_directories( MyLib PRIVATE ../MyHeaders)

The library builds ok, but there is no dependency on directory ../MyHeaders
- touching a header file does not result in a re-compile of dependent
source files.

There's a discussion here:

https://stackoverflow.com/questions/13703647/how-to-properly-add-include-directories-with-cmake

Opinion seems divided over whether or not it is necessary to add the header
files to the list of source files for the target, e.g.:

set(SOURCES file.cpp file2.cpp ${YOUR_DIRECTORY}/file1.h
${YOUR_DIRECTORY}/file2.h)
add_library(test ${SOURCES})

Please will you tell me what is the best practice?
-- 

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


Re: [CMake] Concerning ninja -v

2019-10-21 Thread David Aldrich
>
> >Does just invoking ninja with -v not show verbosity? That should do it.
> > don't believe CMAKE_VERBOSE_MAKEFILE affects Ninja builds.
>
> >Kyle
>

Yes thanks, that does do it. I just wondered whether there was a neater way
for when CMake is invoked by an IDE such as VS Code with the cmake-tools
extension. But it seems that I can specify option '-v' to that tool too.
-- 

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


Re: [CMake] Concerning ninja -v

2019-10-21 Thread Kyle Edwards via CMake
On Mon, 2019-10-21 at 10:23 +0100, David Aldrich wrote:
> I have a simple CMake project with subdirectories:
> 
> cmake_minimum_required(VERSION 3.10)
> project(MyProject VERSION 1.0.0)
> 
> set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")
> 
> add_subdirectory(say-hello)
> add_subdirectory(hello-exe)
> 
> Will the 'CMAKE_VERBOSE_MAKEFILE' option be inherited by the
> CMakeLists.txt files in the subdirectories?
> 
> I want to run ninja with the '-v' option for verbosity but the above
> 'set' command is not achieving this. What do I need to do
> differently?

Does just invoking ninja with -v not show verbosity? That should do it.
I don't believe CMAKE_VERBOSE_MAKEFILE affects Ninja builds.

Kyle
-- 

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


Re: [CMake] Policy Stack within Macros/Functions

2019-10-21 Thread Kyle Edwards via CMake
On Sun, 2019-10-20 at 19:25 +0200, Sérgio Agostinho wrote:
> Hey everyone,
> 
> I’m shipping a config file for my library and inside I set push/pop
> specific policies so that me and the consumers of my library can
> target different policies without us clashing against each other.
> However I’m struggling with cmake_policy(PUSH)/cmake_policy(POP) once
> they are invoked from macro/functions.
> 
> Here’s a minimal failure example illustrating my problem
> 
> 
> project(pcl-config-test)
> cmake_minimum_required(VERSION 3.5)
> 
> cmake_policy(PUSH)
> 
> macro(return_early)
>   # clean up code
>   cmake_policy(POP)
>   return()
> endmacro()
> 
> # 1. do a bunch of things. invoke a couple of macros/functions
> # from within other macros/functions, etc...
> 
> # 2. some error occurs
> if(ERROR)
>   return_early()
> endif()
> 
> # 3. Everything went well
> cmake_policy(POP)
> This produces the following output
> 
> 
> CMake Error at CMakeLists.txt:27 (my_macro):
>   cmake_policy POP without matching PUSH
> 
> CMake Error in CMakeLists.txt:
>   cmake_policy PUSH without matching POP
> 
> -- Configuring incomplete, errors occurred!
> I was counting on the policy stack being preserved for at least
> macros, but that is not the case.
> 
> Is there a way for me to return early from my config file from within
> macros?

If you're trying to set policies within a function, set them at the
module level rather than at the function level. The module-level policy
settings will automatically be pushed when you call the function. That
way, there will be no need to do cmake_policy(POP) within
return_early().

Kyle
-- 

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


Re: [cmake-developers] CTest load balancing

2019-10-21 Thread Wouter Klouwen
On 16/10/2019 15:10, Brad King wrote:
> On 10/16/19 10:05 AM, Wouter Klouwen wrote:
>> Is the intent for CTest to specifically manage CPU load or system load
>> overall?
>
> I don't think a careful distinction was made at the time.
>
> If Linux needs some updates to be consistent with other platforms
> then that would be fine with me.

Unfortunately this may be easier said than done.

Most of the data relevant to this lives in /proc. Indeed the
getloadavg() implementation of glibc merely reads /proc/loadavg*.

For load average the scheduler keeps track of the running 1, 5, 15
minute running averages.

There's /proc/stat which keeps a running total of the CPU usage - the
first lines beginning with `cpu` - but for the purposes of this it is in
the format of usage since boot. In order to replicate a CPU utilisation
only load, you'd effectively have to pick a point in time to start and
then measure since the reference point, which makes things a bit
complicated.

>From the same file you could also take the lines `procs_running` and
`procs_blocked`, sum them and present them as a pseudo load. It would be
a fairly robust calculation. I don't know if this would be quite correct
though.

I might just create an issue for this.

   W


*:
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/getloadavg.c;hb=HEAD
th

>
> -Brad
>
>
> [External email. Treat hyperlinks and attachments with caution]
>
This transmission contains information that may be confidential and contain 
personal views which are not necessarily those of YouView TV Ltd. YouView TV 
Ltd (Co No:7308805) is a limited liability company registered in England and 
Wales with its registered address at YouView TV Ltd, 3rd Floor, 10 Lower Thames 
Street, London, EC3R 6YT. For details see our web site at http://www.youview.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:
https://cmake.org/mailman/listinfo/cmake-developers


[CMake] Concerning ninja -v

2019-10-21 Thread David Aldrich
I have a simple CMake project with subdirectories:

cmake_minimum_required(VERSION 3.10)
project(MyProject VERSION 1.0.0)

set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "ON")

add_subdirectory(say-hello)
add_subdirectory(hello-exe)

Will the 'CMAKE_VERBOSE_MAKEFILE' option be inherited by the CMakeLists.txt
files in the subdirectories?

I want to run ninja with the '-v' option for verbosity but the above 'set'
command is not achieving this. What do I need to do differently?

(I am running CMake 3.15.4 on WSL - Ubuntu 18.04).
-- 

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