Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Restructuration of file CompleteInFiles.
[simgrid.git] / buildtools / Cmake / Modules / FindGTnets.cmake
index 9bb9e48..8a73343 100644 (file)
@@ -47,8 +47,16 @@ else(HAVE_GTNETS_LIB AND HAVE_GTNETS)
 message(STATUS "Looking for lib gtnets patch - not found")
 endif(HAVE_GTNETS_LIB AND HAVE_GTNETS)
 
-#TODO NEED TO TEST IF PATHS ARE ALREADY SET BY CMAKE
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_RNGSTREAM_H} -L${GTNETS_LIB_PATH} ")
+string(REGEX MATCH "-L${GTNETS_LIB_PATH} " operation "${CMAKE_C_FLAGS}")
+if(NOT operation)
+       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${GTNETS_LIB_PATH} ")
+endif(NOT operation)
+
+string(REGEX MATCH "-I${HAVE_RNGSTREAM_H} " operation "${CMAKE_C_FLAGS}")
+if(NOT operation)
+       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_RNGSTREAM_H} ")
+endif(NOT operation)
+
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_RNGSTREAM_H} -L${GTNETS_LIB_PATH} ")
 string(REGEX MATCH "${GTNETS_LIB_PATH}" operation "$ENV{LD_LIBRARY_PATH}")
 if(NOT operation)