Re: [CMake] FindDoxygen is doing find_package() when it is included

2017-07-07 Thread Robert Dailey
Apologies for the confusion and spam: I figured out that when you do a
find_package(), it also implicitly includes the contents of that
module into your list file so you can access its functions. I was
under the impression I had to include FindDoxygen.cmake explicitly to
access the functions it provides.

I'm guessing this is supported behavior. If so, I'll rely on it.

On Fri, Jul 7, 2017 at 1:20 PM, Robert Dailey  wrote:
> I actually confused myself a bit... I think the issue is not that
> finding happens when including it, but that doxygen_add_docs() is
> bundled with the find module. What is the intended usage of this? If I
> do find_package() will that also make doxygen_add_docs() available? Or
> do I have to explicitly include FindDoxygen to get access to the
> function?
>
> On Fri, Jul 7, 2017 at 1:13 PM, Robert Dailey  
> wrote:
>> When I do this:
>>
>>
>> message( "blah1" )
>> include( FindDoxygen )
>>
>> message( "blah2" )
>> find_package( Doxygen 1.8.6 OPTIONAL_COMPONENTS dot )
>> message( "blah3" )
>>
>>
>> I get this output:
>>
>>
>> blah1
>> -- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found
>> version "1.8.13") found components:  doxygen missing components:  dot
>> blah2
>> -- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found
>> suitable version "1.8.13", minimum required is "1.8.6") found
>> components:  doxygen missing components:  dot
>> blah3
>>
>>
>> Two questions:
>>
>> 1. Why is find_package() happening automatically when I include the
>> find module? This is contrary to the behavior of other find modules. I
>> do not want it to find doxygen for me, as I have some minimum version
>> requirements and I do not want it to find dot. How can I disable this
>> implied search behavior?
>>
>> 2. Each time I run my scripts, it keeps searching for doxygen. Even
>> though I've specified dot as an optional component. I do not want it
>> to keep searching for doxygen each time I generate. It should find it
>> once and be done. How can I fix this behavior?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] FindDoxygen is doing find_package() when it is included

2017-07-07 Thread Robert Dailey
I actually confused myself a bit... I think the issue is not that
finding happens when including it, but that doxygen_add_docs() is
bundled with the find module. What is the intended usage of this? If I
do find_package() will that also make doxygen_add_docs() available? Or
do I have to explicitly include FindDoxygen to get access to the
function?

On Fri, Jul 7, 2017 at 1:13 PM, Robert Dailey  wrote:
> When I do this:
>
>
> message( "blah1" )
> include( FindDoxygen )
>
> message( "blah2" )
> find_package( Doxygen 1.8.6 OPTIONAL_COMPONENTS dot )
> message( "blah3" )
>
>
> I get this output:
>
>
> blah1
> -- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found
> version "1.8.13") found components:  doxygen missing components:  dot
> blah2
> -- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found
> suitable version "1.8.13", minimum required is "1.8.6") found
> components:  doxygen missing components:  dot
> blah3
>
>
> Two questions:
>
> 1. Why is find_package() happening automatically when I include the
> find module? This is contrary to the behavior of other find modules. I
> do not want it to find doxygen for me, as I have some minimum version
> requirements and I do not want it to find dot. How can I disable this
> implied search behavior?
>
> 2. Each time I run my scripts, it keeps searching for doxygen. Even
> though I've specified dot as an optional component. I do not want it
> to keep searching for doxygen each time I generate. It should find it
> once and be done. How can I fix this behavior?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] FindDoxygen is doing find_package() when it is included

2017-07-07 Thread Robert Dailey
When I do this:


message( "blah1" )
include( FindDoxygen )

message( "blah2" )
find_package( Doxygen 1.8.6 OPTIONAL_COMPONENTS dot )
message( "blah3" )


I get this output:


blah1
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found
version "1.8.13") found components:  doxygen missing components:  dot
blah2
-- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found
suitable version "1.8.13", minimum required is "1.8.6") found
components:  doxygen missing components:  dot
blah3


Two questions:

1. Why is find_package() happening automatically when I include the
find module? This is contrary to the behavior of other find modules. I
do not want it to find doxygen for me, as I have some minimum version
requirements and I do not want it to find dot. How can I disable this
implied search behavior?

2. Each time I run my scripts, it keeps searching for doxygen. Even
though I've specified dot as an optional component. I do not want it
to keep searching for doxygen each time I generate. It should find it
once and be done. How can I fix this behavior?
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Help on first cmake project

2017-07-07 Thread Gonzalo Garramuño



El 07/07/17 a las 03:45, Florian Lindner escribió:

* Any other advises you want to give me?
I would advise you try to build out of source tree to keep the source 
clean.  Example:


$ mkdir build-linux64
$ cd build-linux64
$ cmake .. -G'Unix Makefiles'
$ make
$ make install

when done, you can then do:

$ cd ..
$ rm -rf build-linux64


Thanks for helping a beginner!

Florian

No problem.

--
Gonzalo Garramuño

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Parallel moc for Qt files

2017-07-07 Thread Konstantin Tokarev


06.07.2017, 23:00, "Michael Jackson" :
> I have a large list of files that need to have Qt's 'moc' run on them
> (107 headers). I use all the normal CMake facilities for Qt based
> projects. I noticed that the generation of the moc files are done
> serially. Is there a flag or anything that I can use to run the
> generation in Parallel? I ask because each file takes about 3 seconds to
> run through moc. The code is heavily C++ templated which I think causes
> 'moc' to run more slowly. We have other places in the code where 'moc'
> must run and it does each file in the "blink of an eye".

Replace use of AUTOMOC with macros like qt5_generate_moc. Each moc file
will be generated by a separate custom command.

For example, I wrote 3 macros that wrap qt5_generate_moc for more
convenience [1], example usage is at [2].

[1] 
https://github.com/annulen/webkit/blob/qtwebkit-stable/Source/cmake/OptionsQt.cmake#L63
[2] 
https://github.com/annulen/webkit/blob/qtwebkit-stable/Source/WebCore/PlatformQt.cmake#L165

>
> Just curious.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@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:
> http://public.kitware.com/mailman/listinfo/cmake

-- 
Regards,
Konstantin
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Parallel moc for Qt files

2017-07-07 Thread Michael Jackson
Thank you for the suggestions.

It is almost like a Jom for moc needs to be written.

-Mike Jackson

From: Benjamin Ballet 
Sent: Friday, July 7, 2017 5:47:20 AM
To: Michael Jackson
Cc: cmake
Subject: Re: [CMake] Parallel moc for Qt files

I don't know how to parallelize moc with CMake though I previously reduce moc 
time (sometimes it's very slow) :

- by replacing as much #include as possible by forward-declaration

- wrapping some #include around #ifndef Q_MOC_RUN ... #endif

2017-07-06 22:00 GMT+02:00 Michael Jackson 
mailto:mike.jack...@bluequartz.net>>:
I have a large list of files that need to have Qt's 'moc' run on them (107 
headers). I use all the normal CMake facilities for Qt based projects. I 
noticed that the generation of the moc files are done serially. Is there a flag 
or anything that I can use to run the generation in Parallel? I ask because 
each file takes about 3 seconds to run through moc. The code is heavily C++ 
templated which I think causes 'moc' to run more slowly. We have other places 
in the code where 'moc' must run and it does each file in the "blink of an eye".

Just curious.

--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@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:
http://public.kitware.com/mailman/listinfo/cmake



--
Benjamin Ballet
Ingénieur R&D

[http://www.activscreen.com/mkg/signature/email_2017/ivs_logo.png]

19 rue Klock - 92110 Clichy - FRANCE
Standard : +33 1 44 69 37 37

www.activisu.com

[http://www.activscreen.com/mkg/signature/Signature_IVS_MAI_17.png]

[http://www.activscreen.com/mkg/signature/email_2017/linkedin.png]
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Parallel moc for Qt files

2017-07-07 Thread Michael Jackson
Looks like an interesting project. After reading  the blog and reading the 
GitHub issue pages there seem to be serious issues with MSVC still which is a 
blocker for us. I will keep an eye on it though.

--
Michael A. Jackson

From: Cristian Adam 
Sent: Thursday, July 6, 2017 6:11:50 PM
To: Michael Jackson
Cc: cmake
Subject: Re: [CMake] Parallel moc for Qt files

On Thu, Jul 6, 2017 at 10:00 PM, Michael Jackson 
mailto:mike.jack...@bluequartz.net>> wrote:
I have a large list of files that need to have Qt's 'moc' run on them (107 
headers). I use all the normal CMake facilities for Qt based projects. I 
noticed that the generation of the moc files are done serially. Is there a flag 
or anything that I can use to run the generation in Parallel? I ask because 
each file takes about 3 seconds to run through moc. The code is heavily C++ 
templated which I think causes 'moc' to run more slowly. We have other places 
in the code where 'moc' must run and it does each file in the "blink of an eye".

Just curious.


Have you tried removing moc altogether using 
Verdigris? I'm curious 
how this would speed up your compilation time.

Cheers,
Cristian.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Parallel moc for Qt files

2017-07-07 Thread Benjamin Ballet via CMake
I don't know how to parallelize moc with CMake though I previously reduce
moc time (sometimes it's very slow) :

- by replacing as much #include as possible by forward-declaration

- wrapping some #include around #ifndef Q_MOC_RUN ... #endif

2017-07-06 22:00 GMT+02:00 Michael Jackson :

> I have a large list of files that need to have Qt's 'moc' run on them (107
> headers). I use all the normal CMake facilities for Qt based projects. I
> noticed that the generation of the moc files are done serially. Is there a
> flag or anything that I can use to run the generation in Parallel? I ask
> because each file takes about 3 seconds to run through moc. The code is
> heavily C++ templated which I think causes 'moc' to run more slowly. We
> have other places in the code where 'moc' must run and it does each file in
> the "blink of an eye".
>
> Just curious.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>



-- 
Benjamin Ballet
Ingénieur R&D



19 rue Klock - 92110 Clichy - FRANCE
Standard : +33 1 44 69 37 37

www.activisu.com




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Help on first cmake project

2017-07-07 Thread J Decker
On Thu, Jul 6, 2017 at 11:45 PM, Florian Lindner 
wrote:

> Hello,
>
> coming from scons I want to take a look into cmake...
>
> My CMakeList.txt looks like:
>
>
> cmake_minimum_required (VERSION 3.0)
> project (ASTE)
>
> add_executable(readMesh readMesh.cpp)
>
> find_library(precice precice PATHS $ENV{PRECICE_ROOT}/build/last)
> target_link_libraries(readMesh ${precice})
> set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} $ENV{PRECICE_ROOT}/build/last)
>
>
> find_package(Boost 1.60.0
>   COMPONENTS program_options filesystem
>   REQUIRED)
> target_link_libraries(readMesh ${Boost_LIBRARIES})
>
> find_package(MPI REQUIRED)
> target_link_libraries(readMesh ${MPI_LIBRARIES})
> set(COMPILE_FLAGS  ${COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
> set(LINK_FLAGS ${LINK_FLAGS} ${MPI_LINK_FLAGS})
>
>
> and does it job, i.e. the target builds. precice is out own, independently
> build library.
>
> However, I have several questions:
>
> * Can I make target_link_libraries add a library for all defined targets?
> At the moment, there is only one, but in the
> projekt there are multiple, very similiar targets built.
>
No; each target needs to have target_link_libaries.  You can build a list
of libs to add like set( common_deps ${Boost_LIBRARIES} ${MPI_LIBRARIES} )
; or appending to a variable like you did with COMPILE_FLAGS.


> * Can I make find_library to treat the library as required, as with
> find_package?
>

can add if( -NOTFOUND ) message( ERROR "xxx not found" )
can wrap that in a macro for simplification...

macro( my_find_library var )
  find_library( ${var} ${ARGN} )
  if( ${var}-NOTFOUND )
message( FATAL_ERROR "${ARG2} was not found" )
  endif()
endmacro()

(assumes that you're using the single name version, and not multiple names
using NAME command in find_library)

>
> * Can I reused the value of find_library's PATH setting? Especially if
> there are multiple PATHs, wouldn't it be nice to
> have a precice-LIBPATH that contains the path, where the library was
> found? So I can add this to CMAKE_LIBRARY_PATH? Or
> is there another function that does all that?
>
> Yes, these become available for all sub projects also.
INCLUDE_DIRECTORIES() and LINK_DIRECTORIES() will also get inherited by
child projects.


> * Is there a way to clean cmake cache, other than rm -rf CMakeFiles
> CMakeCache.txt. Would be nice, when playing around
> and frequently changing the CMakeLists.txt
>
> really just remove CMakeCache.txt is sufficient; though generally you
won't have to remove the cache; it redoes the generation if one of the
cmakelists.txt is updated (or included dependancies).  If you're moving
librarites to be found, then yes you will have to remove the cmakecache.


> * I am a bit suprised that finding/or not finding MPI or precice is not
> printed out when executing cmake.
>
> * Any other advises you want to give me?
>
> Thanks for helping a beginner!
>
> Florian
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake