From: adam Date: Tue, 5 Oct 2010 12:51:05 +0000 (+0000) Subject: use include_directories in cmake X-Git-Tag: V5_1_5rc1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e6229d91285224007640656a414b2c93d3ef1e29;p=modules%2Fkernel.git use include_directories in cmake --- 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}") ''')