Skip to content

Commit

Permalink
Adsk Contrib - Improve GLEW detection (#1112)
Browse files Browse the repository at this point in the history
* Adsk Contrib - Improve GLEW detection

Signed-off-by: Patrick Hodoul <[email protected]>

* Remove the CI build workaround

Signed-off-by: Patrick Hodoul <[email protected]>

* Unlock the CI builds with coding style changes

Signed-off-by: Patrick Hodoul <[email protected]>

* Fix a bad change in the GitHub workflow file

Signed-off-by: Patrick Hodoul <[email protected]>
  • Loading branch information
hodoulp authored Aug 21, 2020
1 parent 214a9d2 commit 3a0dfd8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@ jobs:
CXX: ${{ matrix.cxx-compiler }}
CC: ${{ matrix.cc-compiler }}
steps:
# TODO: Remove this workaround following resolution of:
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/43
- name: Setup container
run: sudo rm -rf /usr/local/lib64/cmake/glew
if: matrix.vfx-cy == 2020
- name: Checkout
uses: actions/checkout@v2
- name: Create build directories
Expand Down
21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,24 @@ if(OCIO_BUILD_GPU_TESTS OR OCIO_BUILD_APPS)
endif()

if(NOT APPLE)
find_package(GLEW)
# On some Linux platform, the glew-config.cmake is found first so make it explicit
# to fall back on the regular search if not found.
find_package(GLEW CONFIG QUIET)
if(NOT GLEW_FOUND)
package_root_message(GLEW)
set(OCIO_GL_ENABLED OFF)
find_package(GLEW)
if(NOT GLEW_FOUND)
package_root_message(GLEW)
set(OCIO_GL_ENABLED OFF)
endif()
else()
# Expected variables GLEW_LIBRARIES and GLEW_INCLUDE_DIRS are missing so create
# the mandatory one. Note that the cmake bug is now fixed (issue 19662).
if(NOT GLEW_LIBRARIES)
set(GLEW_LIBRARIES GLEW::GLEW)
endif()
endif()
endif()
endif()

find_package(GLUT)
if(NOT GLUT_FOUND)
package_root_message(GLUT)
Expand Down
11 changes: 5 additions & 6 deletions src/apps/ociobakelut/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
// Copyright Contributors to the OpenColorIO Project.


#include <cmath>
#include <cstdlib>
#include <iostream>
Expand All @@ -14,10 +15,10 @@ namespace OCIO = OCIO_NAMESPACE;
#include "apputils/argparse.h"
#include "ocioicc.h"


static std::string outputfile;

static int
parse_end_args(int argc, const char *argv[])
static int parse_end_args(int argc, const char *argv[])
{
if(argc>0)
{
Expand All @@ -27,8 +28,7 @@ parse_end_args(int argc, const char *argv[])
return 0;
}

OCIO::GroupTransformRcPtr
parse_luts(int argc, const char *argv[]);
OCIO::GroupTransformRcPtr parse_luts(int argc, const char *argv[]);

int main (int argc, const char* argv[])
{
Expand Down Expand Up @@ -392,8 +392,7 @@ int main (int argc, const char* argv[])
// then atof() will likely try to convert "--invlut" to its double equivalent,
// resulting in an invalid (or at least undesired) scale value.

OCIO::GroupTransformRcPtr
parse_luts(int argc, const char *argv[])
OCIO::GroupTransformRcPtr parse_luts(int argc, const char *argv[])
{
OCIO::GroupTransformRcPtr groupTransform = OCIO::GroupTransform::Create();
const char *lastCCCId = NULL; // Ugly to use this but using GroupTransform::getTransform()
Expand Down

0 comments on commit 3a0dfd8

Please sign in to comment.