diff options
author | Michael Dickens <michael.dickens@ettus.com> | 2017-08-27 20:07:19 -0400 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2017-08-27 20:07:19 -0400 |
commit | 4ce146b798771847c1dd955b2ab449a6a4d1ddbf (patch) | |
tree | 6346c883768603e7ec521110ddd45ea7306102a1 /cmake | |
parent | 2b844b6c948e51b3db00b81988724ee015bda80d (diff) |
cmake: fix overloaded include_directories to work with CMake < 3.2.
"continue()" was introduced in CMake 3.2, which was released on March
11, 2015, which really wasn't that long ago. Remove use of this
command to provide backward compatibility beyond 3.2.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/CMakeOverloads.cmake | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/cmake/Modules/CMakeOverloads.cmake b/cmake/Modules/CMakeOverloads.cmake index 04fc777a9f..450d44c95a 100644 --- a/cmake/Modules/CMakeOverloads.cmake +++ b/cmake/Modules/CMakeOverloads.cmake @@ -44,27 +44,26 @@ macro(INCLUDE_DIRECTORIES) # is this dir the literal string "BEFORE" or "AFTER"? string(FIND ${inc_dir} BEFORE IS_BEFORE) string(FIND ${inc_dir} AFTER IS_AFTER) - if(${IS_BEFORE} EQUAL 0 OR ${IS_AFTER} EQUAL 0) - # yes: ignore it - continue() - endif() + if(NOT ${IS_BEFORE} EQUAL 0 AND NOT ${IS_AFTER} EQUAL 0) - # get absolute path of this include directory - get_filename_component(inc_dir_abs ${inc_dir} ABSOLUTE) + # not "BEFORE" or "AFTER"; a real directory. + # get absolute path of this include directory + get_filename_component(inc_dir_abs ${inc_dir} ABSOLUTE) - # is this include directory located within the SOURCE or BUILD? - string(FIND ${inc_dir_abs} ${CMAKE_SOURCE_DIR} IS_IN_SOURCE) - string(FIND ${inc_dir_abs} ${CMAKE_BINARY_DIR} IS_IN_BINARY) - if(${IS_IN_SOURCE} EQUAL 0 OR ${IS_IN_BINARY} EQUAL 0) - # yes: local SOURCE or BINARY; internal. - # call the overloaded INCLUDE_DIRECTORIES, - # prepending this internal directory. - _include_directories(BEFORE ${inc_dir_abs}) - else() - # no: not SOURCE or BUILD; must be external. - # call the overloaded INCLUDE_DIRECTORIES, - # appending this external directory. - _include_directories(AFTER ${inc_dir_abs}) + # is this include directory located within the SOURCE or BUILD? + string(FIND ${inc_dir_abs} ${CMAKE_SOURCE_DIR} IS_IN_SOURCE) + string(FIND ${inc_dir_abs} ${CMAKE_BINARY_DIR} IS_IN_BINARY) + if(${IS_IN_SOURCE} EQUAL 0 OR ${IS_IN_BINARY} EQUAL 0) + # yes: local SOURCE or BINARY; internal. + # call the overloaded INCLUDE_DIRECTORIES, + # prepending this internal directory. + _include_directories(BEFORE ${inc_dir_abs}) + else() + # no: not SOURCE or BUILD; must be external. + # call the overloaded INCLUDE_DIRECTORIES, + # appending this external directory. + _include_directories(AFTER ${inc_dir_abs}) + endif() endif() endforeach() endmacro(INCLUDE_DIRECTORIES) |