cmakelist define variables

Custom variable:

SET(opencv_dir "/mnt/d/android/OpenCV-3.4.8-android-sdk")

transfer:

INCLUDE_DIRECTORIES(${opencv_dir}/sdk/native/jni/include)

SET(OpenCV_LIB ${opencv_dir}/sdk/native/libs/arm64-v8a/libopencv_java3.so)

Print out custom variables:

语法:MESSAGE("include folder: "${include_dir})

The value of ${include_dir} is entered when the cmaek command is executed

Judgment variable usage:

Judging characters, else usage, printing messages

if(address  STREQUAL "arm64-v8a")
    message("defined address!!!!!!!!!!")
else()
    message("NOT defined address!!!!!!!!!")
endif()
 
option(address "hello world" ON)
message("option is ${address}")
 
if(address)
    message("defined address!!!!!!!!!!")
else()
    message("NOT defined address!!!!!!!!!")
endif()


Example:

if (${ANDROID_ABI} STREQUAL "

Guess you like

Origin blog.csdn.net/jacke121/article/details/123880198