]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
use include_directories in cmake
authoradam <adam>
Tue, 5 Oct 2010 12:51:05 +0000 (12:51 +0000)
committeradam <adam>
Tue, 5 Oct 2010 12:51:05 +0000 (12:51 +0000)
salome_adm/cmake_files/am2cmake.py

index 5ee9e8e0f299a9d965137104c7cf5309d7e04325..bea3a56e3b33d00a5363bd46988139a9c7b8637e 100644 (file)
@@ -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}")
         ''')