1. Cmake_parse_arguments Parse_argv
  2. Cmake Function Optional Argument

Hello everyone,


Cmake_parse_arguments Parse_argv

Summary: Use CMake's cmakeparsearguments instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same.

  • New for CMake 3.15, when using cmakeparsearguments , the KEYWORDSMISSINGVALUES variable can be used to detect single or multi-value keywords that were not given any values. Highlighted that functions receive a copy of all variables from the calling scope.
  • CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.
  • One of the most important command for functions is cmakeparsearguments A full list of all commands can be found here. Exercise 7 Implement these functions, so that the CMake files can be written as follows.

I’m running into issues trying to compile a Windows UMDF driver using CMake version 3.18+. More specifically, I am able to compile, but run into a strange ZERO_CHECK error that causes the build to fail.

Cmake Function Optional Argument

Within my CMakeLists.txt, I call a helper method wdk_add_library(), which looks as follows:


I’m basing this off of a FindWDK.cmake module created here, which has been used for KMDF driver purposes. I have changed stuff around to detect the associated UMDF libraries and includes, rather than the KMDF ones.

I am calling wdk_add_library() with a SHARED type, as Windows UMDF drivers are DLLs.

The source files of my driver don’t seem to be the issue here - they compile fine and can be properly used in a template UMDF Visual Studio project. The issue occurs when ZERO_CHECK is called (after compilation):

I have spent a bit of time looking for this target definition in other solution files, as well as references to it on search engines (hoping it would be a known/expected target in a Visual Studio vcxproj). However, I haven’t been able to find it quite yet.

I should note that the issue disappears if I build my library as a STATIC one. However, I don’t believe I can really move forward at that stage, as the rest of the driver process expects a dll.

Is anyone familiar with building UMDF drivers using CMake able to point out what I am doing wrong? I’m sorry if this is quite obvious!

Thank you,