CMake/Tests/ForceInclude/CMakeLists.txt
Ben Boeckel 29c3edb87a Avoid if() quoted auto-dereference
When testing CMAKE_<LANG>_COMPILER_ID values, do not explicitly
dereference or quote the variable. We want if() to auto-dereference the
variable and not its value. Also replace MATCHES with STREQUAL where
equivalent.
2014-10-20 11:49:16 -04:00

11 lines
357 B
CMake

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")