LoginSignup
1
0

More than 1 year has passed since last update.

BOOL expressionの引数は文字列である

Posted at
project(cmake-string)
set(FOO 0)

add_library(foobar SHARED a.c)
target_link_libraries(foobar $<IF:$<BOOL:FOO>,bar,baz>)
add_library(foobaz SHARED a.c)
target_link_libraries(foobaz $<IF:$<BOOL:${FOO}>,bar,baz>)

FOO=0なのでIF expressionはFALSEを期待していますが、BOOL expressionは文字列を引数に取るので、
上の例だと誤ってlibbarを参照してしまいます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0