macro(bar) if (DEFINED ARGN) message("defined ARGN") endif() foreach(loop_var IN LISTS ARGN) message(STATUS "loop_var: ${loop_var}") endforeach() endmacro() function(foo) # 打印ARGN参数值 message(STATUS "ARGN: ${ARGN}") # 打印ARGC参数值 message(STATUS "ARGC: ${ARGC}") # 打...
-- not using lib curl cmake中有两个相似的关键字,macro和function。这两个都是创建一段有名字的代码稍后可以调用,还可以传参数。 macro宏定义与function函数的相同点 macro形式如下: macro(<name> [arg1 [arg2 [arg3 ...]]]) COMMAND1(ARGS ...) COMMAND2(ARGS ...) ... endmacro(<name>) 复制...
install(导出MathFunctionStargets File MathFunctionStargets.cmake lib/cmake/MathFunctions ) 包括(CMAKEPACKAGECONFIGHELPERS)#生成包含Exports配置文件的配置文件 }/mathfunctionsconfig.cmake " INSTALL_DESTINATION "lib/cmake/example" NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO ) # 生成配置文件...
{CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake" INSTALL_DESTINATION "lib/cmake/example" NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO ) # generate the version file for the config file write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.c...
endmacro (do_test) # do a bunch of result based tests do_test (25 "25 is 5") do_test (-25 "-25 is 0") 执行make install: D:/Projects/Lab/testngpp/cmake-2.8.1/Tests/Tutorial/Step3/build>make install [ 50%] "Built target MathFunctions" ...
//示例1:set(ENV{CXX}"clang++")unset(ENV{VERBOSE})//示例2:set(ENV{CMAKE_PATH}"myown/path/example")# 判断CMAKE_PATH环境变量是否定义if(DEFINEDENV{CMAKE_PATH})//注意此处ENV前没有$符号message("CMAKE_PATH_1: $ENV{CMAKE_PATH}")//注意此处ENV前有$符号else()message("NOT DEFINED CMAKE...
{CMAKE_CURRENT_BINARY_DIR}/MathFunction sConfig.cmake " INSTALL_DESTINATION "lib/cmake/example" NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO ) # 生成配置文件的版本文件 write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake" VERSION "${...
macro(netdata_set_bundled_protobuf_tags) netdata_protobuf_21_tags() if(NOT USE_CXX_11) if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.3.1) netdata_protobuf_25_tags() endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang) if(CMAKE_CXX_COMP...
set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS"${_defines}"CACHEINTERNAL"CXX compiler system defined macros") elseif("${CMAKE_CXX_COMPILER_ID}"MATCHESMSVC) set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS"$ENV{INCLUDE}"CACHEINTERNAL"CXX compiler system include directories") ...
When a version file is found it is loaded to check the requested version number. The version file is loaded in a nested scope in which the following variables have been defined: PACKAGE_FIND_NAME = the <package> name PACKAGE_FIND_VERSION = full requested version string PACKAGE_FIND_VERSION_...