[CMake] Problem with ASM and COMPILE_DEFINITIONS

Tyler Roscoe tyler at cryptio.net
Mon May 25 12:22:36 EDT 2009


On Mon, May 25, 2009 at 12:13:13PM +0200, Marcel Loose wrote:
> I get compilation errors, because CMake passes -D<def> definitions to
> the assembler, but the assembler doesn't accept preprocessor
> definitions. These definitions were set a number of directory levels
> higher, using add_definitions(). How can I avoid that these definitions
> are put on the command line to the assembler?

How about:

http://www.cmake.org/cmake/help/cmake2.6docs.html#command:remove_definitions

Another route is to switch from using add_definitions() to using
set_target_properties(... COMPILE_DEFINITIONS ...) with variables
declared in your higher-level CMakeLists and mangled, perhaps with
regular expressions, in the CMakeLists for your assembler project.

tyler


More information about the CMake mailing list