From 741bf9fe9cd8e37a08c8212a48fbc9b8725f884e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Mar 2014 09:22:51 -0700 Subject: [PATCH 1/8] remove double definition of GLEW_STATIC --- interface/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index bdf34e7c5d..0aaf180047 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -32,7 +32,7 @@ elseif (WIN32) add_definitions( -D_USE_MATH_DEFINES ) # apparently needed to get M_PI and other defines from cmath/math.h add_definitions( -DWINDOWS_LEAN_AND_MEAN ) # needed to make sure windows doesn't go to crazy with its defines - set(GL_HEADERS "#define GLEW_STATIC\n#include \n#include \n#include ") + set(GL_HEADERS "#include \n#include \n#include ") endif () # set up the external glm library From 6d5515a41d7ad8da170227348370cf8102535e50 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Mar 2014 09:27:01 -0700 Subject: [PATCH 2/8] clarify that Windows builds are 32-bit, fix double GLEW_STATIC --- BUILD.md | 4 +++- cmake/modules/FindGLUT.cmake | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/BUILD.md b/BUILD.md index 1796aaa575..6021519b3c 100644 --- a/BUILD.md +++ b/BUILD.md @@ -126,7 +126,9 @@ They can be set in your ENV or by passing them to the cmake command on the comma Each of those designates the root directory that contains the sub-folders for each library. For example, if the GLEW_ROOT_DIR is `C:\libs\glew`, then we would expect to find an `include` folder and a `lib` folder inside `C:\libs\glew`. ####Freeglut DLL -As with the Qt libraries, you will need to make sure the directory containing `freeglut.dll` is in your path. The directory to add to your path in which the DLL is found is `FREEGLUT_DIR/bin`. If you are on 64-bit windows, the directory in your path should be the x64 subdirectory in `bin`. +As with the Qt libraries, you will need to make sure the directory containing `freeglut.dll` is in your path. The directory to add to your path in which the DLL is found is `FREEGLUT_DIR/bin`. + +*NOTE: Qt does not support 64-bit builds on Windows 7, so you must use the 32-bit version of freeglut.dll for interface.exe to run. The 32-bit version of the static library is the one linked by CMakeLists.txt* ####Building in Visual Studio Follow the same build steps from the CMake section, but pass a different generator to CMake. diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake index 29ed46cb34..173f5a24ae 100644 --- a/cmake/modules/FindGLUT.cmake +++ b/cmake/modules/FindGLUT.cmake @@ -17,12 +17,8 @@ else () if (WIN32) set(WIN_GLUT_SEARCH_DIRS "${GLUT_ROOT_DIR}" "$ENV{GLUT_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/freeglut" "${OPENGL_INCLUDE_DIR}") find_path(GLUT_INCLUDE_DIR GL/glut.h PATH_SUFFIXES include HINTS ${WIN_GLUT_SEARCH_DIRS}) - - if (CMAKE_CL_64) - set(WIN_ARCH_DIR "x64") - endif() - - find_library(GLUT_glut_LIBRARY freeglut PATH_SUFFIXES lib/${WIN_ARCH_DIR} HINTS ${WIN_GLUT_SEARCH_DIRS}) + + find_library(GLUT_glut_LIBRARY freeglut PATH_SUFFIXES lib HINTS ${WIN_GLUT_SEARCH_DIRS}) else () find_path(GLUT_INCLUDE_DIR GL/glut.h "${GLUT_LOCATION}/include" From 4e382099fb8231cebd152a8840cb932a1cd7b88f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Mar 2014 09:27:32 -0700 Subject: [PATCH 3/8] have FindGLEW only look for 32-bit static lib --- cmake/modules/FindGLEW.cmake | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cmake/modules/FindGLEW.cmake b/cmake/modules/FindGLEW.cmake index b4514d3182..684acca762 100644 --- a/cmake/modules/FindGLEW.cmake +++ b/cmake/modules/FindGLEW.cmake @@ -19,14 +19,8 @@ else () set(WIN_GLEW_SEARCH_DIRS "${GLEW_ROOT_DIR}" "$ENV{GLEW_ROOT_DIR}" "$ENV{HIFI_LIB_DIR}/glew") find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS}) - - if (CMAKE_CL_64) - set(WIN_ARCH_DIR "x64") - else() - set(WIN_ARCH_DIR "Win32") - endif() - - find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/${WIN_ARCH_DIR}" HINTS ${WIN_GLEW_SEARCH_DIRS}) + + find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/Win32" HINTS ${WIN_GLEW_SEARCH_DIRS}) endif () include(FindPackageHandleStandardArgs) From 002738037c020f55aae2ba901921fd76587c6c3b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Mar 2014 09:28:20 -0700 Subject: [PATCH 4/8] only look for the 32-bit oculus lib on windows --- cmake/modules/FindLibOVR.cmake | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 015a1de42b..47b7d27015 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -36,26 +36,14 @@ else (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) if (UDEV_LIBRARY AND XINERAMA_LIBRARY AND OVR_LIBRARY) set(LIBOVR_LIBRARIES "${OVR_LIBRARY};${UDEV_LIBRARY};${XINERAMA_LIBRARY}" CACHE INTERNAL "Oculus libraries") endif (UDEV_LIBRARY AND XINERAMA_LIBRARY AND OVR_LIBRARY) - elseif (WIN32) - if (CMAKE_CL_64) - set(WINDOWS_ARCH_DIR "Win32") - - if (CMAKE_BUILD_TYPE MATCHES DEBUG) - set(WINDOWS_LIBOVR_NAME "libovrd.lib") - else() - set(WINDOWS_LIBOVR_NAME "libovr.lib") - endif() + elseif (WIN32) + if (CMAKE_BUILD_TYPE MATCHES DEBUG) + set(WINDOWS_LIBOVR_NAME "libovrd.lib") else() - set(WINDOWS_ARCH_DIR "x64") - - if (CMAKE_BUILD_TYPE MATCHES DEBUG) - set(WINDOWS_LIBOVR_NAME "libovr64d.lib") - else() - set(WINDOWS_LIBOVR_NAME "libovr64.lib") - endif() + set(WINDOWS_LIBOVR_NAME "libovr.lib") endif() - find_library(LIBOVR_LIBRARIES "Lib/${WINDOWS_ARCH_DIR}/${LIBOVR_NAME}" HINTS ${LIBOVR_SEARCH_DIRS}) + find_library(LIBOVR_LIBRARIES "Lib/Win32/${LIBOVR_NAME}" HINTS ${LIBOVR_SEARCH_DIRS}) endif () if (LIBOVR_INCLUDE_DIRS AND LIBOVR_LIBRARIES) From 9053379a888740c8e8f5d552acef92bd9738c8c3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Mar 2014 17:36:34 -0700 Subject: [PATCH 5/8] updates to BUILD for addition of qxmpp --- BUILD.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/BUILD.md b/BUILD.md index 6021519b3c..26aaea3f03 100644 --- a/BUILD.md +++ b/BUILD.md @@ -4,6 +4,7 @@ Dependencies * [Qt](http://qt-project.org/downloads) ~> 5.2.0 * [zLib](http://www.zlib.net/) ~> 1.2.8 * [glm](http://glm.g-truc.net/0.9.5/index.html) ~> 0.9.5.0 +* [qxmpp](https://code.google.com/p/qxmpp/) ~> 0.7.6 #####Linux only * [freeglut](http://freeglut.sourceforge.net/) ~> 2.8.0 @@ -53,9 +54,12 @@ Should you choose not to install Qt5 via a package manager that handles dependen #####Package Managers [Homebrew](http://brew.sh/) is an excellent package manager for OS X. It makes install of all hifi dependencies very simple. - brew install cmake qt5 glm zlib + brew install cmake qt5 glm zlib qxmpp + +We have a [homebrew formulas repository](https://github.com/highfidelity/homebrew-formulas) that you can use/tap to install some of the dependencies. + +*Our [qt5 homebrew formula](https://raw.github.com/highfidelity/homebrew-formulas/master/qt5.rb) is for a patched version of Qt 5.2.0 stable that removes wireless network scanning that can reduce real-time audio performance. We recommended you use this formula to install Qt.* -*High Fidelity has a [homebrew formula](https://raw.github.com/highfidelity/hifi/master/qt5.rb) for a patched version of Qt 5.2.0 stable that removes wireless network scanning that can reduce real-time audio performance. We recommended you use this formula to install Qt.* #####Xcode If Xcode is your editor of choice, you can ask CMake to generate Xcode project files instead of Unix Makefiles. @@ -94,7 +98,7 @@ NOTE: zLib should configure itself correctly on install. However, sometimes zLib ####External Libraries We don't currently have a Windows installer, so before running Interface, you will need to ensure that all required resources are loadable. -CMake will need to know where the headers and libraries for required external dependencies are. If you installed ZLIB using the installer, the FindZLIB cmake module will be able to find it. This isn't the case for glm, freeglut, and GLEW. +CMake will need to know where the headers and libraries for required external dependencies are. If you installed ZLIB using the installer, the FindZLIB cmake module will be able to find it. This isn't the case for the others. You have the choice of setting a variable specific to each library, or having a folder using a defined structure that contains all of the libs. @@ -112,6 +116,9 @@ The recommended route is to place all of the dependencies in one place and set o -> bin -> include -> lib + -> qxmpp + -> include + -> lib For all three external libraries you should be able to simply copy the extracted folder that you get from the download links provided at the top of the guide. The `root_lib_dir` in the above example can be wherever you choose on your system - as long as the environment variable HIFI_LIB_DIR is set to it. @@ -125,10 +132,10 @@ They can be set in your ENV or by passing them to the cmake command on the comma Each of those designates the root directory that contains the sub-folders for each library. For example, if the GLEW_ROOT_DIR is `C:\libs\glew`, then we would expect to find an `include` folder and a `lib` folder inside `C:\libs\glew`. -####Freeglut DLL -As with the Qt libraries, you will need to make sure the directory containing `freeglut.dll` is in your path. The directory to add to your path in which the DLL is found is `FREEGLUT_DIR/bin`. +*NOTE: Qt does not support 64-bit builds on Windows 7, so you must use the 32-bit version of libraries for interface.exe to run. The 32-bit version of the static library is the one linked by our CMake find modules* -*NOTE: Qt does not support 64-bit builds on Windows 7, so you must use the 32-bit version of freeglut.dll for interface.exe to run. The 32-bit version of the static library is the one linked by CMakeLists.txt* +#### DLLs +As with the Qt libraries, you will need to make sure the directory containing dynamically-linked libraries is in your path. For example, for a dynamically linked build of freeglut, the directory to add to your path in which the DLL is found is `FREEGLUT_DIR/bin`. Where possible, you can use static builds of the external dependencies to avoid this requirement. ####Building in Visual Studio Follow the same build steps from the CMake section, but pass a different generator to CMake. @@ -138,7 +145,6 @@ Follow the same build steps from the CMake section, but pass a different generat ####Running Interface If you need to debug Interface, you can run interface from within Visual Studio (see the section below). You can also run Interface by launching it from command line or File Explorer from $YOUR_HIFI_PATH\build\interface\Debug\interface.exe - ####Debugging Interface * In the Solution Explorer, right click interface and click Set as StartUp Project * Set the "Working Directory" for the Interface debugging sessions to the Debug output directory so that your application can load resources. Do this: right click interface and click Properties, choose Debugging from Configuration Properties, set Working Directory to .\Debug From 0b8852cfbe6696a4de232885055d6c0b413d1046 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Mon, 10 Mar 2014 17:40:06 -0700 Subject: [PATCH 6/8] clarify when it is possible to drag-and-drop external dependency --- BUILD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD.md b/BUILD.md index 26aaea3f03..ab27bfe52d 100644 --- a/BUILD.md +++ b/BUILD.md @@ -120,10 +120,10 @@ The recommended route is to place all of the dependencies in one place and set o -> include -> lib -For all three external libraries you should be able to simply copy the extracted folder that you get from the download links provided at the top of the guide. The `root_lib_dir` in the above example can be wherever you choose on your system - as long as the environment variable HIFI_LIB_DIR is set to it. - *NOTE: Be careful with glm. For the folder other libraries would normally call 'include', the folder containing the headers, glm opts to use 'glm'. You will have a glm folder nested inside the top-level glm folder.* +For many of the external libraries where precompiled binaries are readily available you should be able to simply copy the extracted folder that you get from the download links provided at the top of the guide. Otherwise you may need to build from source and install the built product to this directory. The `root_lib_dir` in the above example can be wherever you choose on your system - as long as the environment variable HIFI_LIB_DIR is set to it. + Should you want to define a location for each library, these are the associated variables you will want to set: `GLM_ROOT_DIR, GLUT_ROOT_DIR, GLEW_ROOT_DIR` From dc0b9712bb54560ce99679737e6f848410a9357b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 11 Mar 2014 09:40:54 -0700 Subject: [PATCH 7/8] updates to BUILD guide to suggest using tapped formulas --- BUILD.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BUILD.md b/BUILD.md index ab27bfe52d..72fd87f906 100644 --- a/BUILD.md +++ b/BUILD.md @@ -54,7 +54,11 @@ Should you choose not to install Qt5 via a package manager that handles dependen #####Package Managers [Homebrew](http://brew.sh/) is an excellent package manager for OS X. It makes install of all hifi dependencies very simple. - brew install cmake qt5 glm zlib qxmpp + brew tap highfidelity/homebrew-formulas + brew install cmake glm zlib + brew install highfidelity/formulas/qt5 + brew link qt5 --force + brew install highfidelity/formuals/qxmpp We have a [homebrew formulas repository](https://github.com/highfidelity/homebrew-formulas) that you can use/tap to install some of the dependencies. From f3e8e6845791ff88d3ab035caf9d00f2f2a8ae73 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 11 Mar 2014 09:41:33 -0700 Subject: [PATCH 8/8] fix a typo for path to tapped qxmpp formula --- BUILD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD.md b/BUILD.md index 72fd87f906..1bc5145704 100644 --- a/BUILD.md +++ b/BUILD.md @@ -58,9 +58,9 @@ Should you choose not to install Qt5 via a package manager that handles dependen brew install cmake glm zlib brew install highfidelity/formulas/qt5 brew link qt5 --force - brew install highfidelity/formuals/qxmpp + brew install highfidelity/formulas/qxmpp -We have a [homebrew formulas repository](https://github.com/highfidelity/homebrew-formulas) that you can use/tap to install some of the dependencies. +We have a [homebrew formulas repository](https://github.com/highfidelity/homebrew-formulas) that you can use/tap to install some of the dependencies. In the code block above qt5 and qxmpp are installed from formulas in this repository. *Our [qt5 homebrew formula](https://raw.github.com/highfidelity/homebrew-formulas/master/qt5.rb) is for a patched version of Qt 5.2.0 stable that removes wireless network scanning that can reduce real-time audio performance. We recommended you use this formula to install Qt.*