Commit Graph

156 Commits

Author SHA1 Message Date
David G Yu
dbb75b650c Find TBB using TBB's CMake config
Updated the CMake build to locate TBB using TBB's CMake config
and deleted the local cmake/FindTBB.cmake module.

While the source code remains compatible with earlier versions of
TBB, updated the minimum TBB version from 4.4 to 2018 since that
is the earliest TBB release to include a CMake config.  This is
the version of TBB specified for the CY2019 VFX Reference Platform.

Tested on Windows, Linux, and macOS using TBB 2018 Update 6,
TBB 2020 Update 3, and oneTBB 2021.10.0
2023-09-11 13:02:25 -07:00
David G Yu
a1f13b4767 Fixed inconsistent warning levels for MSVC builds
The MSVC build has been setting /W3 as an override for /Wall but this
has been causing generator specfic build inconsistencies.

For examples, this override works when using the Visual Studio generators,
but not when using the Ninja generator. This causes Ninja to build using
/Wall instead of /W3.

This removes the initial setting of /Wall to avoid this inconsistency.

We plan to continue to address compiler warnings to allow us to raise
this warning level further but that is a separate task.
2023-08-25 21:00:32 -07:00
David G Yu
90a8122c2d Further simplification of OpenGL import targets
The internal GL API Loader implementation is self contained and does
not require the system OpenGL implementation at build time, so we
don't need the OpenGL::GL import target for this case.

An earlier change added the OpenGL::GL import target for legacy uses
of GLEW and it remains correct there.

Fixes #1277
2023-07-17 17:45:25 -07:00
Barry Fowler
db1ac8045c
Merge pull request #1310 from davidgyu/dev_cuda_nvcc_defaults_fix
Improved documentation for OSD_CUDA_NVCC_FLAGS
2023-07-06 15:03:50 -07:00
Barry Fowler
dbb23be83d
Merge pull request #1297 from davidgyu/dev_cxx_version
Updated C++ standard to C++14
2023-07-06 14:56:14 -07:00
David G Yu
b96d8af08a Improved documentation for OSD_CUDA_NVCC_FLAGS
Also fixed the build so that obsolete CUDA gpu architectures
are specified as fallback values only when using older obsolete
versions of CUDA. We'll likely remove these fallbacks from future
releases of OpenSubdiv.

Fixes #1299
2023-06-30 15:46:51 -07:00
David G Yu
98351a9dc1 Updated C++ standard to C++14
The OpenSubdiv public interface currently requires only C++11 but we
choose this version since C++14 has been the default since GCC 6,
Clang 6, and Visual Studio 2017 (for the most part) and C++14 has been
the default for OpenSubdiv on macOS when support for Metal is enabled.

This setting is guarded so that it can be overridden by the caller when
running CMake.

Fixes #1276
2023-06-30 15:42:23 -07:00
Barry Fowler
94c85b3879
Merge pull request #1305 from davidgyu/dev_opengl_import_fix 2023-06-27 18:14:02 -07:00
Barry Fowler
e0eb6a18b5
Merge pull request #1304 from davidgyu/dev_cuda_examples_glx_fix 2023-06-27 18:13:24 -07:00
David G Yu
05abd4e826 Updated build to use OpenGL import targets.
This is a slight improvement and fixes link problems in some
cases, though we expect to further improve handling of target
depenedencies overall.

Fixes #1277
2023-06-23 14:27:11 -07:00
David G Yu
9e7b1bcdc3 Fixed example dependencies with CUDA on Linux
Added an explicit target link dependency for OpenGL::GLX when
building example programs with CUDA on systems with GLX since
GLX is used by the example code used to initialize the CUDA
device context.

This is a simple workaround and we'd like to revisit and improve
how target dependencies are handled overall.

Fixes #1294
2023-06-21 14:26:41 -07:00
David G Yu
4576083cd0 Fixed interface includes for cmake config
Added target include directories for the library targets
so that interface include directories are published with
the OpenSubdiv cmake config.

Also, removed a cmake version test which is no longer needed.

Fixes #1278
2023-06-21 12:01:50 -07:00
David G Yu
7f7528e001
Merge pull request #1296 from CraigHutchinson/patch-1
CMake: append should be used for CMAKE_MODULE_PATH
2023-04-26 17:10:27 -07:00
Craig Hutchinson
360abbe5bf
CMake: append should be used for CMAKE_MODULE_PATH
- Additionally hardened paths by using PROJECT_SOURCE_DIR
2023-02-28 14:41:37 +00:00
Thomas Thomassen
ad007c076a Corrections to allow for LLVM Clang builds on Windows. 2022-11-29 20:18:33 +01:00
David G Yu
287cb80619
Merge pull request #1242 from theblackunknown/cmake-config
Add CMake Config
2022-09-15 09:26:03 -07:00
David G Yu
3f054c7410 Updated cmake config export paths and target names
The cmake config export paths are now more consistent
with other vfx platform projects.

The target names are now more consistent with existing
opensubdiv static and dynamic library names.
2022-09-15 02:34:02 -07:00
David G Yu
cb1657be17 Implemented alternate Python 'stringify' tool
This simplifies build dependencies when cross-compiling
or when building multi-architecture binaries.

For backward compatibility with earlier releases, the compiled
C++ version of this tool is used when no Python interpreter is found.
2022-09-12 17:19:27 -07:00
David G Yu
d13501eeb3 Fixed broken public headers dependency
Fixes a doc build error resulting from the CMake minimum version update.
2022-09-11 18:22:41 -07:00
David G Yu
e627e4827e Updated CMake minimum version to 3.12 2022-09-09 09:11:37 -07:00
David G Yu
141cd19673
Merge branch 'dev' into dev-no-framework-option 2022-09-02 18:10:23 -07:00
MACHIZAUD Andréa
ee4d4e9f60 Add CMake Config 2022-05-09 09:41:23 +02:00
Thomas Thomassen
beb095d7e3 Add option to not generate frameworks under macOS. Ref #1236 2021-10-20 20:35:40 +02:00
Thomas Thomassen
53ee16c66c Move cmake_minimum_required to be the first thing in CMakeLists.txt. 2021-10-09 09:27:52 +02:00
David G Yu
87d2db0ffc Additional renaming fix missed in previous commit 2021-02-04 14:49:38 -08:00
David G Yu
37e8468207 Updated for rename of 'master' branch to 'release'
Documentation and build scripts have been updated
to accommodate this renaming.
2021-02-04 10:09:42 -08:00
David G Yu
84e0e3de6b
Merge pull request #1206 from thomthom/cmake-sub-project
Adjustments to CMake config for use as a sub-project.
2021-02-03 11:35:16 -08:00
David G Yu
654a539638 Fixed link dependency on dl library
This fixes a missing link dependency in the GL API Loader
on platforms like Linux that require linking with '-ldl'.
2021-02-03 10:11:00 -08:00
Thomas Thomassen
ce90f0fca7 Adjustments to CMake config for use as a sub-project. 2021-02-03 14:06:23 +01:00
David G Yu
e7dfecc3bf Additional fixes for dynamic and static linking
Updated to link the GL loader objects directly
along with the osd GPU objects for both static
and dynamic libraries.
2020-04-01 21:54:21 -07:00
David G Yu
b93725be26 Fixed static library linking on Windows
Changed the glLoader library to an object library
instead of a static library to improve generating
opensubdiv static libraries.
2020-04-01 12:13:36 -07:00
David G Yu
cb596ffb8a Added option to control building shared libraries
This adds support for the standard global option
  BUILD_SHARED_LIBS
to select whether to build shared libraries.

Note that building shared DLL libraries is still
not yet supported on Windows.
2020-03-09 17:50:49 -07:00
David G Yu
b5cdfe380b Disabled use of GLEW by default. 2020-03-06 11:37:55 -08:00
David G Yu
f3f28995a5 Enabled internal GL API loader as GLEW alternative
At build time, the preprocessor symbols: OSD_USES_GLEW or
OSD_USES_INTERNAL_GLAPILOADER determine the GL API loader
that will be used by the OSD library.
2020-03-06 11:37:55 -08:00
David G Yu
28f2574bc5 Moved GLEW dependencies to glLoader wrapper
This introduces an internal glLoader library which allows
most of the implementation to be agnostic about the
implementation of the GL loading library.  Specifically,
this removes references to the GLEW headers and libraries
from the rest of the source code and build system.
2020-03-03 17:10:30 -08:00
David G Yu
16a5c3993f Moved GL version check out of FindGLEW.cmake
This allows us to make use of this even when
we are not using GLEW.
2020-03-03 15:04:24 -08:00
David G Yu
081028ca10 Fixed CMP0054 warnings in top-level CMakeLists.txt 2020-02-24 10:59:51 -08:00
George ElKoura
92341f7c1e Prefix OpenSubdiv CMake macros
This fixes issue #1157 by adding "osd" as a prefix to public macros.
2019-08-17 16:44:30 -07:00
George ElKoura
45a03a460b Turn on C++11 in clang when building with Metal
The example code that uses Metal forces C++11 features, therefore
we have to turn it on clang so that we can enable the building of
compatible code that can be used by Metal and GL at the same time.
2019-03-09 11:42:45 -08:00
George ElKoura
08c04c9a61 Turn off CUDA deprecation warnings until addressed
As mentioned in issue #997, OpenSubdiv still uses CUDA functionality
that is being deprecated.  When warnings are treated as errors, this
can make OpenSubdiv fail to compile.  For now, we turn off these
deprecation warnings until we can address them.
2019-03-01 22:40:26 -08:00
barry
c424594625 Major step towards consistent use of include paths in source files:
- changed the main OPENSUBDIV_INCLUDE_DIR to exclude ./opensubdiv
    - updated CMakeLists.txt files in non-examples to use only this path
    - updated CMakeLists.txt files in examples to append ./opensubdiv to path
    - updated source in regression/common to use #include <opensubdiv/...>
    - updated source in examples/common to use #include <opensubdiv/...>
    - deferred source in examples to be updated on a case-by-case basis
2018-10-09 10:51:31 -07:00
David G Yu
3e640239f7 Added build options: NO_GLFW NO_GLFW_X11 2017-07-28 11:28:07 -07:00
Michael Harris
30cd2df37c Added Metal support 2017-04-19 16:49:53 -07:00
Takahito Tejima
044b25e818 Merge pull request #918 from davidgyu/dev_fix_spelling_731
Fixed spelling errors and typos in comments
2017-01-26 13:18:01 -08:00
Mike Erwin
0beb654f0b spelling
Noticed a few typos when browsing comments. Proceeded with a "manual
spell check", reading all comments and tweaking spelling, grammar,
punctuation.

Didn't bother with Hbr library.

Comments only, no functional changes.
2017-01-11 12:40:49 -08:00
Thomas Thomassen
cd6cedc1ac Added option to build using MSVC with static CRT. 2017-01-10 15:42:59 -08:00
Jeremy Cowles
ff380188e6 WIN32 Glew fixes to CMakeLists.txt
Previously, glew was forced to static linkage on windows, even when
dynamic Glew libraries were linked which would result in linker errors.

In this change, static glew libraries are detected by looking for the "s"
suffix convention on the library (though, maybe this should be handled in
the FindGlew module).
2017-01-06 09:52:19 -08:00
Nicholas Yue
1f6dc6c949 Fix find_package for zlib which requires all upper case ZLIB 2016-10-13 19:59:22 -07:00
David G Yu
838fce27ab Exposed control for Gregory derivative weight eval
The symbol OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES
determines the method used to compute derivative weights
for Gregory basis patches.

Setting this symbol during CMake configuration (and
hence during C++ and shader compilation) will enable
the use of true derivative weights.

The default behavior is to use a simpler approximation
for consistency with earlier releases.
2016-10-11 18:50:25 -07:00
David G Yu
c824dc34e0 Fixed CUDA build with newer SDKs
Recent CUDA SDKs no longer support the "compute_11"
gpu architecture. We now fallback to "compute_20"
instead for newer SDK versions. Additionally, this
behavior can be overriden using the new CMake list
variable OSD_CUDA_NVCC_FLAGS so that it is easier
for clients to target newer architectures and specify
additional arguments.
2016-09-29 21:04:42 -07:00