I am new to Premake. I am using Premake 4.4 beta 5 because Premake 5 has a few issues where it does not generate proper VS2010 solutions (generates VS2012 solutions with 2010 compiler), and it setting libdirs and links for all projects when written under one project.
Anyways, the issue I am having is that I wrote a Premake script. It all works fine, but there is an annoyance where it includes multiple parent folders in common between all the files included in the project. So you have to open multiple folders containing nothing but a single folder, before you get to the meat. Here's is an image so that you understand: premake_common_parent_folders
My folder structure on disc looks something like this:
- build
- premake4.lua
- premake4.4-beta5.exe
- src
- StaticLib
- include
- Example.h
- Example.cpp
- include
- Test
- Example.cpp
- StaticLib
Here is my Premake:
_targetdir = '../bin/' .. _ACTION
local function ProjectCommon()
targetdir( _targetdir .. '/' .. project().name )
files {
'../src/' .. project().name .. '/**.*',
}
includedirs {
'../src/' .. project().name .. '/include',
}
end
solution( 'Example' )
location( _ACTION )
configurations { "Release", "Debug" }
project( 'Test' )
ProjectCommon()
language( 'C++' )
kind( 'ConsoleApp' )
includedirs {
'../src/StaticLib/include',
}
libdirs {
_targetdir .. '/StaticLib',
}
links {
solution().name,
}
project( 'StaticLib' )
ProjectCommon()
targetname( solution().name )
language( 'C++' )
kind( 'StaticLib' )
I want to know if there is a way to have the implementation files directly under the project with the single include folder. Hiding the parent folders common between all project files (src and [Project Name]).
The hope is to have it look something like this: premake_no_common_parent_folders