tunabrain / tungsten

High performance physically based renderer in C++11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to change the name of "editor"?

chaosink opened this issue · comments

On Linux, git sometimes calls command editor(vim in my OS) to show some information. If I add Tungsten's binaries directory to PATH, Tungsten's editor will be called instead.

Maybe this name is too common.

Try this patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4bea18..938bea0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,18 +185,18 @@ if (OPENGL_FOUND AND Qt5Widgets_FOUND)
     if (APPLE)
         list(APPEND Editor_SOURCES "src/editor/CoreProfileAttributes.mm")
     endif()
-    add_executable(editor ${Editor_SOURCES} src/editor/resources/Tungsten.rc)
-    set_target_properties(editor PROPERTIES AUTOMOC TRUE)
-    qt5_use_modules(editor Widgets OpenGL)
-    target_link_libraries(editor ${core_libs} ${opengl_libs} Qt5::Widgets Qt5::OpenGL)
+    add_executable(tungsten_editor ${Editor_SOURCES} src/editor/resources/Tungsten.rc)
+    set_target_properties(tungsten_editor PROPERTIES AUTOMOC TRUE)
+    qt5_use_modules(tungsten_editor Widgets OpenGL)
+    target_link_libraries(tungsten_editor ${core_libs} ${opengl_libs} Qt5::Widgets Qt5::OpenGL)
     if (APPLE)
         find_library(APPKIT NAMES AppKit) 
-        target_link_libraries(editor ${APPKIT})
+        target_link_libraries(tungsten_editor ${APPKIT})
     endif()
     message(STATUS "Building editor")
     
-    set(data_dirs ${data_dirs} editor shaders)
-    set(executables ${executables} editor)
+    set(data_dirs ${data_dirs} tungsten_editor shaders)
+    set(executables ${executables} tungsten_editor)
 else()
     if (NOT Qt5Widgets_FOUND)
         message(STATUS "Qt5 not found. Editor will not be built")

Not sure why people decided to package a research renderer on Linux systems though.