)
endif()
-if(WIN32)
- set(RADIANT_EXECUTABLE "exe")
+if(CMAKE_EXECUTABLE_SUFFIX)
+ set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
else()
execute_process(COMMAND uname -m
OUTPUT_VARIABLE RADIANT_EXECUTABLE OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
-set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
+set(RADIANT_ABOUTMSG "Custom build" CACHE STRING "About message")
message(STATUS "Building ${PROJECT_NAME} ${RADIANT_VERSION_STRING} ${RADIANT_ABOUTMSG}")
/// \brief A wrapper around a STL vector of char.
/// Maintains a null-terminated array of char.
/// Provides a limited STL-style interface to push and pop characters at the end of the string.
+/// \todo That vector<char> must become a std::string, and not NUL terminated. Maybe the whole class can be replaced by std::string
class StringBuffer
{
std::vector<char> m_string;
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
+macro(radiant_tool name)
+ add_executable(${name} ${ARGN})
+ if(NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL RADIANT_EXECUTABLE))
+ add_custom_command(TARGET ${name} POST_BUILD
+ COMMAND ln -f -s -T "$<TARGET_FILE_NAME:${name}>" "${CMAKE_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}"
+ VERBATIM
+ )
+ endif()
+endmacro()
+
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.c.in" "${CMAKE_BINARY_DIR}/version.c")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(quake3)
find_package(LibXml2 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
-add_executable(q2map EXCLUDE_FROM_ALL
+radiant_tool(q2map EXCLUDE_FROM_ALL
common/bspfile.c
common/bspfile.h
common/cmdlib.c
l_net
)
-add_executable(qdata3 EXCLUDE_FROM_ALL
+radiant_tool(qdata3 EXCLUDE_FROM_ALL
common/bspfile.c
common/bspfile.h
common/cmdlib.c
)
# Why is the /common stuff duplicated for qdata_heretic2?
-add_executable(h2data EXCLUDE_FROM_ALL
+radiant_tool(h2data EXCLUDE_FROM_ALL
qdata_heretic2/common/bspfile.c
qdata_heretic2/common/bspfile.h
qdata_heretic2/common/cmdlib.c
find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIRS})
-add_executable(q3map2
+radiant_tool(q3map2
common/cmdlib.c
common/cmdlib.h
common/imagelib.c
picomodel
)
-add_executable(q3data
+radiant_tool(q3data
common/aselib.c
common/aselib.h
common/bspfile.c