https://github.com/Kitware/CMake
Raw File
Tip revision: 5b39465ff1eaf8fa5be072cb6a52f53aa1e599a8 authored by Brad King on 08 June 2023, 15:10:11 UTC
CMake 3.27.0-rc1
Tip revision: 5b39465
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.3.20110103)
project(ForceInclude C)

# Make sure the proper compiler is in use.
if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
  message(FATAL_ERROR "The ForceInclude test works only with MSVC or Intel")
endif()

add_executable(foo foo.c)
set_property(SOURCE foo.c PROPERTY COMPILE_FLAGS "/FIfoo1.h /FIfoo2.h")
back to top