CMake - how to set multiple compile definitions for target executable? -


i'm trying set multiple compile definitions 1 of executables i'm trying compile in cmake (in order activate macros used debugging). here's tried:

add_executable (trie_io_test trie_io_test.c trie.c word_list.c)     set_target_properties(             trie_io_test             properties             compile_definitions unit_testing=1)     set_target_properties(             trie_io_test             properties             compile_definitions io_test=1) 

unfortunately causes io_test defined.

i tried following:

add_executable (trie_io_test trie_io_test.c trie.c word_list.c)     set_target_properties(             trie_io_test             properties             compile_definitions unit_testing=1 io_test=1) 

but this, on other hand, causes cmake error.

how set both of these definitions executable i'm trying build?

you want target_compile_definitions instead of set_target_properties:

target_compile_definitions(trie_io_test private unit_testing=1 io_test=1) 

Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -