fix linking physfs after a run of cmake
authorkoda
Fri, 17 Jan 2014 18:04:49 +0100
changeset 10007 c28e4db7cca9
parent 10006 921e7b71330f
child 10008 b8b91c7e0da8
fix linking physfs after a run of cmake
CMakeLists.txt
--- a/CMakeLists.txt	Fri Jan 17 16:50:01 2014 +0100
+++ b/CMakeLists.txt	Fri Jan 17 18:04:49 2014 +0100
@@ -163,12 +163,13 @@
         endif()
     endif()
 
-    if(NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)
-        message(FATAL_ERROR "Missing PhysFS! Rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version")
-    else()
+    if(PHYSFS_LIBRARY AND PHYSFS_INCLUDE_DIR)
+        set(PHYSFS_FOUND TRUE)
         #use an IMPORTED tharget so that we can just use 'physfs' to link
         add_library(physfs UNKNOWN IMPORTED)
         set_target_properties(physfs PROPERTIES IMPORTED_LOCATION ${PHYSFS_LIBRARY})
+    else()
+        message(FATAL_ERROR "Missing PhysFS! Rerun cmake with -DPHYSFS_SYSTEM=off to build the internal version")
     endif()
 else()
     if(NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)