]> git.cworth.org Git - vogl/commitdiff
Add QtCreator tag file and readme
authorMichael Sartain <mikesart@valvesoftware.com>
Sat, 15 Mar 2014 01:52:40 +0000 (18:52 -0700)
committerCarl Worth <cworth@cworth.org>
Tue, 1 Apr 2014 19:37:28 +0000 (12:37 -0700)
qtcreator/CMakeLists.txt [new file with mode: 0644]
qtcreator/qtcreator.md [new file with mode: 0644]

diff --git a/qtcreator/CMakeLists.txt b/qtcreator/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1c49d31
--- /dev/null
@@ -0,0 +1,76 @@
+#
+# VoglProj QtCreator cmake source tag file.
+#
+project(VoglProj)
+cmake_minimum_required(VERSION 2.8)
+
+# List of file extensions that we search for.
+set(EXTLIST *.i *.sh *.inl *.inc *.txt *.vs *.vp *.frag *.vert *.py *.m *.c* *.h* *.S *.ui)
+
+# Vogl directories.
+set(VOGL_DIR 
+    "${CMAKE_CURRENT_SOURCE_DIR}/../src"
+    "${CMAKE_CURRENT_SOURCE_DIR}/../bin"
+    "${CMAKE_CURRENT_SOURCE_DIR}/../glspec")
+
+message("VOGL_DIR is ${VOGL_DIR}")
+message("CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
+
+add_definitions("-DVOGL_USE_LINUX_API=1")
+add_definitions("-DSDL_VIDEO_DRIVER_X11=1")
+add_definitions("-DSDL_VIDEO_DRIVER_X11_DYNAMIC")
+
+# Create list of vogl directories plus extensions.
+set(GLOBSPEC)
+foreach(dir ${VOGL_DIR})
+    foreach(ext ${EXTLIST})
+        list(APPEND GLOBSPEC ${dir}/${ext})
+    endforeach()
+endforeach()
+
+message("globspec is ${GLOBSPEC}")
+
+# Search for all the files.
+file(GLOB_RECURSE vogl_srcs
+    ${VOGL_DIR}
+    ${GLOBSPEC}
+    )
+
+# Macro to remove files based on regex pattern.
+macro(RemoveSrcFiles pat)
+    set(result)
+    foreach(file ${vogl_srcs})
+        if(file MATCHES ${pat})
+        else()
+            list(APPEND result ${file})
+        endif()
+    endforeach()
+    set(vogl_srcs ${result})
+endmacro()
+
+# Remove all files under .git and .hg directories.
+RemoveSrcFiles("/[.]git/")
+RemoveSrcFiles("/[.]hg/")
+
+#RemoveSrcFiles("/src/OGLSuperBible/")
+#RemoveSrcFiles("/src/OGLSamples_GTruc/")
+#RemoveSrcFiles(".~")
+
+# Spew out all files we've found.
+set(dir_list "")
+set(count 0)
+foreach(file ${vogl_srcs})
+    message("${file}")
+    math(EXPR count "${count} + 1")
+    GET_FILENAME_COMPONENT(dir_path ${file} PATH)
+    SET(dir_list ${dir_list} ${dir_path})
+endforeach()
+
+list(REMOVE_DUPLICATES dir_list)
+include_directories(${dir_list})
+
+message("${count} files added.\n")
+
+add_executable(VoglProj ${vogl_srcs})
+set_target_properties(VoglProj PROPERTIES LINKER_LANGUAGE CXX)
+
diff --git a/qtcreator/qtcreator.md b/qtcreator/qtcreator.md
new file mode 100644 (file)
index 0000000..96b6f62
--- /dev/null
@@ -0,0 +1,53 @@
+QtCreator 3.0
+-------------
+
+### Create Project ###
+
+* Select "File / Open File or Project..." (Ctrl+O)
+* Open the "vogl/qtcreator/CMakeLists.txt" file
+* Select a location for the cmake build files. I just the choose vogl/qtcreator directory.
+* Hit "Next >" button.
+* Change Generator to "Ninja (Desktop)" if you're going to build with Ninja.
+* Hit "Run CMake" button.
+ * ... Wait a few seconds to parse and add files. ...
+ * ... You should see something like "2358 files added." ...
+* Hit "Finish" button.
+
+You should now be able to click in bottom left "Type to locate" control (or hit Ctrl+K), type in names of vogl files (ie vogl_intercept.cpp), search for symbols, etc.
+
+### Build ###
+
+* Click on "Projects" icon on the left.
+* Under Build Steps:
+ * Mouse over the "Make: make" step and click the 'x' to delete it.
+ * Click <Add Build Step>, and select "Custom Process Step".
+
+    <b>Command:</b> /home/mikesart/dev/voglproj/vogl/bin/mkvogl.sh  
+    <b>Arguments:</b> --amd64 --debug 3>&1 1>&2 2>&3  
+
+* Now select "Choose Build / Build Project..." or (Ctrl+B)
+* (Alt+4) will flip QtCreator to show the compile output
+
+### Clean ###
+
+* Under Clean Steps:
+ * Mouse over the "Make: make clean" step and click the 'x' to delete it.
+ * Click "Add Clean Step", select "Custom Process Step".
+
+    <b>Command:</b> /home/mikesart/dev/voglproj/vogl/bin/mkvogl.sh  
+    <b>Arguments:</b> --amd64 --debug --cleanonly  
+
+
+### Other build configurations ###
+
+* Within the <Projects> tab, next to "Edit build configurations"
+ * Click "Rename..."; change the text from "all" to "amd64_debug"
+ * Click "Add"; select "Clone selected"; follow steps below
+
+* Repeat the steps above for the remaining build configurations:
+ * <b>amd64_release":</b> Arguments: --amd64 --release --verbose 3>&1 1>&2 2>&3
+ * <b>i386_debug:</b> Arguments: --i386 --debug --verbose 3>&1 1>&2 2>&3
+ * <b>i386_release":</b> Arguments: --i386 --release --verbose 3>&1 1>&2 2>&3
+
+
+Not that you can use the "--usemake" flag with mkvolg.sh if you don't want to use Ninja. If you do this, remove the "3>&1 1>&2 2>&3" redirections also.