--Add command line option for running premake with this script: -- Use: --name "MyProject" to name the project, defaults to: ludumdare32 newoption { trigger = "name", description = "Chosen project name.", value = "ludumdare32", } if not _OPTIONS["name"] then _OPTIONS["name"] = "ludumdare32" end --Documented at: http://industriousone.com/osget local WINDOWS_SYSTEM_NAME = "windows" local LINUX_SYSTEM_NAME = "linux" local MACOSX_SYSTEM_NAME = "macosx" local SYSTEM_NAME = os.get() local PROJECT_NAME = _OPTIONS["name"] if _ACTION == "clean" then os.rmdir("../build/" .. WINDOWS_SYSTEM_NAME) os.rmdir("../build/" .. LINUX_SYSTEM_NAME) os.rmdir("../build/" .. MACOSX_SYSTEM_NAME) end solution(PROJECT_NAME) location ("../build/" .. SYSTEM_NAME) configurations { "debug", "release" } project (PROJECT_NAME) location ("../build/" .. SYSTEM_NAME) language ("C++") kind ("WindowedApp") files { "../source/**.h", "../source/**.cpp", "../source/**.mm", "../source/**.c" } excludes { "../**/doxygen/**" } if (WINDOWS_SYSTEM_NAME ~= SYSTEM_NAME) then excludes { "../**/windows/**" } end if (LINUX_SYSTEM_NAME ~= SYSTEM_NAME) then excludes { "../**/linux/**" } end if (MACOSX_SYSTEM_NAME ~= SYSTEM_NAME) then excludes { "../**/mac/**" } end if (WINDOWS_SYSTEM_NAME == SYSTEM_NAME) then libdirs { --"../build/libraries/glew/lib/Release/Win32", "../tb_external_libraries/libraries/msvc/x32" } defines { "_WINDOWS", "WIN32", "tb_windows", "tb_visual_cpp" } --links { "OpenGL32", "glew32" } links { "OpenGL32", "OpenAL32" } end if (MACOSX_SYSTEM_NAME == SYSTEM_NAME) then buildoptions "-stdlib=libc++" linkoptions "-stdlib=libc++" defines { "tb_macosx" } links { "AppKit.framework", "OpenGL.framework", "OpenAL.framework" } end includedirs { --"../build/libraries/glew/include/GL", "../tb_external_libraries/includes/" } configuration "debug*" targetdir ("../build/" .. SYSTEM_NAME .. "/debug") defines { "_DEBUG", "DEBUG" } flags { "Symbols", } debugdir "../run" --debugargs { "--nosplash", "--other" } --postbuildcommands { "../Tools/auto/postbuilddbg.bat" } configuration "release*" targetdir ("../build/" .. SYSTEM_NAME .. "/release") defines { "NDEBUG" } flags { "Optimize", } debugdir "../run" --debugargs { "--nosplash", "--other" } --postbuildcommands { "../Tools/auto/postbuild.bat" }