add premake script to generate makefiles / IDE project files

This commit is contained in:
gered 2012-09-10 19:13:17 -04:00
parent 670889f469
commit 5f287910f1
3 changed files with 114 additions and 0 deletions

3
generate_makefile.sh Normal file
View file

@ -0,0 +1,3 @@
#!/bin/sh
type premake4 >/dev/null 2>&1 || { echo >&2 "'premake4' not found in your path."; exit 1; }
premake4 --file=premake.lua gmake

8
generate_vs2010.bat Normal file
View file

@ -0,0 +1,8 @@
@echo off
for %%X in (premake4.exe) do (set FOUND=%%~$PATH:X)
if not defined FOUND (
echo 'premake4' not found in your path.
exit /b
)
premake4 --file=premake.lua vs2010

103
premake.lua Normal file
View file

@ -0,0 +1,103 @@
-- These are only used on Windows + Visual Studio ------------------------------
ASSIMP_ROOT = "/dev/assimp"
--------------------------------------------------------------------------------
-- For Mac OSX having installed assimp via Homebrew ----------------------------
ASSIMP_OSX_INCLUDE_DIR = "/usr/local/Cellar/assimp/2.0.863/include"
ASSIMP_OSX_LIB_DIR = "/usr/local/Cellar/assimp/2.0.863/"
--------------------------------------------------------------------------------
BUILD_DIR = "build"
if _ACTION == "clean" then
os.rmdir(BUILD_DIR)
end
solution "AssimpToMesh"
configurations { "Debug", "Release" }
location (BUILD_DIR .. "/" .. _ACTION)
project "AssimpToMesh"
kind "ConsoleApp"
language "C++"
location (BUILD_DIR .. "/" .. _ACTION)
files {
"./src/**.c*",
"./src/**.h",
}
debugdir "."
---- PLATFORM SPECIFICS ----------------------------------------------------
configuration "vs*"
flags {
"NoPCH",
"NoMinimalRebuild"
}
buildoptions { "/MP" }
links {
"assimp",
}
defines {
"_CRT_SECURE_NO_WARNINGS",
"_CRT_NONSTDC_NO_WARNINGS"
}
includedirs {
(ASSIMP_ROOT .. "/include")
}
configuration { "vs*", "Debug" }
libdirs {
(ASSIMP_ROOT .. "/lib/assimp_debug-dll_win32"),
}
configuration { "vs*", "Release" }
libdirs {
(ASSIMP_ROOT .. "/lib/assimp_debug-dll_win32"),
}
configuration "gmake"
kind "ConsoleApp"
buildoptions { "-Wall" }
configuration { "windows", "gmake" }
kind "ConsoleApp"
defines {
"_GNU_SOURCE=1",
}
links {
"mingw32",
"assimp",
}
linkoptions {
"-static-libgcc",
"-static-libstdc++",
}
configuration "macosx"
links {
"assimp",
}
includedirs {
ASSIMP_OSX_INCLUDE_DIR,
}
libdirs {
ASSIMP_OSX_LIB_DIR,
}
configuration "linux"
links {
"assimp",
}
----------------------------------------------------------------------------
configuration "Debug"
defines {
"DEBUG",
"DEBUG_ASSERT_BREAK",
}
flags { "Symbols" }
configuration "Release"
defines {
"NDEBUG",
}
flags { "Optimize" }