if(COMMAND cmake_policy)
# Allow VERSION in the project() statement.
cmake_policy(SET CMP0048 NEW)
endif()
set(GTE_VERSION_MAJOR 5)
set(GTE_VERSION_MINOR 1)
project(Graphics VERSION ${GTE_VERSION_MAJOR}.${GTE_VERSION_MINOR})
cmake_minimum_required(VERSION 3.8)
add_subdirectory(AppendConsumeBuffers)
add_subdirectory(AreaLights)
add_subdirectory(BlendedTerrain)
add_subdirectory(BufferUpdating)
add_subdirectory(BumpMaps)
add_subdirectory(CubeMaps)
add_subdirectory(GeometryShaders)
add_subdirectory(GlossMaps)
add_subdirectory(IEEEFloatingPoint)
add_subdirectory(Lights)
add_subdirectory(LightTexture)
add_subdirectory(MultipleRenderTargets)
add_subdirectory(PlaneMeshIntersection)
add_subdirectory(ProjectedTextures)
add_subdirectory(ShaderReflection)
add_subdirectory(SphereMaps)
add_subdirectory(StructuredBuffers)
add_subdirectory(TextureArrays)
add_subdirectory(TextureUpdating)
add_subdirectory(Texturing)
add_subdirectory(VertexColoring)
add_subdirectory(VertexTextures)
add_subdirectory(WireMesh)
-
David Eberly authored
Added support to the Linux distribution for CMake executed from a command line and for Visual Studio Code. Please read the installation and release notes on how to build the libraries and samples on Linux. The shared-library executables in the Linux distribution were crashing on exit from the main program. Using gdb and the core dump, the problem appeared to be in the destruction of global objects in the gtapplications shared library. The singleton TheWindowSystem was actually created 3 times because of the way shared libraries are linked and loaded. I had added -rdynamic to the makesample.gte link line (suggested by a poster at stackoverflow). This eliminated the multiple creations of TheWindowSystem. Unfortunately, on-exit crashes still occurred, this time in the destruction of global objects in the gtgraphics shared library. The only global objects are several class-static members. To diagnose with a visual debugger, I decided to add Visual Studio Code support. With this environment, the on-exit crashes no longer occur. The CMake output files are cryptic, and I am not skilled enough to figure out what differences occur between CMake and my makefiles regarding linking and loading of shared libraries. Visual Studio Code and CMake work fine, so I am abandoning my simple Unix makefile approach. I moved the GTE/Mathematics/GPU folder to GTE/MathematicsGPU to support the new CMake and Visual Studio Code project organization on Linux. All the associated project source files had to be modified so the header includes access the new location. Some application files had to be modified. When building all configurations of the libraries and samples, g++ complained about potentially uninitialized variables in several files. None of these were a problem, but I initialized them anyway to avoid the warnings.
298c3c26