diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # ChangeLog for file-embed
 
+## 0.0.15.0
+
+* Add `makeRelativeToLocationPredicate`
+
 ## 0.0.14.0
 
 * Add `embedFileIfExists`
diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
--- a/Data/FileEmbed.hs
+++ b/Data/FileEmbed.hs
@@ -39,6 +39,7 @@
     , injectFileWith
       -- * Relative path manipulation
     , makeRelativeToProject
+    , makeRelativeToLocationPredicate
       -- * Internal
     , stringToBs
     , bsToExp
@@ -408,7 +409,19 @@
 --
 -- @since 0.0.10
 makeRelativeToProject :: FilePath -> Q FilePath
-makeRelativeToProject rel = do
+makeRelativeToProject = makeRelativeToLocationPredicate $ (==) ".cabal" . takeExtension
+
+-- | Take a predicate to infer the project root and a relative file path, the given file path is then attached to the inferred project root
+--
+-- This function looks at the source location of the Haskell file calling it,
+-- finds the first parent directory with a file matching the given predicate, and uses that as the
+-- root directory for fixing the relative path.
+--
+-- @$(makeRelativeToLocationPredicate ((==) ".cabal" . takeExtension) "data/foo.txt" >>= embedFile)@
+--
+-- @since 0.0.15.0
+makeRelativeToLocationPredicate :: (FilePath -> Bool) -> FilePath -> Q FilePath
+makeRelativeToLocationPredicate isTargetFile rel = do
     loc <- qLocation
     runIO $ do
         srcFP <- canonicalizePath $ loc_filename loc
@@ -423,8 +436,6 @@
             then return Nothing
             else do
                 contents <- getDirectoryContents dir
-                if any isCabalFile contents
+                if any isTargetFile contents
                     then return (Just dir)
                     else findProjectDir dir
-
-    isCabalFile fp = takeExtension fp == ".cabal"
diff --git a/file-embed.cabal b/file-embed.cabal
--- a/file-embed.cabal
+++ b/file-embed.cabal
@@ -1,6 +1,6 @@
 name:            file-embed
-version:         0.0.14.0
-license:         BSD3
+version:         0.0.15.0
+license:         BSD2
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
 maintainer:      Michael Snoyman <michael@snoyman.com>
