https://github.com/Kitware/CMake
Raw File
Tip revision: 66ba460810afdc0e0f65c20b1bc057a204acc82c authored by Brad King on 18 March 2022, 12:26:30 UTC
CMake 3.23.0-rc4
Tip revision: 66ba460
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