# Radiant
#-----------------------------------------------------------------------
-if (BUILD_RADIANT)
- add_subdirectory(radiant build)
-endif ()
-
if (CMAKE_EXECUTABLE_SUFFIX)
string(REGEX REPLACE "^[.]" "" RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
else ()
)
endif ()
+macro(radiant_tool name)
+ add_executable(${name} ${ARGN})
+ install(
+ TARGETS ${name}
+ RUNTIME DESTINATION .
+ )
+ if (NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL ".${RADIANT_EXECUTABLE}"))
+ add_custom_command(TARGET ${name} POST_BUILD
+ COMMAND ln -f -s "$<TARGET_FILE_NAME:${name}>" "${PROJECT_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}"
+ VERBATIM
+ )
+ install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \
+ ${name}${CMAKE_EXECUTABLE_SUFFIX} \
+ ${CMAKE_INSTALL_PREFIX}/${name}.${RADIANT_EXECUTABLE} \
+ )")
+ endif ()
+endmacro()
+
if (BUILD_RADIANT)
+ add_subdirectory(radiant build)
set_target_properties(radiant PROPERTIES
COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}"
)
list(APPEND RADIANTLIST multimon.cpp multimon.h)
endif()
-add_executable(radiant WIN32 radiant.rc ${RADIANTLIST})
+radiant_tool(radiant WIN32 radiant.rc ${RADIANTLIST})
target_link_libraries(radiant
${CMAKE_DL_LIBS}
${LIBXML2_LIBRARIES}
endif ()
copy_dlls(radiant)
-
-install(
- TARGETS radiant
- RUNTIME DESTINATION .
-)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_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 "$<TARGET_FILE_NAME:${name}>" "${PROJECT_BINARY_DIR}/${name}.${RADIANT_EXECUTABLE}"
- VERBATIM
- )
- endif ()
-endmacro()
-
add_subdirectory(quake3)