From 2ccf1dbd75abe4403b163008f92d0c9f95dade01 Mon Sep 17 00:00:00 2001 From: Michael Sartain Date: Fri, 14 Mar 2014 18:52:40 -0700 Subject: [PATCH] Add QtCreator tag file and readme --- qtcreator/CMakeLists.txt | 76 ++++++++++++++++++++++++++++++++++++++++ qtcreator/qtcreator.md | 53 ++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 qtcreator/CMakeLists.txt create mode 100644 qtcreator/qtcreator.md diff --git a/qtcreator/CMakeLists.txt b/qtcreator/CMakeLists.txt new file mode 100644 index 0000000..1c49d31 --- /dev/null +++ b/qtcreator/CMakeLists.txt @@ -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 index 0000000..96b6f62 --- /dev/null +++ b/qtcreator/qtcreator.md @@ -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 , and select "Custom Process Step". + + Command: /home/mikesart/dev/voglproj/vogl/bin/mkvogl.sh + Arguments: --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". + + Command: /home/mikesart/dev/voglproj/vogl/bin/mkvogl.sh + Arguments: --amd64 --debug --cleanonly + + +### Other build configurations ### + +* Within the 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: + * amd64_release": Arguments: --amd64 --release --verbose 3>&1 1>&2 2>&3 + * i386_debug: Arguments: --i386 --debug --verbose 3>&1 1>&2 2>&3 + * i386_release": 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. -- 2.43.0