Skip to content

Instantly share code, notes, and snippets.

@robertmaynard
Created July 18, 2016 13:24
Show Gist options
  • Save robertmaynard/e788f040564fe4455a37d784476f7081 to your computer and use it in GitHub Desktop.
Save robertmaynard/e788f040564fe4455a37d784476f7081 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.1)
####
## Function
###
function( add_source_flags file )
set_property(
SOURCE ${file}
APPEND PROPERTY COMPILE_FLAGS "/wd4068" )
endfunction()
set( srcs main.cpp )
add_source_flags( "main.cpp" )
get_property( prop_value
SOURCE main.cpp
PROPERTY COMPILE_FLAGS )
message(STATUS "COMPILE_FLAGS on main.cpp: ${prop_value}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment