cmake function examples

Signatures

function(<name> [<arg1> ...])
  <commands>
endfunction()

Examples

timi-liuliang/echo editor/Qt/5.12.3/clang_64/lib/cmake/Qt5Core/Qt5CoreMacros.cmake :192

function(_QT5_PARSE_QRC_FILE infile _out_depends _rc_depends)

tamasmeszaros/libnest2d cmake_modules/RequirePackage.cmake :266

function(rp_install_versions_file dest)

geodynamics/aspect tests/CMakeLists.txt :105

function(SHOULD_ENABLE_TEST _filename)

u3d-community/U3D cmake/Urho3D.cmake :96

function (urho_cmake_module dir module_dir)

novelrt/NovelRT cmake/NovelRTBuildSystem.cmake :20

function(NovelRTBuildSystem_DeclareModule moduleKind moduleName)

oceancx/CXEngine cmake/cotire.cmake :334

function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)

alicevision/AliceVision src/cmake/Helpers.cmake :109

function(alicevision_add_interface interface_name)

o3de/o3de cmake/LYWrappers.cmake :526

function(ly_delayed_target_link_libraries)

prusa3d/PrusaSlicer cmake/modules/PrecompiledHeader.cmake :70

function(export_all_flags _filename)

FreeCAD/FreeCAD cMake/FreeCAD_Helpers/SetupQt.cmake :101

function(qt_create_resource_file_prefix outfile)

godlikepanos/anki-3d-engine CMakeLists.txt :13

function(anki_install_executable EXE)

prusa3d/Prusa-Firmware cmake/GetGitRevisionDescription.cmake :222

function(git_describe_working_tree _var)

bambulab/BambuStudio cmake/modules/bin2h.cmake :9

function(WRAP_STRING)

tinyobjloader/tinyobjloader cmake/clang-cl-msvc-wsl.cmake :140

function(generate_winsdk_lib_symlinks winsdk_um_lib_dir output_dir)

SoftFever/OrcaSlicer cmake/modules/Catch2/Catch.cmake :96

function(catch_discover_tests TARGET)

asc-community/MxEngine cmake/project_install.cmake :1

function(install_mxengine_project EXECUTABLE_NAME)

anhttran/3dmm_basic lib/3rdParty/Eigen/cmake/language_support.cmake :22

function(workaround_9220 language language_works)

DragonJoker/Castor3D source/Interop/CMakeLists.txt :9

function( InteropInit )

cadaver/turso3d ThirdParty/SDL/cmake/macros.cmake :296

function(check_linker_supports_version_file VAR)

Hork-Engine/Hork-Source ThirdParty/SDL3/cmake/macros.cmake :113

function(win32_implib_identify_dll DEST IMPLIB)

GlPortal/RadixEngine CMakeLists.txt :21

function(radix_add_exported_definition)

STORM-IRIT/Radium-Engine cmake/RadiumSetupFunctions.cmake :942

function(configure_radium_library)

JeanPhilippeKernel/RendererEngine Scripts/CMake/NuGet.cmake :40

function(restore_nuget_packages VS_SLN_OR_PROJ)

RavEngine/RavEngine CMakeLists.txt :852

function(get_all_targets var)

cnr-isti-vclab/meshlab src/cmake/meshlab_tools.cmake :97

function(add_file_format_info_plist)

lmb-freiburg/ogn cmake/Cuda.cmake :13

function(caffe_detect_installed_gpus out_variable)

bmwcarit/ramses examples/logic/CMakeLists.txt :9

function(add_example)

zenustech/zeno projects/Audio/aquila/cmake/CodeCoverage.cmake :95

FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)

stuntrally/stuntrally3 CMakeManual/conan.cmake :40

function(_get_msvc_ide_version result)

ArnoAnsems/CatacombGL CMakeLists.txt :68

function(link_each_target_to_libs libs targets)

keith2018/SoftGLRender third_party/assimp/cmake-modules/HunterGate.cmake :65

function(hunter_gate_status_print)

GPUOpen-Drivers/pal cmake/PalPrecompiledHeaders.cmake :42

function(pal_setup_precompiled_headers)

shaduzlabs/cabl cmake-modules/sl-ext-libs.cmake :85

function (addUnmidify)

kokkos/kokkos cmake/build_env_info.cmake :102

function(check_git_setup)

alpaka-group/alpaka cmake/common.cmake :156

FUNCTION(append_recursive_files_add_to_src_group In_RootDir In_SrcGroupIgnorePrefix In_FileExtension Out_FilePathsListVariableName)

eclipse-ecal/ecal cmake/helper_functions/ecal_add_functions.cmake :24

function(ecal_add_app_console TARGET_NAME)

Ipotrick/Daxa cmake/warnings.cmake :1

function(set_project_warnings project_name)

alaingalvan/CrossWindow CMakeLists.txt :127

function(xwin_setup versionMajor versionMinor versionPatch versionRevision companyName iconPath)

LLNL/zfp python/scikit-build-cmake/FindPythonExtensions.cmake :329

function(_set_python_extension_symbol_visibility _target)

cs1ime/ceserver-rawmem thirdparty/nlohmann_json/cmake/ci.cmake :835

function(ci_get_cmake version var)

ankurhanda/SceneNetv1.0 CMakeModules/FindCUDA.cmake :798

function(CUDA_ADD_CUDA_INCLUDE_ONCE)

Nukem9/dlssg-to-fsr3 dependencies/FidelityFX-SDK/sdk/CMakeWorkaroundPatches.cmake :11

function(fixup_symbol SYM_NAME)

ElyPrismLauncher/ElyPrismLauncher cmake/ECMQueryQt.cmake :71

function(ecm_query_qt result_variable qt_variable)

OAID/Caffe-HRT cmake/ProtoBuf.cmake :34

function(caffe_protobuf_generate_cpp_py output_dir srcs_var hdrs_var python_var)

end2endzone/ShellAnything CMakeLists.txt :286

function(create_zip target_name output_file input_files working_dir)

JGRennison/OpenTTD-patches cmake/Options.cmake :7

function(set_directory_options)

BLAST-WarpX/warpx cmake/WarpXFunctions.cmake :239

function(warpx_make_third_party_includes_system imported_target propagated_name)

ThePhD/sol2 examples/interop/luwra/CMakeLists.txt :27

function (make_luwra_interop_example target_library example_suffix)

NREL/OpenStudio CMake/FindBoost.cmake :887

function(_Boost_COMPONENT_HEADERS component _hdrs)

pcb9382/FaceAlgorithm include/Eigen/cmake/language_support.cmake :22

function(workaround_9220 language language_works)

Smorodov/Multitarget-tracker thirdparty/spdlog/cmake/utils.cmake :52

function(spdlog_enable_addr_sanitizer target_name)

supercollider/supercollider cmake_modules/DeployQt5.cmake :193

function(install_qt5_plugin_path plugin executable copy installed_plugin_path_var)

Morwenn/cpp-sort cmake/Findcodecov.cmake :140

function (codecov_lang_of_source FILE RETURN_VAR)

coin-or/CppAD cmake/set_compile_flags.cmake :27

FUNCTION(set_compile_flags program_name debug_which source_list)

numenta/nupic.core-legacy external/MoveFilesToNewDir.cmake :19

function(move_files_to_new_dir GLOBBING_EXPR DEST_DIR_PATH)

stack-of-tasks/pinocchio CMakeLists.txt :466

function(ADD_WINDOWS_DLL_PATH_TO_TEST TEST_NAME)

gadomski/cpd vendor/googletest-1.14.0/googletest/cmake/internal_utils.cmake :162

function(cxx_library_with_type name type cxx_flags)

Kitware/kwiver CMake/utils/kwiver-utils-targets.cmake :332

function(kwiver_export_targets file)

RSIA-LIESMARS-WHU/LSHBOX include/eigen/cmake/RegexUtils.cmake :12

function(test_escape_string_as_regex)

SCOREC/core cmake/bob.cmake :198

function(bob_end_package)

nv-legate/legate src/cmake/Modules/debug_helpers.cmake :23

function(print_target_properties)

rheit/zdoom CreateLaunchers.cmake :280

function(create_target_launcher _targetname)

bareos/bareos cmake/BareosTargetTools.cmake :20

function(get_target_output_dir result_var target)

WerWolv/Fenestra cmake/build_helpers.cmake :3

function(message)

maidsafe-archive/MaidSafe cmake_modules/add_gtests.cmake :321

function(add_gtest_registered_typed_tests FileContents TestTarget)

CasparCG/server src/CMakeModules/Bootstrap_Windows.cmake :21

function(casparcg_add_runtime_dependency FILE_TO_COPY)

Patoke/re-plants-vs-zombies CMake/Utils.cmake :214

function(source_file_compile_options SOURCE_FILE)

MultiMC/Launcher cmake/GetPrerequisites.cmake :427

function(gp_resolved_file_type original_file file exepath dirs type_var)

PrismLauncher/PrismLauncher cmake/vcpkg-ports/vcpkg-tool-meson/vcpkg_configure_meson.cmake :405

function(vcpkg_configure_meson)

PolyMC/PolyMC cmake/GetGitRevisionDescription.cmake :86

function(get_git_head_revision _refspecvar _hashvar)

RichieSams/FiberTaskingLib cmake/AddCompilerFlags.cmake :3

function(Check_And_Add_Flag)

0xd34df00d/leechcraft src/plugins/azoth/plugins/mucommands/CMakeLists.txt :20

function (AddMuCTest _execName _cppFile _testName)

ml-explore/mlx mlx/backend/metal/kernels/CMakeLists.txt :36

function(build_kernel KERNEL)

mariadb-corporation/MaxScale cmake/install_layout.cmake :116

function(install_program file component)

JSBSim-Team/jsbsim tests/unit_tests/CMakeModules/Findcodecov.cmake :140

function (codecov_lang_of_source FILE RETURN_VAR)

gnss-sdr/gnss-sdr src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Modules/VolkPython.cmake :220

function(VOLK_UNIQUE_TARGET desc)

facebook/mvfst build/fbcode_builder/CMake/FBBuildOptions.cmake :3

function (fb_activate_static_library_option)

ByConity/ByConity cmake/sanitize_target_link_libraries.cmake :23

function (get_all_targets var)

WarmUpTill/SceneSwitcher cmake/common/advss_helpers.cmake :17

function(install_advss_lib_helper target where)

SsageParuders/Android_Native_Surface my_android_opencv/3rdparty/ffmpeg/ffmpeg.cmake :8

function(download_win_ffmpeg script_var)

ossia/score cmake/ScoreAvndHelper.cmake :11

function(avnd_score_plugin_finalize)

stp/stp cmake/modules/GetGitRevisionDescription.cmake :151

function(git_local_changes _var)

OpenKneeboard/OpenKneeboard cmake/ok_add_library.cmake :5

function(ok_add_library TARGET KIND)

chdb-io/chdb contrib/google-cloud-cpp-cmake/GoogleApis.cmake :186

function (external_googleapis_short_name var proto)

NVIDIA/MatX cmake/rapids-cmake/rapids-cmake/cpm/package_override.cmake :72

function(rapids_cpm_package_override _rapids_override_filepath)

JDAI-CV/dabnn cmake/common.cmake :3

function(treat_warnings_as_errors target)

v6d-io/v6d cmake/FindArrow.cmake :122

function(arrow_build_static_library_name output_variable base_name)

NVIDIA/DALI cmake/CUDA_utils.cmake :203

function(CUDA_move_toolkit_include_dirs_to_end)

milvus-io/knowhere thirdparty/faiss/c_api/CMakeLists.txt :36

function(faiss_install_headers headers p)

royshil/obs-backgroundremoval cmake/linux/helpers.cmake :8

function(set_target_properties_plugin target)

OpenMW/openmw cmake/WholeArchive.cmake :1

function (get_whole_archive_options OUT_VAR)

OSVR/SteamVR-OSVR cmake/CleanDirectoryList.cmake :22

function(clean_directory_list _var)

Kitware/ParaView CMake/ParaViewTesting.cmake :326

function(_get_num_servers varname)

jacob-baines/elfparser CMake/DeployQt5.cmake :252

function(install_qt5_plugin plugin executable copy installed_plugin_path_var)

scanner-research/scanner CMakeLists.txt :116

function(add_library targetName)

ukoethe/vigra config/VigraAddTest.cmake :28

FUNCTION(VIGRA_ADD_TEST target)

zeek/zeek CMakeLists.txt :351

function (zeek_include_directories)

topology-tool-kit/ttk CMake/BaseCode.cmake :10

function(ttk_add_base_library library)

DIPlib/diplib dependencies/pybind11/tools/JoinPaths.cmake :11

function(join_paths joined_path first_path_segment)

BRAINSia/BRAINSTools CMake/ExternalProjectDependency.cmake :232

function(_sb_list_to_string separator input_list output_string_var)