linux - CMake: how to use if condition in add_custom_command(...) -
i want use linux if condition in cmakelists.txt add_custom_command(...) need run these if condition , judgement in makefile. this:
cmake_minimum_required(version 2.8) add_custom_target(temp_target all) add_custom_command(target temp_target pre_build command if ["a" != "b"]; echo 1; fi; verbatim )
what should if want use
if ["a" != "b"]; echo 1; fi;
when make makefile? lot help!
you may specify one-line shell code using /bin/sh -c
command argument:
command /bin/sh -c "if [ 'a' != 'b' ]; echo 1; fi;"
note, [
extension of bash, may unknown simple shells "dash".
Comments
Post a Comment