Skip to content

Commit dc82923

Browse files
committed
support cmake 2.8.7 since that's what travis-ci uses
1 parent aa967b3 commit dc82923

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/cpp/schema_specific/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ function(add_schema_dependent_test name sdai_lib exe_args )
4141
message(STATUS "include dir for ${sdai_lib}: ${sdai_src_path}")
4242
add_executable(tst_${name} "${name}.cc")
4343
set_target_properties(tst_${name} PROPERTIES EXCLUDE_FROM_ALL ON)
44-
set_property(TARGET tst_${name} APPEND PROPERTY INCLUDE_DIRECTORIES ${sdai_src_path} ${ARGV3} )
44+
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.7")
45+
# INCLUDE_DIRECTORIES property added in cmake 2.8.8
46+
set_property(TARGET tst_${name} APPEND PROPERTY INCLUDE_DIRECTORIES ${sdai_src_path} ${ARGV3})
47+
else()
48+
foreach(ipath ${sdai_src_path} ${ARGV3})
49+
set_property(TARGET tst_${name} APPEND PROPERTY COMPILE_FLAGS "-I${ipath}")
50+
endforeach(ipath ${sdai_src_path} ${ARGV3})
51+
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.7")
4552
if(NOT ${ARGV4} STREQUAL "")
4653
set_property(TARGET tst_${name} APPEND PROPERTY COMPILE_FLAGS ${ARGV4} )
4754
endif(NOT ${ARGV4} STREQUAL "")

0 commit comments

Comments
 (0)