From 5f287910f1017b805e92e61363aa6b8c9daefeff Mon Sep 17 00:00:00 2001 From: gered Date: Mon, 10 Sep 2012 19:13:17 -0400 Subject: [PATCH] add premake script to generate makefiles / IDE project files --- generate_makefile.sh | 3 ++ generate_vs2010.bat | 8 ++++ premake.lua | 103 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 generate_makefile.sh create mode 100644 generate_vs2010.bat create mode 100644 premake.lua diff --git a/generate_makefile.sh b/generate_makefile.sh new file mode 100644 index 0000000..33d7a29 --- /dev/null +++ b/generate_makefile.sh @@ -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 diff --git a/generate_vs2010.bat b/generate_vs2010.bat new file mode 100644 index 0000000..9538990 --- /dev/null +++ b/generate_vs2010.bat @@ -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 diff --git a/premake.lua b/premake.lua new file mode 100644 index 0000000..41d314d --- /dev/null +++ b/premake.lua @@ -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" }