There are many resources, posts and articles about using cmake and writing modern cmake code. Unfortunately for a new user it is sometimes difficult to locate the proper resource that contains no deprecated options or any other non-recommended practices. One of the quickest and simplest resource I became aware recently is the official tutorial that lives in the documentation of cmake.