1)if if(<condition>) <commands> elseif(<condition>) # optional block, can be repeated <commands> else() # optional block <commands> endif() if(PPLCV_DEP_HPCC_PKG) FetchContent_Declare(hpcc URL ${PPLCV_DEP_HPCC_PKG} SOURCE_DIR ${HPCC_DEPS_DIR}/hpcc BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/hpcc-build SUBBUILD_DIR ${HPCC_DEPS_DIR}/hpcc-subbuild) else() if(NOT PPLCV_DEP_HPCC_GIT) set(PPLCV_DEP_HPCC_GIT "https://github.com/openppl-public/hpcc.git") endif() FetchContent_Declare(hpcc GIT_REPOSITORY ${PPLCV_DEP_HPCC_GIT} GIT_TAG ${__HPCC_COMMIT__} SOURCE_DIR ${HPCC_DEPS_DIR}/hpcc BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/hpcc-build SUBBUILD_DIR ${HPCC_DEPS_DIR}/hpcc-subbuild) endif() 2) option(TEST_DEBUG "option for debug" OFF) if (TEST_DEBUG) # 这个TEST_DEBUG 是CMake中的变量 add_definitions(-DTEST_DEBUG) # 这个TEST_DEBUG 是CMake中的变量 endif(TEST_DEBUG) #ifdef TEST_DEBUG ... ... #else ... #endif 3) |
说点什么...