From 65ddeba70c8964526ffa1cbba2583fdbe6a452b7 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 20 Jul 2016 14:31:30 +0200 Subject: [PATCH 1/4] Add SGCT as submodule Fix compile errors in ParallelConnection using __WIN32__ macro instead of WIN32 --- .gitmodules | 3 ++ ext/sgct | 1 + .../openspace/network/parallelconnection.h | 4 +-- src/network/parallelconnection.cpp | 4 +-- support/cmake/support_macros.cmake | 28 +++++++++++++++++-- 5 files changed, 33 insertions(+), 7 deletions(-) create mode 160000 ext/sgct diff --git a/.gitmodules b/.gitmodules index 9748062bd2..3321a95461 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "ext/spice"] path = ext/spice url = https://github.com/OpenSpace/Spice.git +[submodule "ext/sgct"] + path = ext/sgct + url = https://github.com/opensgct/sgct.git diff --git a/ext/sgct b/ext/sgct new file mode 160000 index 0000000000..b8f1416d73 --- /dev/null +++ b/ext/sgct @@ -0,0 +1 @@ +Subproject commit b8f1416d73eae9542f9888b7f206c2249ac3256c diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index 979b57a8cc..d47c157eb3 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -43,7 +43,7 @@ #include #include -#ifdef __WIN32__ +#ifdef WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -52,7 +52,7 @@ #include #endif -#if defined(__WIN32__) || defined(__MING32__) || defined(__MING64__) +#if defined(WIN32) || defined(__MING32__) || defined(__MING64__) typedef size_t _SOCKET; #else typedef int _SOCKET; diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 416968cff7..260d8d64fe 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifdef __WIN32__ +#ifdef WIN32 #ifndef _ERRNO #define _ERRNO WSAGetLastError() #endif @@ -148,7 +148,7 @@ void ParallelConnection::closeSocket(){ * SHUT_RDWR (Disables further send and receive operations) */ -#ifdef __WIN32__ +#ifdef WIN32 shutdown(_clientSocket, SD_BOTH); closesocket(_clientSocket); #else diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index eea59d1cbf..0f7c0eb8d4 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -116,9 +116,31 @@ function (add_external_dependencies) set_property(TARGET lz4 PROPERTY FOLDER "External") # SGCT - find_package(SGCT REQUIRED) - target_include_directories(libOpenSpace SYSTEM PUBLIC ${SGCT_INCLUDE_DIRECTORIES}) - target_link_libraries(libOpenSpace ${SGCT_LIBRARIES}) + set(SGCT_TEXT OFF CACHE FORCE "") + set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE FORCE "") + + add_subdirectory(${OPENSPACE_EXT_DIR}/sgct) + target_include_directories(libOpenSpace SYSTEM PUBLIC ${OPENSPACE_EXT_DIR}/sgct/include) + target_link_libraries( + libOpenSpace + # sgct + sgct_light glew glfw png16_static quat tinythreadpp tinyxml2static turbojpeg-static + vrpn zlibstatic + # simd + ) + + set_property(TARGET sgct_light PROPERTY FOLDER "External") + set_property(TARGET glew PROPERTY FOLDER "External/SGCT") + set_property(TARGET glfw PROPERTY FOLDER "External/SGCT") + set_property(TARGET png16_static PROPERTY FOLDER "External/SGCT") + set_property(TARGET quat PROPERTY FOLDER "External/SGCT") + set_property(TARGET simd PROPERTY FOLDER "External/SGCT") + set_property(TARGET tinythreadpp PROPERTY FOLDER "External/SGCT") + set_property(TARGET tinyxml2static PROPERTY FOLDER "External/SGCT") + set_property(TARGET turbojpeg-static PROPERTY FOLDER "External/SGCT") + set_property(TARGET vrpn PROPERTY FOLDER "External/SGCT") + set_property(TARGET zlibstatic PROPERTY FOLDER "External/SGCT") + if (UNIX AND (NOT APPLE)) target_link_libraries(libOpenSpace Xcursor Xinerama X11) endif () From 6a56e4c83c9b5135e98fe7ca6a7d102c2e1ea06c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 20 Jul 2016 14:52:24 +0200 Subject: [PATCH 2/4] Link GLFW library requirements Update SGCT reference --- ext/sgct | 2 +- support/cmake/support_macros.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/sgct b/ext/sgct index b8f1416d73..7f97e618d3 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit b8f1416d73eae9542f9888b7f206c2249ac3256c +Subproject commit 7f97e618d3aca2e318e32aa8a679984a56fd11ca diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 0f7c0eb8d4..4b2875dbae 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -126,7 +126,7 @@ function (add_external_dependencies) # sgct sgct_light glew glfw png16_static quat tinythreadpp tinyxml2static turbojpeg-static vrpn zlibstatic - # simd + ${GLFW_LIBRARIES} ) set_property(TARGET sgct_light PROPERTY FOLDER "External") From 8dc2cdbbea5975a6ed18522b0c85e9f6d360d73f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 20 Jul 2016 16:24:00 +0200 Subject: [PATCH 3/4] Correctly set SGCT default values --- support/cmake/support_macros.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 4b2875dbae..8060ce731c 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -116,8 +116,9 @@ function (add_external_dependencies) set_property(TARGET lz4 PROPERTY FOLDER "External") # SGCT - set(SGCT_TEXT OFF CACHE FORCE "") - set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE FORCE "") + set(SGCT_TEXT OFF CACHE BOOL "" FORCE) + set(SGCT_BUILD_CSHARP_PROJECTS OFF CACHE BOOL "" FORCE) + set(SGCT_LIGHT_ONLY ON CACHE BOOL "" FORCE) add_subdirectory(${OPENSPACE_EXT_DIR}/sgct) target_include_directories(libOpenSpace SYSTEM PUBLIC ${OPENSPACE_EXT_DIR}/sgct/include) From a0fec7f6a08496f37dab628ffbd29ffebfafa00b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 20 Jul 2016 16:36:44 +0200 Subject: [PATCH 4/4] Update Ghoul reference --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 60e65350db..8875a9e20d 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 60e65350db67a5a364dfa5e201f1e888395f4f06 +Subproject commit 8875a9e20dd1d408588d45bb90c0d2248c5643cb