【发布时间】:2016-04-19 07:27:22
【问题描述】:
我想通过 add_custom_command(...) 在 CMakeLists.txt 中使用 Linux if 条件,因为我需要运行这些 if 条件并在 makefile 中做一些判断。像这样:
cmake_minimum_required(VERSION 2.8)
add_custom_target(temp_target ALL)
add_custom_command(TARGET temp_target
PRE_BUILD
COMMAND if ["a" != "b"]; then echo 1; fi;
VERBATIM )
如果我想使用我应该怎么做
if ["a" != "b"]; then echo 1; fi;
什么时候制作一个makefile? 非常感谢您的帮助!
【问题讨论】:
-
如果这样不行,为什么不尝试在函数中添加这些,然后在命令中调用该函数?
标签: linux bash cmake makefile cmake-custom-command