GEOS-ESM / ESMA_cmake

Custom CMake macros for the GEOS Earth System Model
Apache License 2.0
4 stars 9 forks source link

Quote CMake generator arguments #308

Closed scivision closed 7 months ago

scivision commented 1 year ago

https://github.com/GEOS-ESM/ESMA_cmake/blob/9cce4f3d59d0f5570c283866e2ce2a3f10fdba50/esma_support/esma_fortran_generator_list.cmake#L6

Just happened to see this. CMake generator expressions should generally be quoted to ensure proper operation like:

target_compile_options (${target} PRIVATE "$<$<COMPILE_LANGUAGE:Fortran>:${flags}>")

i.e. then you can remove that foreach()

mathomp4 commented 1 year ago

ooh. Thanks. I still get confused with both generator expressions and quoting in CMake. I'm fairly certain half the quotes I use are not needed...and I need them when I don't!