mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-30 08:24:05 +00:00
cmake: Generate Revision.h in the build directory
This commit is contained in:
parent
727639c8ba
commit
9d0e92a10d
|
@ -11,22 +11,25 @@ option(ANDROID "Set to ON if targeting an Android device" ${ANDROID})
|
||||||
option(GL_PROFILE "Set to ON to turn on GL profiling" ${GL_PROFILE})
|
option(GL_PROFILE "Set to ON to turn on GL profiling" ${GL_PROFILE})
|
||||||
|
|
||||||
# run script to generate Revision.h
|
# run script to generate Revision.h
|
||||||
set(PATH_REVISION "Revision.h")
|
set(PATH_REVISION "${CMAKE_CURRENT_BINARY_DIR}/inc/Revision.h")
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
|
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${PATH_REVISION}
|
OUTPUT ${PATH_REVISION}
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/getRevision.sh
|
COMMAND
|
||||||
|
OUTPUT=${PATH_REVISION} ${CMAKE_SOURCE_DIR}/getRevision.sh
|
||||||
COMMENT "Generate Git version"
|
COMMENT "Generate Git version"
|
||||||
)
|
)
|
||||||
else(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
|
else(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${PATH_REVISION}
|
OUTPUT ${PATH_REVISION}
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/getRevision.sh --nogit
|
COMMAND
|
||||||
|
OUTPUT=${PATH_REVISION} ${CMAKE_SOURCE_DIR}/getRevision.sh --nogit
|
||||||
COMMENT "Generate version"
|
COMMENT "Generate version"
|
||||||
)
|
)
|
||||||
endif(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
|
endif(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/../.git")
|
||||||
set_property(SOURCE ${PATH_REVISION} PROPERTY SKIP_AUTOGEN ON)
|
set_property(SOURCE ${PATH_REVISION} PROPERTY SKIP_AUTOGEN ON)
|
||||||
|
include_directories("${CMAKE_CURRENT_BINARY_DIR}/inc")
|
||||||
|
|
||||||
project( GLideN64 )
|
project( GLideN64 )
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <Revision.h>
|
||||||
#include "assert.h"
|
#include "assert.h"
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "GLideN64.h"
|
#include "GLideN64.h"
|
||||||
#include "Revision.h"
|
|
||||||
#include "RSP.h"
|
#include "RSP.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "Combiner.h"
|
#include "Combiner.h"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "Revision.h"
|
#include <Revision.h>
|
||||||
char pluginName[] = "GLideN64";
|
char pluginName[] = "GLideN64";
|
||||||
char pluginNameWithRevision[] = "GLideN64 rev." PLUGIN_REVISION;
|
char pluginNameWithRevision[] = "GLideN64 rev." PLUGIN_REVISION;
|
||||||
wchar_t pluginNameW[] = L"GLideN64";
|
wchar_t pluginNameW[] = L"GLideN64";
|
||||||
|
|
|
@ -4,7 +4,7 @@ set -eu
|
||||||
|
|
||||||
cd -- "$(cd -- "${0%/*}/" && pwd -P)"
|
cd -- "$(cd -- "${0%/*}/" && pwd -P)"
|
||||||
|
|
||||||
header='./Revision.h'
|
header="${OUTPUT:-./Revision.h}"
|
||||||
|
|
||||||
if [ "${1:-}" != --nogit ]
|
if [ "${1:-}" != --nogit ]
|
||||||
then
|
then
|
||||||
|
@ -23,6 +23,7 @@ printf '%s\n' "current revision $rev" "last build revision $lastrev"
|
||||||
|
|
||||||
if [ "$lastrev" != "$rev" ]
|
if [ "$lastrev" != "$rev" ]
|
||||||
then
|
then
|
||||||
|
[ "$header" = "${header##*/}" ] || mkdir -p -- "${header%/*}"
|
||||||
printf '%s\n' "#define PLUGIN_REVISION $rev" \
|
printf '%s\n' "#define PLUGIN_REVISION $rev" \
|
||||||
"#define PLUGIN_REVISION_W L$rev" > "$header"
|
"#define PLUGIN_REVISION_W L$rev" > "$header"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include "../GLideN64.h"
|
#include "../GLideN64.h"
|
||||||
#include "../GLideNUI/GLideNUI.h"
|
#include "../GLideNUI/GLideNUI.h"
|
||||||
#include "../Config.h"
|
#include "../Config.h"
|
||||||
#include "../Revision.h"
|
|
||||||
#include <DisplayWindow.h>
|
#include <DisplayWindow.h>
|
||||||
|
#include <Revision.h>
|
||||||
|
|
||||||
void PluginAPI::DllAbout(/*HWND _hParent*/)
|
void PluginAPI::DllAbout(/*HWND _hParent*/)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user