Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
refine fix for GLEW lib retrieval for cmake 3.15
Browse files Browse the repository at this point in the history
  • Loading branch information
p-mary committed Aug 6, 2019
1 parent 4458ec2 commit ed8f1a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ jobs:
# create build directory
- mkdir build && cd build
# configure Tulip complete build using cmake
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DTULIP_BUILD_TESTS=ON -DTULIP_USE_CCACHE=ON -DZLIB_INCLUDE_DIR=/opt/local/include -DZLIB_LIBRARY_RELEASE=/opt/local/lib/libz.dylib -DPNG_INCLUDE_DIR=/opt/local/include -DPNG_LIBRARY_RELEASE=/opt/local/lib/libpng.dylib -DJPEG_INCLUDE_DIR=/opt/local/include -DJPEG_LIBRARY=/opt/local/lib/libjpeg.dylib || travis_terminate 1
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DTULIP_BUILD_TESTS=ON -DTULIP_USE_CCACHE=ON -DZLIB_INCLUDE_DIR=/opt/local/include -DZLIB_LIBRARY_RELEASE=/opt/local/lib/libz.dylib -DPNG_INCLUDE_DIR=/opt/local/include -DPNG_LIBRARY_RELEASE=/opt/local/lib/libpng.dylib -DJPEG_INCLUDE_DIR=/opt/local/include -DJPEG_LIBRARY=/opt/local/lib/libjpeg.dylib -DGLEW_SHARED_LIBRARY_RELEASE=/opt/local/lib/libGLEW.dylib || travis_terminate 1
# compile Tulip using ninja for faster builds
- ninja -j4 || travis_terminate 1
- ninja -j4 install || travis_terminate 1
Expand Down Expand Up @@ -488,7 +488,7 @@ jobs:
# create build directory
- mkdir build && cd build
# configure Tulip complete build using cmake
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-8.0 -DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-8.0 -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DTULIP_BUILD_TESTS=ON -DTULIP_USE_CCACHE=ON -DZLIB_INCLUDE_DIR=/opt/local/include -DZLIB_LIBRARY_RELEASE=/opt/local/lib/libz.dylib -DPNG_INCLUDE_DIR=/opt/local/include -DPNG_LIBRARY_RELEASE=/opt/local/lib/libpng.dylib -DJPEG_INCLUDE_DIR=/opt/local/include -DJPEG_LIBRARY=/opt/local/lib/libjpeg.dylib
- cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/install -DCMAKE_C_COMPILER=/opt/local/bin/clang-mp-8.0 -DCMAKE_CXX_COMPILER=/opt/local/bin/clang++-mp-8.0 -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DTULIP_BUILD_TESTS=ON -DTULIP_USE_CCACHE=ON -DZLIB_INCLUDE_DIR=/opt/local/include -DZLIB_LIBRARY_RELEASE=/opt/local/lib/libz.dylib -DPNG_INCLUDE_DIR=/opt/local/include -DPNG_LIBRARY_RELEASE=/opt/local/lib/libpng.dylib -DJPEG_INCLUDE_DIR=/opt/local/include -DJPEG_LIBRARY=/opt/local/lib/libjpeg.dylib -DGLEW_SHARED_LIBRARY_RELEASE=/opt/local/lib/libGLEW.dylib
# compile Tulip using ninja for faster builds
- ninja -j4
- ninja -j4 install
Expand Down
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,14 @@ IF(NOT TULIP_BUILD_CORE_ONLY)
# Glew
FIND_PACKAGE(GLEW REQUIRED)
# if needed, when using cmake 3.15, define some undefined glew variables
IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.15.0" AND NOT GLEW_INCLUDE_DIR)
GET_TARGET_PROPERTY(GLEW_INCLUDE_DIR GLEW::GLEW INTERFACE_INCLUDE_DIRECTORIES)
SET(GLEW_LIBRARY GLEW::GLEW)
ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS "3.15.0" AND NOT GLEW_INCLUDE_DIR)
IF(NOT ${CMAKE_VERSION} VERSION_LESS "3.15.0")
IF(NOT GLEW_INCLUDE_DIR)
GET_TARGET_PROPERTY(GLEW_INCLUDE_DIR GLEW::GLEW INTERFACE_INCLUDE_DIRECTORIES)
ENDIF(NOT GLEW_INCLUDE_DIR)
IF(NOT GLEW_LIBRARY)
SET(GLEW_LIBRARY GLEW::GLEW)
ENDIF(NOT GLEW_LIBRARY)
ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS "3.15.0")

# Jpeg
FIND_PACKAGE(JPEG REQUIRED)
Expand Down

0 comments on commit ed8f1a0

Please sign in to comment.