#-----------------------------------------------------------------------
if (BUILD_BINARIES)
- if (CMAKE_EXECUTABLE_SUFFIX)
- string(REGEX REPLACE "^[.]" "" RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
- endif ()
-
macro (radiant_tool name)
add_dependencies(binaries ${name})
if (BUILD_RADIANT)
add_subdirectory(radiant)
- set_target_properties(${RADIANT_BASENAME} PROPERTIES
- COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}"
- )
endif ()
endif ()
RADIANT_VERSION = $(RADIANT_VERSION_NUMBER)n
Q3MAP_VERSION = 2.5.17n
-# Executable extension
-RADIANT_EXECUTABLE := $(EXE)
-
GIT_VERSION := $(shell $(GIT) rev-parse --short HEAD $(STDERR_TO_DEVNULL))
ifneq ($(GIT_VERSION),)
RADIANT_VERSION := $(RADIANT_VERSION)-git-$(GIT_VERSION)
Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION)
endif
-CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_VERSION_STRING="\"$(RADIANT_VERSION_STRING)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DRADIANT_NAME="\"${RADIANT_NAME}\"" -DRADIANT_BASENAME="\"${RADIANT_BASENAME}\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""
+CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_VERSION_STRING="\"$(RADIANT_VERSION_STRING)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DRADIANT_NAME="\"${RADIANT_NAME}\"" -DRADIANT_BASENAME="\"${RADIANT_BASENAME}\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\""
CPPFLAGS += -DGTK_TARGET=2
.PHONY: all
#define GDEF_OS_XDG 0
#endif
+// EXECUTABLE EXTENSION
+
+#if GDEF_OS_WINDOWS
+#define GDEF_OS_EXE_EXT ".exe"
+#else
+#define GDEF_OS_EXE_EXT ""
+#endif
+
// COMPILER
#if defined(_MSC_VER)
m_string = string;
}
void evaluate( StringBuffer& output ){
- #if !(GDEF_OS_WINDOWS)
- // strip .[ExecutableType] entirely (including preceding dot) on Mac and Linux
+ // replace ".[ExecutableType]" with "[ExecutableExt]"
{
StringBuffer output;
const char *pattern = ".[ExecutableType]";
{
if ( strncmp( pattern, i, sizeof( pattern ) ) == 0 )
{
- output.push_string("");
+ output.push_string("[ExecutableExt]");
i += strlen( pattern ) - 1;
}
else
}
setString(output.c_str());
}
- #endif // !(GDEF_OS_WINDOWS)
StringBuffer variable;
bool in_variable = false;
StringBuffer output;
output.push_string( AppPath_get() );
output.push_string( "q3map2" );
-
- #if GDEF_OS_WINDOWS
- output.push_string( "." );
- output.push_string( RADIANT_EXECUTABLE );
- #endif // GDEF_OS_WINDOWS
+ output.push_string( GDEF_OS_EXE_EXT );
output.push_string( " -v -game " );
output.push_string( ( type && *type ) ? type : "quake3" );
}
void bsp_init(){
+ // this is expected to not be used since
+ // ".[ExecutableType]" is replaced by "[ExecutableExt]"
+ const char *exe_ext = GDEF_OS_EXE_EXT;
+ build_set_variable( "ExecutableType", exe_ext[0] == '\0' ? exe_ext : exe_ext + 1 );
+
+ build_set_variable( "ExecutableExt", GDEF_OS_EXE_EXT );
build_set_variable( "RadiantPath", AppPath_get() );
-
- #if GDEF_OS_WINDOWS
- build_set_variable( "ExecutableType", RADIANT_EXECUTABLE );
- #endif // GDEF_OS_WINDOWS
-
build_set_variable( "EnginePath", EnginePath_get() );
build_set_variable( "UserEnginePath", g_qeglobals.m_userEnginePath.c_str() );
+
build_set_variable( "MonitorAddress", ( g_WatchBSP_Enabled ) ? "127.0.0.1:39000" : "" );
+
build_set_variable( "GameName", gamename_get() );
StringBuffer ExtraQ3map2Args;