[cmake] Add EXTRA_COMPILE_FLAGS to samples & unitTests

Add the additional compiler flags added by -DEXIV2_TEAM_EXTRA_WARNINGS=ON to
the targets in samples/ & unitTests/
This fixes #204
This commit is contained in:
Dan Čermák 2018-03-29 11:20:21 +02:00 committed by D4N
parent 1e016f82e7
commit 8b7941b733
2 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,8 @@ set( SAMPLES
foreach(entry ${SAMPLES})
string( REPLACE ".cpp" "" target ${entry})
add_executable( ${target} ${target}.cpp )
set_target_properties(${target} PROPERTIES
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS})
list(APPEND APPLICATIONS ${target})
add_test( ${target}_test ${target} )
target_link_libraries( ${target} PRIVATE exiv2lib)

View File

@ -24,3 +24,7 @@ target_compile_definitions(unit_tests
PRIVATE
GTEST_LINKED_AS_SHARED_LIBRARY=1
)
set_target_properties( unit_tests PROPERTIES
COMPILE_FLAGS ${EXTRA_COMPILE_FLAGS}
)