premake

include path not detected when running premake


I am trying to include yaml-cpp path into my project but when I run the premake script, I am getting the error:

Error: cannot open TurboGE/vendor/yaml-cpp: No such file or directory

My premake.lua file for main project (relevent parts):

workspace "TurboGE"
...

IncludeDir = {}
IncludeDir["Imgui"] = "TurboGE/vendor/imgui"
IncludeDir["yamlcpp"] = "TurboGE/vendor/yaml-cpp/include"

    group "Dependencies"
        include "TurboGE/vendor/imgui"
        include "TurboGE/vendor/yaml-cpp"
    group ""


project "TurboGE"
    location "TurboGE"

    includedirs
        {
            "%{IncludeDir.Imgui}",
            "%{IncludeDir.yamlcpp}"
        }
    
        links
        {
            "Imgui",
            "yaml-cpp"
        }

The include for imgui is working fine.

yaml-cpp premake.lua:

project "yaml-cpp"
    kind "StaticLib"
    language "C++"
    cppdialect "C++17"
    staticruntime "on"

    targetdir ("bin/" .. outputdir .. "/%{prj.name}")
    objdir ("bin-int/" .. outputdir .. "/%{prj.name}")

    files
    {
        "src/**.h",
        "src/**.cpp",
        "include/**.h"
    }

    includedirs
    {
        "include"
    }

    filter "system:windows"
        systemversion "latest"

    filter "system:linux"
        pic "On"
        systemversion "latest"

    filter "configurations:Debug"
        runtime "Debug"
        symbols "on"

    filter "configurations:Release"
        runtime "Release"
        optimize "on"
        

My Directory structure:

root(running premake script here) - TurboGE - vendor - imgui
                                                     | 
                                                     - yaml-cpp

I have been looking at it for hours but could not find out why this is happening. I am not sure if it is due to some folder permission issue either. Thanks.


Solution

  • Issue is because my yaml-cpp premake file was named as premake.lua instead of premake5.lua.

    The error message is nowhere related to the actual issue :)