From e6229d91285224007640656a414b2c93d3ef1e29 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 5 Oct 2010 12:51:05 +0000 Subject: [PATCH] use include_directories in cmake --- salome_adm/cmake_files/am2cmake.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 5ee9e8e0f..bea3a56e3 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -1518,7 +1518,22 @@ class CMakeFile(object): SET(f) ENDIF(f STREQUAL v) ENDFOREACH(v ${vars}) + string(REGEX MATCH "^-I" test_include ${f}) + if(test_include) + string(REGEX REPLACE "^-I" "" include_dir ${f}) + if(include_dir) + if(include_dir STREQUAL /usr/include) + else(include_dir STREQUAL /usr/include) + string(REGEX MATCH "^\\." test_dot ${include_dir}) + if(test_dot) + set(include_dir ${CMAKE_CURRENT_BINARY_DIR}/${include_dir}) + endif(test_dot) + include_directories(${include_dir}) + endif(include_dir STREQUAL /usr/include) + endif(include_dir) + else(test_include) SET(flags "${flags} ${f}") + endif(test_include) ENDFOREACH(f ${var}) SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") ''') -- 2.39.2