[CMake] Mixed compilation of CUDA C and C++ code

2012-10-14 Thread Christian Guckelsberger

Hi there,

I wonder if a mixed compilation of both CUDA C code (nvcc compiler) and 
ordinary C++ code (any compiler) is possible. Formerly, I compiled the 
sources separately and then linked them together, which works fine. I 
know there's a CUDA module for cmake, but it only offers a command to 
build a executable from cuda code, but not mixed object files.


Any advice would be highly appreciated.

Thanks a lot,
Christian
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] target_link_libraries fails if one of the libraries is NOTFOUND

2012-10-14 Thread Vyacheslav Karamov
Hi All!

I've found annoying bug in Cmake 2.8.8 for Linux. I tried to submit it to Cmake 
bug tracker, but I couldn't register.

My target which is dynamic library, uses some static libs:

target_link_libraries(${lib_name} 
debug ${do_scoring_debug}
optimized ${do_scoring}
)

When I tried to build Release configuration of my library, build fails because 
do_scoring_debug == NOTFOUND at that time.
It seems strange to me, because linker doesn't need *Debug* version of 
${do_scoring} when building *Release* version of target.

I've found workaraound

if (NOT do_scoring_debug)
set (do_scoring_debug do_scoring)
endif()

but it seems to strange why should I need it.

___
WBR,
Vyacheslav Karamov.
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] add_custom_command

2012-10-14 Thread Totte Karlsson

Hi,
I have an executable target, that I want to be executed as part of its 
own build.


The target takes one argument, which is output folder of a text file. 
This text file is part of my source dir.


In my CMake file I have, at the end

set( resultFileFolder "${PROJECT_SOURCE_DIR}/wiki/reports")
set( resultFile "${resFileFolder}/tests_auto.xml")

add_custom_command(
DEPENDS ${target}
OUTPUT ${resultFile}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/${target}
ARGS ${resultFileFolder}
)

Now, this never seem to execute. No warnings, no nothing.

How to get it going?

-totte

--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Display all possible options in a CMakeLists file, like what we do with configure --help

2012-10-14 Thread Tschijnmo Tschau
Hi!

Sometimes different code has very different sets of options to tweak
in the building process. So when building a package with GNU
autotools, usually the first thing I do is ``configure --help'' to
list all the possible options that I can change. I am a little curious
if there is something quite similar to this kind of bahaviour in cmake
because it is really handy. Thank you so much for your help! Some
CMakeLists files from some codes do not seem to have been documented
about their options, so a convenient way to find them out seems to be
helpful.

Regards

Tschijnmo
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake on Windows x64

2012-10-14 Thread Yuri Timenkov
Except that you have CMAKE_SYSTEM_PROCESSOR == "x86" (event for "Win64"
generators) in your CMake files along with all search paths which sometimes
very inconvenient.

On Fri, Oct 12, 2012 at 5:31 PM, John Drescher  wrote:

> > I noticed that there is cmake binary package for Windows x64. Should a
> > 32-bit cmake (under syswow6432) be adequate for all cmake tasks? If
> > not, what is the right way to build cmake for 64-bit. I tried building
> > it on a 32-bit build server using the 64 bit generator (this build
> > server routinely does 64-bit cross compiles). However, apparently some
> > of the products of the 64-bit build are run to generate sources that
> > are built by other parts of the build. This being a 32-bit box does
> > not allow that and hence the cross-compile to 64-bit failed.
> >
>
> 32 bit cmake works fine for 64 bit builds on x64. I use this almost
> every day for the last 3+ years..
>
> John
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] add_custom_command

2012-10-14 Thread Michael Wild
Hi

On 10/15/2012 12:54 AM, Totte Karlsson wrote:
> Hi, I have an executable target, that I want to be executed as part
> of its own build.
> 
> The target takes one argument, which is output folder of a text
> file. This text file is part of my source dir.
> 
> In my CMake file I have, at the end
> 
> set( resultFileFolder "${PROJECT_SOURCE_DIR}/wiki/reports") set(
> resultFile "${resFileFolder}/tests_auto.xml")

First things first: You should *never* pollute your source tree, always
output to the build tree.

> 
> add_custom_command( DEPENDS ${target} OUTPUT ${resultFile} COMMAND
> ${CMAKE_CURRENT_BINARY_DIR}/bin/${target} ARGS ${resultFileFolder} )
> 
> Now, this never seem to execute. No warnings, no nothing.
> 
> How to get it going?
> 
> -totte
> 

You need a top-level target that DEPENDS on the output, that's all. E.g.

add_custom_target(createWikiReports ALL DEPENDS ${resultFile})

BTW: You don't need to specify the full path to the executable in the
COMMAND, and also no DEPENDS on it in the custom command. Just use the
target name, and CMake will handle the rest for you.

HTH

Michael
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake