[Cmake-commits] CMake branch, master, updated. v3.12.1-446-ge33c6c3

2018-08-23 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  e33c6c357b61ed0cc5b9f7c01e4ea04deca26b39 (commit)
  from  b2798594a5010849c84facb929516f5a78fc5ea4 (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=e33c6c357b61ed0cc5b9f7c01e4ea04deca26b39
commit e33c6c357b61ed0cc5b9f7c01e4ea04deca26b39
Author: Kitware Robot 
AuthorDate: Fri Aug 24 00:01:22 2018 -0400
Commit: Kitware Robot 
CommitDate: Fri Aug 24 00:01:22 2018 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 520b6a2..c94a2f6 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 12)
-set(CMake_VERSION_PATCH 20180823)
+set(CMake_VERSION_PATCH 20180824)
 #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
https://cmake.org/mailman/listinfo/cmake-commits


Re: [cmake-developers] Experiments in CMake support for Clang (header & standard) modules

2018-08-23 Thread David Blaikie
On Tue, Jul 24, 2018 at 3:20 PM Stephen Kelly  wrote:

> David Blaikie wrote:
>
> > (just CC'ing you Richard in case you want to read my ramblings/spot any
> > inaccuracies, etc)
> >
> > Excuse the delay - coming back to this a bit now. Though the varying
> > opinions on what modules will take to integrate with build system still
> > weighs on me a bit
>
> Can you explain what you mean by 'weighs on you'? Does that mean you see
> it
> as tricky now?


Yes, to some extent. If the build system is going to require the
compiler-callsback-to-buildsystem that it sounds like (from discussions
with Richard & Nathan, etc) is reasonable - yeah, I'd say that's a bigger
change to the way C++ is compiled than I was expecting/thinking of going
into this.

Some folks see this as not "tricky" but just "hey, C++ has been getting
away with a vastly simplified build model until now - now that it's getting
modular separation like other languages, it's going to have to have a build
system like other languages" (ala Java/C#, Haskell/Go maybe, etc) - but I'm
not especially familiar with any other languages enterprise-level build
systems (done a bit of C# at Microsoft but wasn't looking closely at the
build system - insulated from it by either Visual Studio or the OS release
processes, etc - and the last time I did Java I was working on small enough
things & without many cores, so throwing all the .java files in a package
at the compiler in one go was totally reasonable)


> I've kind of been assuming that people generally think it is not tricky,
> and
> I'm just wrong in thinking it is and I'll eventually see how it is all
> manageable.
>

I think it's manageable - the thing that weighs on me, I suppose, is
whether or not the community at large will "buy" it, as such. And part of
that is on the work we're doing to figure out the integration with build
systems, etc, so that there's at least the first few pieces of support that
might help gain user adoption to justify/encourage/provide work on further
support, etc...

> To that end, Stephen, I've made a fork of your example repository & a very
> > simple/direct change to use C++ modules as currently implemented in
> Clang.
>
> Interesting, thanks for doing that! Here's the link for anyone else
> interested:
>
>  https://github.com/dwblaikie/ModulesExperiments


Oh, thanks - totally didn't realize I failed to link that!


> > The build.sh script shows the commands required to build it (though I
> > haven't checked the exact fmodule-file dependencies to check that they're
> > all necessary, etc) - and with current Clang top-of-tree it does build
> and
> > run the example dinnerparty program.
>
> Ok. I tried with my several-weeks-old checkout and it failed on the first
> command with -modules-ts in it (for AbstractFruit.cppm - the simplest one).
>
> I'll update my build and try again, but that will take some time.
>

Huh - I mean it's certainly a moving target - I had to file/workaround a
few bugs to get it working as much as it is, so not /too/ surprising. Did
you get it working in the end? If not, could you specify the exact revision
your compiler's at and show the complete output?


> > If you happen to try experimenting with any ways the commands in the
> > build.sh file could be run from CMake it a sensible way - even if you
> > hypothesize what -MM support (or other compiler hooks like the dependency
> > server I alluded to above, etc) for modules might look like to do so, I'd
> > love to chat about it/throw ideas around/try mocking up/prototyping the
> > sort of compiler support (I don't think there's -MM support yet, but I
> > could see about adding it, for example) that seems like it might be most
> > useful.
>
> Yes, that would be useful I think.
>
> > One thing I'm vaguely concerned about is actually the dependency of
> > building modules within a single library (as in this project/example - at
> > least the way I've built it for now - I didn't try building it as
> separate
> > .so/.a files). At least across-library we can work at the library
> > granularity and provide on the command line (or via a file as GCC does)
> > the module files for all the modules from dependent libraries. But I'm
> not
> > sure how best to determine the order in which to build files within a
> > library
>
> Exactly, that's one of the reasons my repo has libraries of multiple files
> with dependencies between them, but building everything into one
> executable
> also exposes that issue.
>

Ah, when I say "library" I mean static (.lib/.a) or dynamic (.so/.dll/etc)
- same situation in either. But yeah - any situation where there are
multiple modules within a single library, getting those dependencies will
involve some discovery (either a pre-parsing check (same way a build system
might check which headers are included in a file) or the compiler callback
system, where the compiler asks the build system for the modules it needs)
- and even in the one-module-per-library


> I guess it would work in a 

Re: [CMake] protobuf and imports relative to root (and --proto_path)

2018-08-23 Thread Alexander Neundorf
On 2018 M08 23, Thu 12:50:14 CEST David Jobet wrote:
> Hello,
> 
> I'm trying to port an existing project from premake to cmake.
> I'm trying to avoid modifying the source files while doing so.
> 
> Right now, we have several libraries (read in different directories) using
> proto files with imports between them.
> All imports are made relative to the root of the project.
> 
> e.g :
> work/lib1/sublib1/a.proto
> work/lib1/sublib1/b.proto
> 
> with a.proto having a link to b.proto like this "import
> lib1/sublib1/b.proto"
> 
> If I compile this with an unchanged FindProtobuf.cmake, I do this :
> 
> protobuf_generate_cpp(PROTO_SRCS PROTO_HRDS a.proto b.proto)
> add_library(...)
> 
> the problem being that it looks like the "namespaces" generated by protoc
> in b.proto do not match the one used in a.proto : it does not compile.

do you mean protoc fails, or that the C++ compiler fails when compiling the 
generated file ?
I'm also using proto files with imports between them and don't have problems 
with finding them.
Are you setting the PROTOBUF_IMPORT_DIRS variable ?

What I do have a problem is rerunning protoc automatically on proto-files which 
import proto files that have been modified.
How do you handle this ?

> Is there a way to make this work ?
> 
> Otherwise, I made the patch below which solves my problem. Do you think it
> could be included in cmake ?
> it defines a new option PROTO_PATH, so the decl above becomes
> protobuf_generate_cpp(PROTO_SRCS PROTO_HRDS PROTO_PATH ${CMAKE_SOURCE_DIR}
> a.proto b.proto)
> 
> With regards
> 
> David
> 
> $ diff share/cmake-3.10/Modules/FindProtobuf.cmake.orig
> share/cmake-3.10/Modules/FindProtobuf.cmake

can you please use diff -bup ?
This makes the patch easier to read.

Thanks
Alex

-- 

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] Problem with creating shared library

2018-08-23 Thread Sebastián Mancilla
I forgot to update the include path in the patch I sent you.

It should be like this (note that it contains just "include", not
"include/kImageAnnotator"):

target_include_directories(kImageAnnotator
PUBLIC
$
$
$
)

And kImageAnnotator.h should change the export include to:

#include "kImageAnnotatorExport.h"


You still have a bigger problem, though. kImageAnnotator.h is including
private headers

#include "../../src/gui/VisibilitySwitcher.h"
#include "../../src/annotations/core/AnnotationArea.h"
#include "../../src/backend/Config.h"
#include "../../src/widgets/ToolPicker.h"
#include "../../src/widgets/ColorPicker.h"
#include "../../src/widgets/SizePicker.h"
#include "../../src/widgets/FillPicker.h"

If those are required by your clients, then they should be in the
"include/kImageAnnotator" directory and installed along with
"kImageAnnotator.h".
Otherwise, consider using the pimpl idiom and remove the includes from the
public header.


El mié., 22 de ago. de 2018 a la(s) 17:08, Damir Porobic (
damir_poro...@live.com) escribió:

> Thanks you Sebastián for finding the issue and fixing the CMake, probably
> would have never found out that it was set to private.
>
>
> The kImageAnnotator-example is working now as expected. Do I need
> something else, except installing the lib, in order to use it in different
> projects? I've created a second project which is identical to the
> kImageAnnotator-example but I get following when I try to build it:
>
>
> [ 50%] Building CXX object CMakeFiles/testApp.dir/main.cpp.o
> In file included from /home/dporobic/projects/testApp/main.cpp:2:0:
> /usr/local/include/kImageAnnotator/KImageAnnotator.h:31:35: fatal error:
> KImageAnnotatorExport.h: No such file or directory
>  #include 
>^
> compilation terminated.
>
> The includes look like this:
>
> #include 
> #include 
>
>
> And the CMake looks like this:
>
> find_package(kImageAnnotator REQUIRED)
>
> add_executable(testApp main.cpp)
> target_link_libraries(testApp kImageAnnotator)
>
>
> Am I missing something again?
>
>
>
> --
> *From:* Sebastián Mancilla 
> *Sent:* Wednesday, August 22, 2018 00:51
> *To:* Eric Noulard
> *Cc:* Damir Porobic; cmake@cmake.org
> *Subject:* Re: [CMake] Problem with creating shared library
>
> I fixed your problem. Get the attached patch and apply it with "git apply
> ".
>
> The kImageAnnotator constructor was private to the library (I just learned
> that Qt does that when creating shared libraries), and that's why you get
> the undefined reference error. You could have checked it with:
>
> nm lib/libkImageAnnotator.so | c++filt | grep ::KImage
> 000141f6 t KImageAnnotator::KImageAnnotator(QPixmap const&)
> 000141f6 t KImageAnnotator::KImageAnnotator(QPixmap const&)
>
> The "t" shows it is private.
>
> You have to set the proper export macros to make it visible:
>
>
> https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application
> 
> http://doc.qt.io/qt-5/sharedlibra
> How to create a library with Qt and use it in an application
> 
> wiki.qt.io
> This tutorial illustrates different approaches for using a custom library
> in your application on Windows. The first part explains how to create a
> shared library and how to link against it in your application. The second
> part is about creating and using a static library. Creating a shared
> library ...
> ry.html
> 
>
> The patch does that, and now the example links with the library just fine.
> The kImageAnnotatorExport.h header defines the macro, the compile
> definition is set for the shared library target in the CMakeLists.txt. I
> guess you'll  have to do the same for all classes used by the unit tests,
> no sure of the Qt development practices.
>
> I also reworked your CMake files a bit. I am sending a single patch,
> though. Sorry.
>
>
> El mar., 21 de ago. de 2018 a la(s) 14:29, Eric Noulard (
> eric.noul...@gmail.com) escribió:
>
>
>
> Le lun. 20 août 2018 à 19:05, Damir Porobic  a

Re: [CMake] Copy file from Source to Build dir based on CMAKE_CFG_INTDIR

2018-08-23 Thread Michael Jackson
Hmm, That works great for MSVC compiles but not so great when I use ninja or 
makefiles (any of the single config generators). I was looking through the 
generator expressions on the Cmake doc site but didn't really come across 
anything that seems like it would get me what is needed. I guess I just put in:

If(MSVC or Xcode)
  Do this
Else()
  Do that
Endif().

Seems like this should just not be needed...

--
Mike Jackson 

On 8/23/18, 1:59 PM, "Robert Maynard"  wrote:

You can use `file(GENERATE` and the `$` generator expression.

Here is an example:

https://gitlab.kitware.com/cmake/cmake/blob/v3.12.1/Tests/CudaOnly/ExportPTX/CMakeLists.txt#L13
On Thu, Aug 23, 2018 at 1:47 PM Michael Jackson
 wrote:
>
> I would like to copy some files from my source dir into my binary 
RUNTIME_DIR based on the current configuration being compiled. For generators 
like “makefiles” and “ninja” this is easy and straight forward. I am having an 
issue getting my head wrapped around how to use CMAKE_CFG_INTDIR properly.
>
>
>
> I know I can’t do this a cmake time so I tried the following:
>
>
>
> During CMake time write out another CMake file:
>
>
>
>   file(APPEND "${PYSIMPL_SCRIPT_COPY_RULE}"
>
> "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
>
>   \"${SIMPLPyBind11_SOURCE_DIR}/../Testing/${script}\"
>
>   
\"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/\${CMAKE_CFG_INTDIR}/python/site-packages/${script}\")\n"
>
>   )
>
>
>
> Which creates entries like this in the written .cmake file:
>
>
>
> execute_process(COMMAND 
C:/DREAM3D_SDK/cmake-3.12.0-rc2-win64-x64/bin/cmake.exe -E copy_if_different
>
>   
"C:/Users/mjackson/DREAM3D-Dev/DREAM3D/ExternalProjects/SIMPL/Wrapping/Python/Pybind11/../Testing/AbstractFilterTest.py"
>
>   
"C:/Users/mjackson/DREAM3D-Dev/DREAM3D-Builds/x64/Bin/${CMAKE_CFG_INTDIR}/python/site-packages/AbstractFilterTest.py")
>
>
>
> Which does not work. The files end up in 
${BUILD_DIR}/Bin/python/site-packages/. I need them to end up in 
${BUILD_DIR}/Bin/Release/python/site-packages for a Release build. Same for 
Debug…
>
>
>
> Could someone tell me what I am doing wrong or the proper way to go about 
this? I am about ready to write a simple C++ program to do the copy for me 
(which seems ludicrous to have to do..)
>
> --
>
> Michael Jackson | Owner, President
>
>   BlueQuartz Software
>
> [e] mike.jack...@bluequartz.net
>
> [w] www.bluequartz.net
>
> --
>
> 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



-- 

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] Adding an individual define to each source file of a library

2018-08-23 Thread Eric Noulard
Le jeu. 23 août 2018 à 19:18, George PF  a écrit :

> > > However, whatever I write into 'set_property()' - no APPEND, single
> entry,
> > > not quoted - does not end up
> > > on the compiler command line. Is there a type mismatch which is
> silently
> > > ignored?
> > >
> >
> > Or you are doing this in a directory which is not the one where the
> target
> > is defined and from the doc:
> > $ cmake --help-command set_property
> >
> > ...
> > ``SOURCE``
> >   Scope may name zero or more source files.  Note that source
> >   file properties are visible only to targets added in the same
> >   directory (CMakeLists.txt).
> >
> > ...
>
> This is all in the same directory, full setup and test:
>
> % cmake --version
> cmake version 3.12.0   [..]
> % mkdir mylib && cd mylib
> mylib% touch file1.c file2.c
> mylib% cat > CMakeLists.txt
>
> cmake_minimum_required(VERSION 3.12)
>
> add_library(mylib SHARED file1.c file2.c)
>
> get_property(mysrcs TARGET mylib PROPERTY SOURCES)
> foreach(x IN LISTS mysrcs)
> message("at ${x}")
> set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS
> "TEST1;TEST2;")
>

almost there but you forgot to take value of 'x'

set_property(SOURCE ${x} APPEND PROPERTY COMPILE_DEFINITIONS "TEST1;TEST2;")

works for me.





> endforeach(x)
> # ^D
>
> mylib% mkdir build && cd build && cmake ..
> [..]
> at file1.c
> at file2.c
> -- Configuring done
> [..]
> mylibs/build% grep -r TEST1 . || echo no TEST1
> no TEST1
>
> and 'make VERBOSE=1' also shows no extra -DTEST1 compiler arguments.
> --
>
> 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
>


-- 
Eric
-- 

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.12.1-445-gb279859

2018-08-23 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  b2798594a5010849c84facb929516f5a78fc5ea4 (commit)
   via  3aa11f31fcb9780d6e54647a97ca876a2a409251 (commit)
   via  1d87c9f318b45ba9984378580d5b4926acfd4c11 (commit)
  from  91c9a5227384b374c80f1e6453bb830e3de68a4a (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=b2798594a5010849c84facb929516f5a78fc5ea4
commit b2798594a5010849c84facb929516f5a78fc5ea4
Merge: 91c9a52 3aa11f3
Author: Brad King 
AuthorDate: Thu Aug 23 18:28:43 2018 +
Commit: Kitware Robot 
CommitDate: Thu Aug 23 14:28:49 2018 -0400

Merge topic 'autogen_variables_in_structs'

3aa11f31fc Autogen: Use integers to store the Qt version
1d87c9f318 Autogen: Initializer: Group variables in structs

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3aa11f31fcb9780d6e54647a97ca876a2a409251
commit 3aa11f31fcb9780d6e54647a97ca876a2a409251
Author: Sebastian Holtermann 
AuthorDate: Mon Aug 13 12:06:19 2018 +0200
Commit: Sebastian Holtermann 
CommitDate: Mon Aug 13 18:12:47 2018 +0200

Autogen: Use integers to store the Qt version

diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 324b56a..4060269 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -34,6 +34,7 @@
 #include "cmMakefile.h"
 #include "cmOutputConverter.h"
 #include "cmPolicies.h"
+#include "cmQtAutoGen.h"
 #include "cmQtAutoGenInitializer.h"
 #include "cmSourceFile.h"
 #include "cmState.h"
@@ -1495,15 +1496,14 @@ bool cmGlobalGenerator::QtAutoGen()
 continue;
   }
 
-  std::string qtVersionMajor =
-cmQtAutoGenInitializer::GetQtMajorVersion(target);
+  auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
   // don't do anything if there is no Qt4 or Qt5Core (which contains moc)
-  if (qtVersionMajor != "4" && qtVersionMajor != "5") {
+  if (qtVersion.Major != 4 && qtVersion.Major != 5) {
 continue;
   }
 
   autogenInits.emplace_back(cm::make_unique(
-target, mocEnabled, uicEnabled, rccEnabled, qtVersionMajor));
+target, mocEnabled, uicEnabled, rccEnabled, qtVersion));
 }
   }
 
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
index a3e16ac..4118dc7 100644
--- a/Source/cmQtAutoGen.h
+++ b/Source/cmQtAutoGen.h
@@ -28,6 +28,32 @@ public:
 RCC
   };
 
+  /// @brief Integer version
+  struct IntegerVersion
+  {
+unsigned int Major = 0;
+unsigned int Minor = 0;
+
+IntegerVersion() = default;
+IntegerVersion(unsigned int major, unsigned int minor)
+  : Major(major)
+  , Minor(minor)
+{
+}
+
+bool operator>(IntegerVersion const version)
+{
+  return (this->Major > version.Major) ||
+((this->Major == version.Major) && (this->Minor > version.Minor));
+}
+
+bool operator>=(IntegerVersion const version)
+{
+  return (this->Major > version.Major) ||
+((this->Major == version.Major) && (this->Minor >= version.Minor));
+}
+  };
+
 public:
   /// @brief Returns the generator name
   static std::string const& GeneratorName(GeneratorT genType);
diff --git a/Source/cmQtAutoGenInitializer.cxx 
b/Source/cmQtAutoGenInitializer.cxx
index 674657c..db7fde6 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -173,18 +173,17 @@ static bool StaticLibraryCycle(cmGeneratorTarget const* 
targetOrigin,
   return cycle;
 }
 
-cmQtAutoGenInitializer::cmQtAutoGenInitializer(
-  cmGeneratorTarget* target, bool mocEnabled, bool uicEnabled, bool rccEnabled,
-  std::string const& qtVersionMajor)
+cmQtAutoGenInitializer::cmQtAutoGenInitializer(cmGeneratorTarget* target,
+   bool mocEnabled,
+   bool uicEnabled,
+   bool rccEnabled,
+   IntegerVersion const& qtVersion)
   : Target(target)
-  , QtVersionMajor(qtVersionMajor)
+  , QtVersion(qtVersion)
 {
   Moc.Enabled = mocEnabled;
   Uic.Enabled = uicEnabled;
   Rcc.Enabled = rccEnabled;
-
-  this->QtVersionMinor =
-cmQtAutoGenInitializer::GetQtMinorVersion(target, this->QtVersionMajor);
 }
 
 bool cmQtAutoGenInitializer::InitCustomTargets()
@@ -381,14 +380,14 @@ bool cmQtAutoGenInitializer::InitMoc()
 
   // Moc predefs command
   if (this->Target->GetPropertyAsBool("AUTOMOC_COMPILER_PREDEFINES") &&
-  this->QtVersionGreaterOrEqual(5, 8)) {
+  (this->QtVersion >= 

Re: [CMake] Copy file from Source to Build dir based on CMAKE_CFG_INTDIR

2018-08-23 Thread Robert Maynard
You can use `file(GENERATE` and the `$` generator expression.

Here is an example:
https://gitlab.kitware.com/cmake/cmake/blob/v3.12.1/Tests/CudaOnly/ExportPTX/CMakeLists.txt#L13
On Thu, Aug 23, 2018 at 1:47 PM Michael Jackson
 wrote:
>
> I would like to copy some files from my source dir into my binary RUNTIME_DIR 
> based on the current configuration being compiled. For generators like 
> “makefiles” and “ninja” this is easy and straight forward. I am having an 
> issue getting my head wrapped around how to use CMAKE_CFG_INTDIR properly.
>
>
>
> I know I can’t do this a cmake time so I tried the following:
>
>
>
> During CMake time write out another CMake file:
>
>
>
>   file(APPEND "${PYSIMPL_SCRIPT_COPY_RULE}"
>
> "execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
>
>   \"${SIMPLPyBind11_SOURCE_DIR}/../Testing/${script}\"
>
>   
> \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/\${CMAKE_CFG_INTDIR}/python/site-packages/${script}\")\n"
>
>   )
>
>
>
> Which creates entries like this in the written .cmake file:
>
>
>
> execute_process(COMMAND 
> C:/DREAM3D_SDK/cmake-3.12.0-rc2-win64-x64/bin/cmake.exe -E copy_if_different
>
>   
> "C:/Users/mjackson/DREAM3D-Dev/DREAM3D/ExternalProjects/SIMPL/Wrapping/Python/Pybind11/../Testing/AbstractFilterTest.py"
>
>   
> "C:/Users/mjackson/DREAM3D-Dev/DREAM3D-Builds/x64/Bin/${CMAKE_CFG_INTDIR}/python/site-packages/AbstractFilterTest.py")
>
>
>
> Which does not work. The files end up in 
> ${BUILD_DIR}/Bin/python/site-packages/. I need them to end up in 
> ${BUILD_DIR}/Bin/Release/python/site-packages for a Release build. Same for 
> Debug…
>
>
>
> Could someone tell me what I am doing wrong or the proper way to go about 
> this? I am about ready to write a simple C++ program to do the copy for me 
> (which seems ludicrous to have to do..)
>
> --
>
> Michael Jackson | Owner, President
>
>   BlueQuartz Software
>
> [e] mike.jack...@bluequartz.net
>
> [w] www.bluequartz.net
>
> --
>
> 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
-- 

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] Copy file from Source to Build dir based on CMAKE_CFG_INTDIR

2018-08-23 Thread Michael Jackson
I would like to copy some files from my source dir into my binary RUNTIME_DIR 
based on the current configuration being compiled. For generators like 
“makefiles” and “ninja” this is easy and straight forward. I am having an issue 
getting my head wrapped around how to use CMAKE_CFG_INTDIR properly.

 

I know I can’t do this a cmake time so I tried the following:

 

During CMake time write out another CMake file:

 

  file(APPEND "${PYSIMPL_SCRIPT_COPY_RULE}" 

"execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different

  \"${SIMPLPyBind11_SOURCE_DIR}/../Testing/${script}\" 

  
\"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/\${CMAKE_CFG_INTDIR}/python/site-packages/${script}\")\n"

  )

 

Which creates entries like this in the written .cmake file:

 

execute_process(COMMAND C:/DREAM3D_SDK/cmake-3.12.0-rc2-win64-x64/bin/cmake.exe 
-E copy_if_different

  
"C:/Users/mjackson/DREAM3D-Dev/DREAM3D/ExternalProjects/SIMPL/Wrapping/Python/Pybind11/../Testing/AbstractFilterTest.py"
 

  
"C:/Users/mjackson/DREAM3D-Dev/DREAM3D-Builds/x64/Bin/${CMAKE_CFG_INTDIR}/python/site-packages/AbstractFilterTest.py")

 

Which does not work. The files end up in 
${BUILD_DIR}/Bin/python/site-packages/. I need them to end up in 
${BUILD_DIR}/Bin/Release/python/site-packages for a Release build. Same for 
Debug…

 

Could someone tell me what I am doing wrong or the proper way to go about this? 
I am about ready to write a simple C++ program to do the copy for me (which 
seems ludicrous to have to do..)

--

Michael Jackson | Owner, President

  BlueQuartz Software

[e] mike.jack...@bluequartz.net

[w] www.bluequartz.net

-- 

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] Adding an individual define to each source file of a library

2018-08-23 Thread George PF
> > However, whatever I write into 'set_property()' - no APPEND, single entry,
> > not quoted - does not end up
> > on the compiler command line. Is there a type mismatch which is silently
> > ignored?
> >
> 
> Or you are doing this in a directory which is not the one where the target
> is defined and from the doc:
> $ cmake --help-command set_property
> 
> ...
> ``SOURCE``
>   Scope may name zero or more source files.  Note that source
>   file properties are visible only to targets added in the same
>   directory (CMakeLists.txt).
> 
> ...

This is all in the same directory, full setup and test:

% cmake --version
cmake version 3.12.0   [..]
% mkdir mylib && cd mylib
mylib% touch file1.c file2.c
mylib% cat > CMakeLists.txt

cmake_minimum_required(VERSION 3.12)

add_library(mylib SHARED file1.c file2.c)

get_property(mysrcs TARGET mylib PROPERTY SOURCES)
foreach(x IN LISTS mysrcs)
message("at ${x}")
set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS 
"TEST1;TEST2;")
endforeach(x)
# ^D

mylib% mkdir build && cd build && cmake ..
[..]
at file1.c
at file2.c
-- Configuring done
[..]
mylibs/build% grep -r TEST1 . || echo no TEST1
no TEST1

and 'make VERBOSE=1' also shows no extra -DTEST1 compiler arguments.
-- 

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] Build flags not applied during compiler testing on Ubuntu

2018-08-23 Thread Brad King
On 08/22/2018 04:23 PM, Richard Shaw wrote:
> Here's the contents:
>
> set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
> set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
> set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")
[snip]
On 08/22/2018 05:05 PM, Richard Shaw wrote:
> One step closer:
> ...me forcing the binary output to have a .elf extension is confusing cmake:
>
> Unable to find the executable at any of:
>   /home/richard/build/stm32/CMakeFiles/CMakeTmp/cmTC_64527
>   /home/richard/build/stm32/CMakeFiles/CMakeTmp/Debug/cmTC_64527
>   /home/richard/build/stm32/CMakeFiles/CMakeTmp/Development/cmTC_64527

Ah, that's a bug.  I've just opened this issue:

  https://gitlab.kitware.com/cmake/cmake/issues/18288

Meanwhile you can use just

  set(CMAKE_EXECUTABLE_SUFFIX ".elf")

instead.

-Brad
-- 

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] Adding an individual define to each source file of a library

2018-08-23 Thread Eric Noulard
Le jeu. 23 août 2018 à 18:31, George PF  a écrit :

> Thank you for the precise pointers, I added to the same CMakeLists.txt:
>
> get_property(mysrcs TARGET mylib PROPERTY SOURCES)
>
> foreach(x IN LISTS mysrcs)
> message("at ${x}")
> set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS
> "TEST1;TEST2;")
> #set_source_files_properties(x PROPERTIES COMPILE_DEFINITIONS
> "TEST1;TEST2;") # also not working
> endforeach(x)
>
> However, whatever I write into 'set_property()' - no APPEND, single entry,
> not quoted - does not end up
> on the compiler command line. Is there a type mismatch which is silently
> ignored?
>

Or you are doing this in a directory which is not the one where the target
is defined and from the doc:
$ cmake --help-command set_property

...
``SOURCE``
  Scope may name zero or more source files.  Note that source
  file properties are visible only to targets added in the same
  directory (CMakeLists.txt).

...


> As to __FILE__ or similar, the define is used as a variable, i.e. the .c
> suffix would have to be removed
> via the c processor. The current directory is also used. I think replacing
> .c and appending the name of
> the current directory will be easier in cmake.
>
>
> > Le jeu. 23 août 2018 à 13:02, George PF  a
> écrit :
> >
> > > Hello,
> > >
> > > following "modern cmake" conventions I want to create a library where
> > > every single file is compiled with an individual define (-D_fileX_,
> > > required for a macro which integrates code into every translation
> unit).
> > >
> > > So following this
> > >
> > > add_library(mylib SHARED file1.c file2.c)
> > > target_link_libraries(mylib PUBLIC otherlib)
> > >
> > > I'd like to iterate over all "mylib" source file targets and modify
> them
> > > so that the compiler is called like this:
> > >
> > > cc -c -o file1.o file1.cc -D_file1_define_
> > > cc -c -o file1.o file2.cc -D_file2_define_
> > > etc.
> > >
> > > Is this possible?
> > >
> >
> > You can retrieve the sources associated with a target using SOURCES
> > properties.
> > https://cmake.org/cmake/help/latest/prop_tgt/SOURCES.html
> >
> > then
> > https://cmake.org/cmake/help/latest/command/foreach.html
> > with
> > https://cmake.org/cmake/help/latest/command/set_property.html
> > or
> >
> https://cmake.org/cmake/help/latest/command/set_source_files_properties.html
> >
> > for setting property:
> > https://cmake.org/cmake/help/latest/prop_sf/COMPILE_DEFINITIONS.html
> >
> > on each source file.
> >
> > not sure why you want to do that you know that compiler already defined
> > many "standard" macro for you, like __FILE__
> >
> https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
> > ?
> >
> > --
> > Eric
> --
>
> 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
>


-- 
Eric
-- 

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] Adding an individual define to each source file of a library

2018-08-23 Thread George PF
Thank you for the precise pointers, I added to the same CMakeLists.txt:
 
get_property(mysrcs TARGET mylib PROPERTY SOURCES)

foreach(x IN LISTS mysrcs)
message("at ${x}")
set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS 
"TEST1;TEST2;")
#set_source_files_properties(x PROPERTIES COMPILE_DEFINITIONS 
"TEST1;TEST2;") # also not working
endforeach(x)

However, whatever I write into 'set_property()' - no APPEND, single entry, not 
quoted - does not end up 
on the compiler command line. Is there a type mismatch which is silently 
ignored?

As to __FILE__ or similar, the define is used as a variable, i.e. the .c suffix 
would have to be removed 
via the c processor. The current directory is also used. I think replacing .c 
and appending the name of 
the current directory will be easier in cmake.


> Le jeu. 23 août 2018 à 13:02, George PF  a écrit :
> 
> > Hello,
> >
> > following "modern cmake" conventions I want to create a library where
> > every single file is compiled with an individual define (-D_fileX_,
> > required for a macro which integrates code into every translation unit).
> >
> > So following this
> >
> > add_library(mylib SHARED file1.c file2.c)
> > target_link_libraries(mylib PUBLIC otherlib)
> >
> > I'd like to iterate over all "mylib" source file targets and modify them
> > so that the compiler is called like this:
> >
> > cc -c -o file1.o file1.cc -D_file1_define_
> > cc -c -o file1.o file2.cc -D_file2_define_
> > etc.
> >
> > Is this possible?
> >
> 
> You can retrieve the sources associated with a target using SOURCES
> properties.
> https://cmake.org/cmake/help/latest/prop_tgt/SOURCES.html
> 
> then
> https://cmake.org/cmake/help/latest/command/foreach.html
> with
> https://cmake.org/cmake/help/latest/command/set_property.html
> or
> https://cmake.org/cmake/help/latest/command/set_source_files_properties.html
> 
> for setting property:
> https://cmake.org/cmake/help/latest/prop_sf/COMPILE_DEFINITIONS.html
> 
> on each source file.
> 
> not sure why you want to do that you know that compiler already defined
> many "standard" macro for you, like __FILE__
> https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
> ?
> 
> -- 
> Eric
-- 

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] Adding an individual define to each source file of a library

2018-08-23 Thread Eric Noulard
Le jeu. 23 août 2018 à 13:02, George PF  a écrit :

> Hello,
>
> following "modern cmake" conventions I want to create a library where
> every single file is compiled with an individual define (-D_fileX_,
> required for a macro which integrates code into every translation unit).
>
> So following this
>
> add_library(mylib SHARED file1.c file2.c)
> target_link_libraries(mylib PUBLIC otherlib)
>
> I'd like to iterate over all "mylib" source file targets and modify them
> so that the compiler is called like this:
>
> cc -c -o file1.o file1.cc -D_file1_define_
> cc -c -o file1.o file2.cc -D_file2_define_
> etc.
>
> Is this possible?
>

You can retrieve the sources associated with a target using SOURCES
properties.
https://cmake.org/cmake/help/latest/prop_tgt/SOURCES.html

then
https://cmake.org/cmake/help/latest/command/foreach.html
with
https://cmake.org/cmake/help/latest/command/set_property.html
or
https://cmake.org/cmake/help/latest/command/set_source_files_properties.html

for setting property:
https://cmake.org/cmake/help/latest/prop_sf/COMPILE_DEFINITIONS.html

on each source file.

not sure why you want to do that you know that compiler already defined
many "standard" macro for you, like __FILE__
https://gcc.gnu.org/onlinedocs/cpp/Standard-Predefined-Macros.html#Standard-Predefined-Macros
?

-- 
Eric
-- 

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] Android project with CMake and Visual Studio and without Nsight Tegra

2018-08-23 Thread Roman Wüger
No one?

> Am 15.08.2018 um 17:01 schrieb Roman Wüger :
> 
> Why isn‘t it enough to install the SDK and NDK?
> 
> Regards
> Roman
> 
>> Am 09.08.2018 um 09:02 schrieb Roman Wüger :
>> 
>> Hello,
>> 
>> is it somehow possible to build an Android project with CMake and Visual 
>> Studio without the Nsight Tegra Visual Studio Edition? Because the 
>> installation of NVIDIA Nsight Tegra hangs during configuring the Visual 
>> Studio 2017 in a Virtual Machine.
>> 
>> Thanks in advance
>> 
>> Best Regards
>> -- 
>> 
>> 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
> 
> -- 
> 
> 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

-- 

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] Export a custom property of a target

2018-08-23 Thread Raphael Grimm

I am using it for passing meta-data between my projects.

Is there a way to do this with cmake 3.10.2 (I am on Ubuntu 18)?


On 22.08.2018 16:03, Marc CHEVRIER wrote:

'define_property' is nearly useless except for documentation.

Export of custom properties is managed through target property 
'EXPORT_PROPERTIES'.



Le mer. 22 août 2018 à 15:58, Raphael Grimm > a écrit :


Hi,

I added a custom target property via 'define_property'
(https://cmake.org/cmake/help/latest/command/define_property.html).

When using this target in a different cmake project the property
is not
found by cmake and the meta information stored in the target
property is
lost.

Is there a way to also export custom target properties?

Regards

Raphael





smime.p7s
Description: S/MIME Cryptographic 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


[Cmake-commits] CMake branch, master, updated. v3.12.1-442-g91c9a52

2018-08-23 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  91c9a5227384b374c80f1e6453bb830e3de68a4a (commit)
   via  1a0f1a25a44005613e21591470aafecaec306202 (commit)
  from  9e68a4279bd03f977fb8516be1b6c97009c5d07b (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=91c9a5227384b374c80f1e6453bb830e3de68a4a
commit 91c9a5227384b374c80f1e6453bb830e3de68a4a
Merge: 9e68a42 1a0f1a2
Author: Craig Scott 
AuthorDate: Thu Aug 23 11:53:08 2018 +
Commit: Kitware Robot 
CommitDate: Thu Aug 23 07:53:19 2018 -0400

Merge topic 'tweak_unset_docs'

1a0f1a25a4 Help: Clarify the unset command

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


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a0f1a25a44005613e21591470aafecaec306202
commit 1a0f1a25a44005613e21591470aafecaec306202
Author: Robert Maynard 
AuthorDate: Fri Aug 17 08:29:37 2018 -0400
Commit: Robert Maynard 
CommitDate: Tue Aug 21 14:16:32 2018 -0400

Help: Clarify the unset command

diff --git a/Help/command/unset.rst b/Help/command/unset.rst
index a1fc95c..c19dd31 100644
--- a/Help/command/unset.rst
+++ b/Help/command/unset.rst
@@ -7,9 +7,16 @@ Unset a variable, cache variable, or environment variable.
 
   unset( [CACHE | PARENT_SCOPE])
 
-Removes the specified variable causing it to become undefined.  If
-``CACHE`` is present then the variable is removed from the cache instead
-of the current scope.
+Removes a normal variable from the current scope, causing it
+to become undefined.  If ``CACHE`` is present, then a cache variable
+is removed instead of a normal variable.  Note that when evaluating
+:ref:`Variable References` of the form ``${VAR}``, CMake first searches
+for a normal variable with that name.  If no such normal variable exists,
+CMake will then search for a cache entry with that name.  Because of this
+unsetting a normal variable can expose a cache variable that was previously
+hidden.  To force a variable reference of the form ``${VAR}`` to return an
+empty string, use ``set( "")``, which clears the normal variable
+but leaves it defined.
 
 If ``PARENT_SCOPE`` is present then the variable is removed from the scope
 above the current scope.  See the same option in the :command:`set` command

---

Summary of changes:
 Help/command/unset.rst | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)


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


[CMake] protobuf and imports relative to root (and --proto_path)

2018-08-23 Thread David Jobet
Hello,

I'm trying to port an existing project from premake to cmake.
I'm trying to avoid modifying the source files while doing so.

Right now, we have several libraries (read in different directories) using
proto files with imports between them.
All imports are made relative to the root of the project.

e.g :
work/lib1/sublib1/a.proto
work/lib1/sublib1/b.proto

with a.proto having a link to b.proto like this "import
lib1/sublib1/b.proto"

If I compile this with an unchanged FindProtobuf.cmake, I do this :

protobuf_generate_cpp(PROTO_SRCS PROTO_HRDS a.proto b.proto)
add_library(...)

the problem being that it looks like the "namespaces" generated by protoc
in b.proto do not match the one used in a.proto : it does not compile.

Is there a way to make this work ?

Otherwise, I made the patch below which solves my problem. Do you think it
could be included in cmake ?
it defines a new option PROTO_PATH, so the decl above becomes
protobuf_generate_cpp(PROTO_SRCS PROTO_HRDS PROTO_PATH ${CMAKE_SOURCE_DIR}
a.proto b.proto)

With regards

David

$ diff share/cmake-3.10/Modules/FindProtobuf.cmake.orig
share/cmake-3.10/Modules/FindProtobuf.cmake
123c123
<   cmake_parse_arguments(protobuf "" "EXPORT_MACRO;DESCRIPTORS" "" ${ARGN})
---
>   cmake_parse_arguments(protobuf "" "PROTO_PATH;EXPORT_MACRO;DESCRIPTORS"
"" ${ARGN})
130a131,139
>   set(EXTRA_ARGS "")
>   set(OUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
>   if(protobuf_PROTO_PATH)
> get_filename_component(ABS_PROTO_PATH ${protobuf_PROTO_PATH} ABSOLUTE)
> set(EXTRA_ARGS "--proto_path=${ABS_PROTO_PATH}")
> file(RELATIVE_PATH PROTO_REL_PATH ${CMAKE_SOURCE_DIR}
${ABS_PROTO_PATH})
> set(OUT_PATH ${CMAKE_BINARY_DIR}/${PROTO_REL_PATH})
>   endif()
>
198c207,208
<"--cpp_out=${DLL_EXPORT_DECL}${CMAKE_CURRENT_BINARY_DIR}"
---
>${EXTRA_ARGS}
>"--cpp_out=${DLL_EXPORT_DECL}${OUT_PATH}"
-- 

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] Adding an individual define to each source file of a library

2018-08-23 Thread George PF
Hello,

following "modern cmake" conventions I want to create a library where every 
single file is compiled with an individual define (-D_fileX_, required for a 
macro which integrates code into every translation unit).

So following this

add_library(mylib SHARED file1.c file2.c)
target_link_libraries(mylib PUBLIC otherlib)

I'd like to iterate over all "mylib" source file targets and modify them so 
that the compiler is called like this:

cc -c -o file1.o file1.cc -D_file1_define_
cc -c -o file1.o file2.cc -D_file2_define_
etc.

Is this possible?


Regards

GPF
-- 

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] Quiet option for cmake

2018-08-23 Thread Craig Scott
On Thu, Aug 23, 2018 at 8:02 PM, Craig Scott 
wrote:

>
>
> On Thu, Aug 23, 2018 at 4:40 AM, Brad King  wrote:
>
>> On 08/21/2018 05:04 PM, Craig Scott wrote:
>> > A user has recently been asking about reducing the output coming from a
>> > FetchContent population when nothing needs to be done
>> > Because this is implemented as a sub-build, you always see the following
>> >
>> > -- Configuring done
>> > -- Generating done
>> > -- Build files have been written to: ...
>>
>> Isn't that output coming from the invocation here:
>>
>>   https://gitlab.kitware.com/cmake/cmake/blob/v3.12.1/Modules/
>> FetchContent.cmake#L776-781
>>
>> rather than inside ExternalProject?
>>
>
> Yes, that is where I'd like to be able to use the proposed --quiet or
> --silent option.
>
>
>
>>
>> Why is that output not always captured?
>>
>
> If you capture it, then you don't get to see it until the command has
> completed. It can take non-trivial time and in some cases may require user
> input (e.g. to enter a password for a private SSH key). If you captured the
> output and the download hung for some reason, there would be no output to
> give any indication of where the download was up to. For cases where you
> don't expect problems, you can use the QUIET option and the output is
> indeed captured and only output at the end. This is the default because
> otherwise the output is rather noisy with all the ExternalProject step
> logging. But for cases where you need to investigate problems, you don't
> want the output captured.
>
> Now that I've said all that, I guess FetchContent could check if the
> output of a QUIET run was just the above-mentioned three lines and drop
> them to leave no output in that case. Might be the simpler solution.
> Furthermore, for the second execute_process() call a few lines after the
> one referenced above (which does the build stage of the sub-build), we
> could potentially make use of the logging verbosity improvements in MR
> 2129  if/when
> it is done to further minimise the output of the "nothing to do" case.
>
>
Sorry, got my wires crossed a bit there. The QUIET option already fully
absorbs the output unless there's an error. I missed this in the original
issue that prompted this request. Let me go back to that issue and see if
there's really anything needed here after all.


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

New book released: Professional CMake: A Practical Guide

-- 

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-developers] Quiet option for cmake

2018-08-23 Thread Craig Scott
On Thu, Aug 23, 2018 at 4:40 AM, Brad King  wrote:

> On 08/21/2018 05:04 PM, Craig Scott wrote:
> > A user has recently been asking about reducing the output coming from a
> > FetchContent population when nothing needs to be done
> > Because this is implemented as a sub-build, you always see the following
> >
> > -- Configuring done
> > -- Generating done
> > -- Build files have been written to: ...
>
> Isn't that output coming from the invocation here:
>
>   https://gitlab.kitware.com/cmake/cmake/blob/v3.12.1/
> Modules/FetchContent.cmake#L776-781
>
> rather than inside ExternalProject?
>

Yes, that is where I'd like to be able to use the proposed --quiet or
--silent option.



>
> Why is that output not always captured?
>

If you capture it, then you don't get to see it until the command has
completed. It can take non-trivial time and in some cases may require user
input (e.g. to enter a password for a private SSH key). If you captured the
output and the download hung for some reason, there would be no output to
give any indication of where the download was up to. For cases where you
don't expect problems, you can use the QUIET option and the output is
indeed captured and only output at the end. This is the default because
otherwise the output is rather noisy with all the ExternalProject step
logging. But for cases where you need to investigate problems, you don't
want the output captured.

Now that I've said all that, I guess FetchContent could check if the output
of a QUIET run was just the above-mentioned three lines and drop them to
leave no output in that case. Might be the simpler solution. Furthermore,
for the second execute_process() call a few lines after the one referenced
above (which does the build stage of the sub-build), we could potentially
make use of the logging verbosity improvements in MR 2129
 if/when it is
done to further minimise the output of the "nothing to do" case.


-- 
Craig Scott
Melbourne, Australia
https://crascit.com

New book released: Professional CMake: A Practical Guide

-- 

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] Is cmake failed with any Error message?

2018-08-23 Thread Petr Kmoch
Hi Maomao.

The output includes this line:

  Configuring incomplete, errors occurred!

This means that indeed, CMake has failed to configure the project. Which
means no Makefile (or oher buildsystem) was generated and therefore the
project cannot be built.

A successful run of CMake ends with output like this:

  Configuring done
  Generating done
  Build files have been written to ...

Petr

On Mon, 13 Aug 2018 at 09:13, maomao  wrote:

> Dear admin,
>
> I am trying to build a project that is a open source and have a package on
> the website.
> The required binaries are installed by macports on my macbook pro with
> OSX10.13.6 (High Sierra).
> When I tried to cmake the project, I got the output message as:
>
> es2039:build maomao$ cmake ..
>
> -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
>
> -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS
> OpenMP_CXX_LIB_NAMES)
>
> -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
>
> -- HDF5: Using hdf5 compiler wrapper to determine C configuration
>
> CMake Error at /opt/local/share/cmake-3.12/Modules/UseSWIG.cmake:509
> (message):
>
>   SWIG_ADD_LIBRARY: python;quakelib.i: unexpected arguments
>
> Call Stack (most recent call first):
>
>   quakelib/python/CMakeLists.txt:10 (SWIG_ADD_LIBRARY)
>
>
>
> -- Configuring incomplete, errors occurred!
>
> See also "/Users/maomao/VirtualTaiwan/build/CMakeFiles/CMakeOutput.log".
>
> and failed when I proceeded to make.
> So, the question is:
> Is the project configured or not with any error message like that?
> What kind output should I see when I succeed to configure the project by
> cmake?
> If cmake is failed to configure project, the code could not be build by
> make anyway?
>
> Best,
> Maomao
> --
>
> 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
>
-- 

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