if(CMAKE_SYSTEM_NAME STREQUAL "Linux") message(STATUS "Doing things the usual way") elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") message(STATUS "Thinking differently") elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") message(STATUS "I'm supported here too.") elseif(CMAKE_SYSTEM_NAME STREQUAL ...
{CMAKE_SYSTEM_PROCESSOR_LC}) endif() message(STATUS "${BITS}-bit build (${CPU_TYPE})") #//: 到这里结束 file(WRITE "/Users/lmy/.AndroidStudioProjects/AlSkia/src/skia/cmake/empty.cpp") execute_process(COMMAND ninja -C "/Users/lmy/.AndroidStudioProjects/AlSkia/src/skia/cmake/" ...
# some_command will be called if the variable's value is not: # empty, 0, N, NO, OFF, FALSE, NOTFOUND, or -NOTFOUND. if(var) some_command(...) endif(var) 2: 循环结构: foreach 和 while set(VAR a b c) # loop over a, b,c with the variable f foreach(f ${VAR}) messa...
get_target_property(TEMP ${THE_TARGET} COMPILE_FLAGS)if(TEMP STREQUA...
YES, TRUE, Y, or a non-zero number. Falseifthe constant is0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the emptystring, or endsinthe suffix -NOTFOUND. Named boolean constants arecase-insensitive. If the argument is not one of these constants, it is treated as a variable.if(<variable>...
True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND. Named boolean constants are case-insensitive. If the argument is not one of these constants...
message("The first if branch...") elseif (EMPTY_STR) message("EMPTY_STR is not empty") else () message("All other case") endif() 3 列表操作 list也是CMake的一个命令,有很多有用的子命令,比较常用的有: APPEND,往列表中添加元素;
条件控制流if ```cmake some_command will be called if the variable's value is not: empty, 0, N, NO, OFF, FALSE, NOTFOUND, or -NOTFOUND. if(var) some_command(...) endif(var) ``` 循环结构:foreach和while ```cmake set(VAR a b c) ...
4. set(var a;b;c) <=> set(var a b c) #定义变量var并赋值为a;b;c这样一个string list 5. Add_executable({var}) <=> Add_executable(a b c) #变量使用{xxx}引用 6. 条件语句: if(var) #var 非empty 0 N No OFF FALSE... #非运算使用NOT ...
if( frame.empty() ) break; Mat frame1 = frame.clone(); detect->detectAndDraw( frame1); char c = (char)waitKey(10); if( c == 27 || c == 'q' || c == 'Q' ) break; } } return 0; } 1. 2. 3. 4. 5. 6.