[CMake] Setting compile defs with: Cuda, add_subdirectory, and set_target_properties (COMPILE_DEFINITIONS)

Brian Davis bitminer at gmail.com
Thu Jul 15 09:45:15 EDT 2010


> Shouldn't this be COMPILE_FLAGS?

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_dir:COMPILE_DEFINITIONS

Under properties on directories

Preprocessor definitions for compiling a directory's sources.
The COMPILE_DEFINITIONS property may be set to a semicolon-separated list of
processor definitions using the syntax VAR or VAR=value. Function-style
definitions are not supported.

and Under properties on targets

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:COMPILE_DEFINITIONS

Under properties on source files

http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_sf:COMPILE_DEFINITIONS

From:

https://mail.google.com/mail/?hl=en&shva=1#label/CMake+Users/129d1aae591a200d

   - *COMPILE_FLAGS*: Additional flags to use when compiling this target's
   sources.

   The COMPILE_FLAGS property sets additional compiler flags used to build
   sources within the target. Use COMPILE_DEFINITIONS to pass additional
   preprocessor definitions.

-snip-

  CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
                       [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]
[OPTIONS ...] )
  -- Creates an executable "cuda_target" which is made up of the files
     specified.  All of the non CUDA C files are compiled using the standard
     build rules specified by CMAKE and the cuda files are compiled to object
     files using nvcc and the host compiler.  In addition CUDA_INCLUDE_DIRS is
     added automatically to include_directories().  Standard CMake target calls
     can be used on the target after calling this macro
     (e.g. set_target_properties and target_link_libraries).


  CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
                    [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL]
[OPTIONS ...] )
  -- Same as CUDA_ADD_EXECUTABLE except that a library is created


--end snip--

Note above reference to set_target_properties


Am I using this incorrectly?  I have tried it with/without -D prepended.  I
will try COMPILE_FLAGS heck if it works maybe that's "what I get for reading
the instructions" (CMake manual) :-).  Can I officialy call out shananigans
(in reference to CMake Manual)?  Shananigans!

http://encarta.msn.com/dictionary_/shenanigans.html (2nd definition)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100715/42b97692/attachment-0001.htm>


More information about the CMake mailing list