when you don't use bundled dirs, add a fake target anyway, so you can use the same cmake syntax even if the target uses a different name
authorkoda
Fri, 14 Jun 2013 15:58:58 +0200
changeset 9233 a6ae0286787c
parent 9232 571e55b32da5
child 9234 2bf3796c5855
when you don't use bundled dirs, add a fake target anyway, so you can use the same cmake syntax even if the target uses a different name
CMakeLists.txt
--- a/CMakeLists.txt	Fri Jun 14 15:47:55 2013 +0200
+++ b/CMakeLists.txt	Fri Jun 14 15:58:58 2013 +0200
@@ -134,6 +134,9 @@
 
     if (LUA_LIBRARY AND LUA_INCLUDE_DIR)
         set(LUA_FOUND TRUE)
+        #use an IMPORTED tharget so that we can just use 'lua' to link
+        add_library(lua UNKNOWN IMPORTED)
+        set_target_properties(lua PROPERTIES IMPORTED_LOCATION ${LUA_LIBRARY})
     else()
         message(FATAL_ERROR "Missing Lua! Rerun cmake with -DLUA_SYSTEM=off to build the internal version")
     endif()
@@ -170,6 +173,10 @@
 
     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()
+        #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})
     endif()
 else()
     if (NOT PHYSFS_LIBRARY OR NOT PHYSFS_INCLUDE_DIR)