My interpretation of the question was the simplest thing to think of, which is just to provide a list of symbols that you want defined in a target, as in:

set_target_properties(MyDll PROPERTIES
    COMPILE_DEFINITIONS _USRDLL,UNICODE)

It appears to be as simple as separating the symbols with a comma, with no spaces.

As for appending to the existing COMPILE_DEFINITIONS for a target, I defer to Alexander Neundorf's answer below.


On Wednesday 11 March 2009, Alexander Neundorf wrote:
On Wednesday 11 March 2009, Steven Van Ingelgem wrote:
> Hi all,
>
>
> How can I add multiple "COMPILE_DEFINITIONS" for 1 source file?
> I tried with a foreach loop, I tried with an array to
> "COMPILE_DEFINITIONS". In the first case, the latest is retained, in the
> last case only the first one is set.

I can think of the following ways:

use SET_PROPERTY(SOURCE ... ) with the APPEND argument, or

first use GET_SOURCE_FILE_PROPERTY() to get the current value, then append the
new value to the variable, and then set the new value using
SET_SOURCE_FILES_PROPERTIES().

Make sure to use quuotes around the dereferenced variable:
SET_SOURCE_FILES_PROPERTIES(.... "${my_list_of_stuff}" ).

Please post the code if it doesn't work.

Alex

_______________________________________________
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

Reply via email to