Browse Source

Merge pull request #305 from CTrauma/CT-LINUX-BUILD

Fixes for the Linux build to compile editor TypeScript
JoshEngebretson 10 years ago
parent
commit
0112f8813d
2 changed files with 23 additions and 0 deletions
  1. 2 0
      AUTHORS.md
  2. 21 0
      Source/AtomicEditor/CMakeLists.txt

+ 2 - 0
AUTHORS.md

@@ -15,6 +15,8 @@
 
 - Shaddock Heath (https://github.com/shaddockh)
 
+- C.Trauma (https://github.com/CTrauma)
+
 ### Contribution Copyright and Licensing
 
 Atomic Game Engine contribution copyrights are held by their authors.  Each author retains the copyright to their contribution and agrees to irrevocably license the contribution under the Atomic Game Engine Contribution License `CONTRIBUTION_LICENSE.md`.  Please see `CONTRIBUTING.md` for more details.

+ 21 - 0
Source/AtomicEditor/CMakeLists.txt

@@ -62,6 +62,27 @@ if (APPLE)
 
 elseif(LINUX)
     target_link_libraries(AtomicEditor curl nativefiledialog ${GTK3_LIBRARIES})
+
+    # check for nodejs install
+    # look for either 'node' or 'nodejs' ( debian uses both names )
+    set(NODEJS_CMD node)
+    find_program( SYS_NODE ${NODEJS_CMD}  PATHS /usr/bin/ /bin ENV PATH)
+
+    if(NOT SYS_NODE)
+        set(NODEJS_CMD nodejs)
+        find_program( SYS_NODE ${NODEJS_CMD}  PATHS /usr/bin/ /bin ENV PATH)
+    endif()
+
+    if( NOT SYS_NODE)
+        message(SEND_WARNING " WARNING: Could not find Nodejs, editor's TypeScript will not be compiled!")
+    endif()
+
+    if(SYS_NODE)
+        # compile the editor scripts
+        add_custom_command (TARGET AtomicEditor POST_BUILD
+        COMMAND  ${NODEJS_CMD} "${CMAKE_SOURCE_DIR}/Build/TypeScript/tsc.js" "-p" "./Script"
+        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+    endif() 
 else()
     target_link_libraries(AtomicEditor libcurl Iphlpapi Wldap32)