Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add this variable to link flag only if it is not empty
authornavarro <navarro@caraja.(none)>
Wed, 23 May 2012 12:51:48 +0000 (14:51 +0200)
committernavarro <navarro@caraja.(none)>
Wed, 23 May 2012 12:51:48 +0000 (14:51 +0200)
CMakeLists.txt

index 84080cb..22b34d6 100644 (file)
@@ -215,7 +215,11 @@ if(WIN32)
     endif(PEXPORTS_PATH)
 else(WIN32)
     target_link_libraries(SG_java pcre pthread simgrid)
     endif(PEXPORTS_PATH)
 else(WIN32)
     target_link_libraries(SG_java pcre pthread simgrid)
-    set_target_properties(SG_java PROPERTIES LINK_FLAGS "-L${SIMGRID_LIB_PATH} -L$ENV{SIMGRID_PCRE_LIBRARY_PATH}/lib")
+    if($ENV{SIMGRID_PCRE_LIBRARY_PATH} STREQUAL "")
+        set_target_properties(SG_java PROPERTIES LINK_FLAGS "-L${SIMGRID_LIB_PATH}")
+    elseif($ENV{SIMGRID_PCRE_LIBRARY_PATH} STREQUAL "")
+        set_target_properties(SG_java PROPERTIES LINK_FLAGS "-L${SIMGRID_LIB_PATH} -L$ENV{SIMGRID_PCRE_LIBRARY_PATH}/lib")
+    endif($ENV{SIMGRID_PCRE_LIBRARY_PATH} STREQUAL "")
 endif(WIN32)
 
 # java_classes
 endif(WIN32)
 
 # java_classes