https://github.com/Kitware/CMake
Raw File
Tip revision: 26a0e200e5f4abe8268235c9fdb23a2612a1b3b1 authored by Brad King on 04 September 2019, 13:50:07 UTC
CMake 3.15.3
Tip revision: 26a0e20
CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(SourceFileProperty C)

set(sources)

if (EXISTS icasetest.c)
  # If a file exists by this name, use it.
  set_source_files_properties(icasetest.c
    PROPERTIES
      COMPILE_FLAGS -DNEEDED_TO_WORK)
else ()
  # Work on case-sensitive file systems as well.
  set_source_files_properties(main.c
    PROPERTIES
      COMPILE_FLAGS -DNO_NEED_TO_CALL)
endif ()
list(APPEND sources ICaseTest.c)

add_executable(SourceFileProperty main.c ${sources})
back to top