Remove leading . in CMAKE_EXECUTABLE_SUFFIX if it has one, but don't modify it
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 30 Jul 2017 02:11:00 +0000 (12:11 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 30 Jul 2017 02:11:00 +0000 (12:11 +1000)
CMakeLists.txt
tools/CMakeLists.txt

index 870cfef..0a242ef 100644 (file)
@@ -143,8 +143,7 @@ if (BUILD_RADIANT)
 endif ()
 
 if (CMAKE_EXECUTABLE_SUFFIX)
-    string(REGEX REPLACE "^[.]" "" CMAKE_EXECUTABLE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
-    set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
+    string(REGEX REPLACE "^[.]" "" RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX})
 else ()
     execute_process(
             COMMAND uname -m
index 94cbbe5..ad32a07 100644 (file)
@@ -2,7 +2,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
 
 macro(radiant_tool name)
     add_executable(${name} ${ARGN})
-    if (NOT (CMAKE_EXECUTABLE_SUFFIX STREQUAL RADIANT_EXECUTABLE))
+    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