cmake_minimum_required(VERSION ${CMAKE_VERSION}) # CMake version check project(FindMPI) # Create project "simple_example" # Add main.cpp file of project root directory as source file set(SOURCE_FILES FindMPI) # Add executable target with source files listed in SOURCE_FILES variable add_executable(FindMPI.cmake ${SOURCE_FILES}) SET_TARGET_PROPERTIES(FindMPI.cmake PROPERTIES LINKER_LANGUAGE CXX)