CMakeLists.txt 357 B

12345678910
  1. cmake_minimum_required(VERSION 2.8.3.20110103)
  2. project(ForceInclude C)
  3. # Make sure the proper compiler is in use.
  4. if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
  5. message(FATAL_ERROR "The ForceInclude test works only with MSVC or Intel")
  6. endif()
  7. add_executable(foo foo.c)
  8. set_property(SOURCE foo.c PROPERTY COMPILE_FLAGS "/FIfoo1.h /FIfoo2.h")