FindCUDA.cmake has moved to: https://gforge.sci.utah.edu/gf/project/findcuda/scmsvn/ automatically redirecting to new web page.

FindCUDA.cmake

For more information about CMake and Cuda:

SVN revision r813 contains major changes to FindCUDA.cmake. Please see details below. To use the old script, check out a prior revision from the svn server.

NOTE: The source code is hosted at a new svn server:
https://code.sci.utah.edu/svn/findcuda/trunk

This web page contains information about an unofficial version of the FindCuda.cmake script I developed for my own CUDA programs. Many individuals have adopted the script and suggested improvements, and tested the script on various platforms and configurations. I appreciate all of the feedback and bug fixes I have received since the initial release.

This webpage is updated infrequently- the svn log contains details about bug fixes and updates.

Please send any comments or questions to my email. If you use the NVIDIA forums, I might not see you question for some time.

Abe Stephens
Scientific Computing and Imaging Institute, University of Utah.

James Bigler
NVIDIA Research.

Features:

Source Code:

We released a major revision to the script in December 2008 at approximately the same time as the CUDA 2.1 beta. There are many differences in the new version of the script and it has been tested extensively on Linux, Mac, and WinXP/Vista.

It is necessary to make several changes to a project's CMakeLists.txt files in order to use the new version.

List of partial changes:
Major bug fixes:

Notes:

The code is available in an svn repository: https://code.sci.utah.edu/svn/CMake-cuda

Either checkout the example project:


svn co https://code.sci.utah.edu/svn/findcuda/trunk CMake-cuda


Usage:

The script will search for your cuda toolkit and SDK installation using several standard paths and the environment variables which are created by the installer.

The following example includes the script and shows how to add code in an executable. The CUDA_ADD_* commands have the same semantics as the standard ADD_* commands.

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/cuda" ${CMAKE_MODULE_PATH})
FIND_PACKAGE(CUDA)

CUDA_ADD_EXECUTABLE(test
  test_bin.cu
  main.cc
  )


See additional usage in the example project.

License

  For more information, please see: http://software.sci.utah.edu

  The MIT License

  Copyright (c) 2007-2008
  Scientific Computing and Imaging Institute, University of Utah

  License for the specific language governing rights and limitations under
  Permission is hereby granted, free of charge, to any person obtaining a
  copy of this software and associated documentation files (the "Software"),
  to deal in the Software without restriction, including without limitation
  the rights to use, copy, modify, merge, publish, distribute, sublicense,
  and/or sell copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included
  in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  DEALINGS IN THE SOFTWARE.