Ok, Thanks! I guess I have to get better at reading error messages ☺
From: Chuck Atkins
Date: Monday, October 15, 2018 at 12:19 PM
To: Rob Boehne
Cc: CMake Mail List
Subject: Re: [CMake] Building arguments to target_comple_definitions()
Hi Rob,
How would one set a variable containing
Hi Rob,
How would one set a variable containing multiple definitions to be passed
> to target_compile_definitions() ?
>
The example you gave works (adjusting for typos, PIC, and adding visibility
specifier):
...
set(COMMON_DEFINITIONS SOME_DEFINE_1 SOME_DEFINE_2 SOME_DEFINE_3)
...
How would one set a variable containing multiple definitions to be passed to
target_compile_definitions() ?
From: Chuck Atkins
Date: Friday, October 12, 2018 at 1:45 PM
To: Rob Boehne
Cc: CMake Mail List
Subject: Re: [CMake] Building arguments to target_comple_definitions()
So in CMake
- Chuck
>
> *From: *Chuck Atkins
> *Date: *Thursday, October 11, 2018 at 2:55 PM
> *To: *Rob Boehne
> *Cc: *CMake Mail List
> *Subject: *Re: [CMake] Building arguments to target_comple_definitions()
>
>
>
> So, are you suggesting that I make a “dummy” targe
They were elided for brevity –
So in CMake parlance, what type is the last argument to
target_compile_definitions? Is it a list, string or something else?
From: Chuck Atkins
Date: Thursday, October 11, 2018 at 2:55 PM
To: Rob Boehne
Cc: CMake Mail List
Subject: Re: [CMake] Building
>
> So, are you suggesting that I make a “dummy” target and fill it with the
> common options in compile_definitions() and include_directories() (et. al.)
>
> Then make my OBJECT libraries (and the shared library) depend on the
> “dummy” target?
>
>
> If that’s not the suggestion, I’m afraid I
can use this to set
the common flags
From: Chuck Atkins
Date: Thursday, October 11, 2018 at 2:12 PM
To: Rob Boehne
Cc: CMake Mail List
Subject: Re: [CMake] Building arguments to target_comple_definitions()
Hi Rob,
target_compile_definitions( CHUNK1 ${COMMON_DEFINITIONS} CHUNK1_STUFF
Hi Rob,
> target_compile_definitions( CHUNK1 ${COMMON_DEFINITIONS} CHUNK1_STUFF
> CHUNK_NAME=\”One\” )
>
> target_compile_definitions( CHUNK2 ${COMMON_DEFINITIONS} CHUNK2_STUFF
> CHUNK_NAME=\”Two\”)
>
> target_compile_definitions( FooBar ${COMMON_DEFINITIONS} )
>
This is what I was referring
] Building arguments to target_comple_definitions()
Hi Robb,
Are you adding the appropriate visibility, i.e. PUBLIC, PRIVATE, or INTERFACE?
You should be able to do the following:
# Translates to -DFOODEF1=hello -DFOODEF2=world
target_compile_definitions(fooTarget PRIVATE FOODEF1=hello FOODEF2