From b7f60cec7e8d2d567f6bb1ed66e1502f3a297e1c Mon Sep 17 00:00:00 2001 From: Emmanuel Durand Date: Sat, 14 Jan 2017 11:57:50 -0500 Subject: [PATCH] Added GLFW as a submodule, compiled as static --- .gitmodules | 3 +++ .travis.yml | 1 + CMakeLists.txt | 11 +++++++++-- README.md | 6 +++--- external/glfw | 1 + src/CMakeLists.txt | 8 ++++++-- tests/CMakeLists.txt | 4 +++- tools/docker/Dockerfile | 7 +------ tools/docker/build_package.sh | 2 +- 9 files changed, 28 insertions(+), 15 deletions(-) create mode 160000 external/glfw diff --git a/.gitmodules b/.gitmodules index 023249dc..cc0d7277 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,3 +33,6 @@ path = external/ffmpeg url = https://git.ffmpeg.org/ffmpeg.git branch = n3.2.1 +[submodule "external/glfw"] + path = external/glfw + url = https://github.com/glfw/glfw.git diff --git a/.travis.yml b/.travis.yml index 3b35c255..9d9fc29e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ before_script: - git submodule update --init script: + - ./make_deps.sh - rm -rf build && mkdir build && cd build - cmake .. - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then make; make check; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index fe4490a3..de954136 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,6 @@ find_package(PkgConfig REQUIRED) # Mandatory dependencies find_package(Snappy REQUIRED) -pkg_search_module(GLFW REQUIRED glfw3) pkg_search_module(GSL REQUIRED gsl) pkg_search_module(ZMQ REQUIRED libzmq) pkg_check_modules(FFMPEG libavformat libavcodec libavutil libswscale) @@ -111,6 +110,15 @@ endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/config.h.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/include/config.h") +# +# External sources +# +set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) +set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) +set(GLFW_INSTALL OFF CACHE BOOL "" FORCE) +add_subdirectory(external/glfw) + # # Sources # @@ -143,7 +151,6 @@ if(UNIX AND NOT APPLE) # Package creation on Linux set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") set(CPACK_DEBIAN_PACKAGE_DEPENDS "libatlas3-base, libboost-system1.58.0, - libglfw3, libgphoto2-6, libgsl2, libopencv-core2.4v5, diff --git a/README.md b/README.md index 723528e4..ddd643f8 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,6 @@ Installation Splash relies on a few libraries to get the job done. These libraries are: - [OpenGL](http://opengl.org), which should be installed by the graphic driver, -- [FFmpeg](http://ffmpeg.org/) to read video files, -- [GLFW](http://glfw.org) to handle the GL context creation, -- [GLM](http://glm.g-truc.net) to ease matrix manipulation, - [libshmdata](http://code.sat.qc.ca/redmine/projects/libshmdata) to read video flows from a shared memory, - [GSL](http://gnu.org/software/gsl) (GNU Scientific Library) to compute calibration, - [ZMQ](http://zeromq.org) to communicate between the various process involved in a Splash session, @@ -65,6 +62,9 @@ Splash relies on a few libraries to get the job done. These libraries are: A few more libraries are used as submodules in the git repository: +- [FFmpeg](http://ffmpeg.org/) to read video files, +- [GLFW](http://glfw.org) to handle the GL context creation, +- [GLM](http://glm.g-truc.net) to ease matrix manipulation, - [ImGui](https://github.com/ocornut/imgui) to draw the GUI, - [doctest](https://github.com/onqtam/doctest/) to do some unit testing, - [Piccante](https://github.com/banterle/piccante) to create HDR images, diff --git a/external/glfw b/external/glfw new file mode 160000 index 00000000..999f3556 --- /dev/null +++ b/external/glfw @@ -0,0 +1 @@ +Subproject commit 999f3556fdd80983b10051746264489f2cb1ef16 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 88c1c309..97f06379 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,12 +53,14 @@ include_directories(${OPENCV_INCLUDE_DIRS}) include_directories(${SNAPPY_INCLUDE_DIRS}) include_directories(${PYTHON_INCLUDE_DIRS}) +# Distributed third parties first +link_directories(${FFMPEG_LIBRARY_DIRS}) + link_directories(${GLFW_LIBRARY_DIRS}) link_directories(${GSL_LIBRARY_DIRS}) link_directories(${ZMQ_LIBRARY_DIRS}) link_directories(${SHMDATA_LIBRARY_DIRS}) link_directories(${GPHOTO_LIBRARY_DIRS}) -link_directories(${FFMPEG_LIBRARY_DIRS}) link_directories(${PORTAUDIO_LIBRARY_DIRS}) link_directories(${OPENCV_LIBRARY_DIRS}) link_directories(${SNAPPY_LIBRARY_DIRS}) @@ -190,10 +192,12 @@ if (APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -F${CMAKE_CURRENT_SOURCE_DIR}/../external/syphon/build/Release -framework Syphon") endif() +# Distributed third parties first target_link_libraries(splash-${API_VERSION} ${FFMPEG_LIBRARIES}) + target_link_libraries(splash-${API_VERSION} pthread) target_link_libraries(splash-${API_VERSION} ${Boost_LIBRARIES}) -target_link_libraries(splash-${API_VERSION} ${GLFW_LIBRARIES}) +target_link_libraries(splash-${API_VERSION} glfw) target_link_libraries(splash-${API_VERSION} ${GSL_LIBRARIES}) target_link_libraries(splash-${API_VERSION} ${ZMQ_LIBRARIES}) target_link_libraries(splash-${API_VERSION} ${SHMDATA_LIBRARIES}) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e9d79a99..4f7bb6da 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -46,12 +46,14 @@ include_directories(${OPENCV_INCLUDE_DIRS}) include_directories(${SNAPPY_INCLUDE_DIRS}) include_directories(${PYTHON_INCLUDE_DIRS}) +# Distributed third parties first +link_directories(${FFMPEG_LIBRARY_DIRS}) + link_directories(${GLFW_LIBRARY_DIRS}) link_directories(${GSL_LIBRARY_DIRS}) link_directories(${ZMQ_LIBRARY_DIRS}) link_directories(${SHMDATA_LIBRARY_DIRS}) link_directories(${GPHOTO_LIBRARY_DIRS}) -link_directories(${FFMPEG_LIBRARY_DIRS}) link_directories(${PORTAUDIO_LIBRARY_DIRS}) link_directories(${OPENCV_LIBRARY_DIRS}) link_directories(${SNAPPY_LIBRARY_DIRS}) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 0d7e5547..fe29599d 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -10,7 +10,6 @@ RUN apt install --assume-yes \ cmake \ automake \ libtool \ - clang \ libxrandr-dev \ libxi-dev \ libglm-dev \ @@ -19,14 +18,10 @@ RUN apt install --assume-yes \ libzmq3-dev \ libsnappy-dev \ libgphoto2-dev \ - libglfw3-dev \ + libgl1-mesa-dev \ libxinerama-dev \ libxcursor-dev \ python3-dev \ - libavformat-dev \ - libavcodec-dev \ - libavutil-dev \ - libswscale-dev \ portaudio19-dev \ libopencv-dev \ yasm diff --git a/tools/docker/build_package.sh b/tools/docker/build_package.sh index cb93e299..f5729ed7 100755 --- a/tools/docker/build_package.sh +++ b/tools/docker/build_package.sh @@ -13,7 +13,7 @@ fi echo "Checking out branch $git_branch" -git clone git://gitlab.com/sat-metalab/splash.git +git clone https://gitlab.com/sat-metalab/splash.git cd splash git checkout $git_branch git submodule update --init