[cmake-developers] cuda_compile_ptx re-runs CMake at build time

2019-02-14 Thread Charles Huet
Hi,

I'm having an issue with CUDA (sadly the old-style FindCUDA, not the new
native support of CUDA).

The following CMake file reproduces the issue easily on Windows with any
Visual Studio Generator (14 2015 Win64 being the one I use).

Adding the file generated by cuda_compile_ptx to any target (even a custom
one) causes CMake to be re-run at compile time.
Which is very annoying, but causes build errors on multi-threaded builds
(permission denied on the vcxproj generated by this CMakeLists.). Of
course, such issues cannot be reproduced with this simple CMakeLists file.

Am I misusing the cuda_compile_ptx method ?
Is there a way to prevent such CMake runs during compile time to occur ?

Thanks.

project(testCuda)
cmake_minimum_required(VERSION 3.10.2)
find_package(CUDA 9.2 REQUIRED)

CUDA_COMPILE_PTX(OBJECT_FILES Arithmetic.cu)

add_library(stuff SHARED SoArithmetic.cxx ${OBJECT_FILES})
-- 

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] Properly Documenting a CMake Module

2019-02-14 Thread Timothy Wrona
That's what I was looking for! Thanks!!!

On Thu, Feb 14, 2019 at 9:04 AM  wrote:

>
>
> > Am 14.02.2019 um 14:53 schrieb Timothy Wrona :
> >
> > How does Sphinx know to go parse that ".cmake" file? Does Sphinx
> recognize the „cmake-module" keyword in a special way and know what to do
> with it?
>
> it’s from a Sphinx module that you can find the in the CMake sources
> Utilities/Sphinx/cmake.py. Or you can install this file using pip:
>
> > pip install sphinxcontrib-moderncmakedomain
>
> When configuring Sphinx, you have to name the extensions to use in
> Sphinx's configuration file (conf.py) and add the name of the extension
> (sphinxcontrib.moderncmakedomain) to the extensions array.
>
> best regards,
>
> Torsten
>
-- 

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] Properly Documenting a CMake Module

2019-02-14 Thread Torsten


> Am 14.02.2019 um 14:53 schrieb Timothy Wrona :
> 
> How does Sphinx know to go parse that ".cmake" file? Does Sphinx recognize 
> the „cmake-module" keyword in a special way and know what to do with it?

it’s from a Sphinx module that you can find the in the CMake sources 
Utilities/Sphinx/cmake.py. Or you can install this file using pip:

> pip install sphinxcontrib-moderncmakedomain

When configuring Sphinx, you have to name the extensions to use in Sphinx's 
configuration file (conf.py) and add the name of the extension 
(sphinxcontrib.moderncmakedomain) to the extensions array.

best regards,

Torsten


signature.asc
Description: Message signed with OpenPGP
-- 

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] Properly Documenting a CMake Module

2019-02-14 Thread Timothy Wrona
Hi Gregor,

It looks like there's still a little bit of magic here. All those
"Help/.rst" files just have a single line in them that says:

.. cmake-module:: ../../Modules/.cmake

How does Sphinx know to go parse that ".cmake" file? Does Sphinx recognize
the "cmake-module" keyword in a special way and know what to do with it?

Thanks,
Tim
-- 

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] Properly Documenting a CMake Module

2019-02-14 Thread Gregor Jasny via cmake-developers

Hello,

On 14.02.19 04:39, Timothy Wrona wrote:
Okay so I dug a little deeper into this and it definitely looks like 
sphinx is the correct tool to use, but I still have one problem.


I would like sphinx to be able to extract ".rst" formatted comments 
directly out of my cmake source files to produce the documentation but I 
can't seem to figure out how.


The standard modules that ship with cmake all have this ".rst" section 
at the top that seems to magically get extracted and turned into online 
documentation with sphinx, but I just can't figure out how they do it.


The standard modules have a shadow hierarchy at Help/module. For example

https://gitlab.kitware.com/cmake/cmake/blob/master/Help/module/GNUInstallDirs.rst

contains

.. cmake-module:: ../../Modules/GNUInstallDirs.cmake

There's no magic happening.

Thanks,
Gregor
--

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