Skip to content

Commit fcf9e8e

Browse files
committed
First commit
0 parents  commit fcf9e8e

File tree

500 files changed

+171442
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

500 files changed

+171442
-0
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
build*
2+
*_build
3+
/install
4+
/logs/*
5+
CMakeLists.txt.*
6+
7+
# backup files
8+
*~
9+
10+
# config
11+
.localconfig
12+
*.bat
13+
14+
# IDE project files
15+
*.sublime-project
16+
*.sublime-workspace
17+

.travis.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
language: cpp
2+
3+
sudo: required
4+
dist: trusty
5+
6+
os:
7+
- linux
8+
- osx
9+
10+
compiler:
11+
- gcc
12+
- clang
13+
14+
env:
15+
global:
16+
- CMAKE_OPTIONS="-DOPTION_BUILD_EXAMPLES=On"
17+
matrix:
18+
- CMAKE_CONFIGURATION=release BUILD_DIR=build
19+
- CMAKE_CONFIGURATION=debug BUILD_DIR=build-debug
20+
21+
matrix:
22+
exclude:
23+
- os: osx
24+
compiler: gcc
25+
26+
before_install:
27+
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-add-repository ppa:cginternals/backports-ppa -y; fi
28+
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get update -qq; fi
29+
- if [ $TRAVIS_OS_NAME == linux ]; then sudo apt-get install -qq cmake cppcheck clang-tidy-3.8; fi
30+
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install cppcheck; fi
31+
32+
before_script:
33+
- ./configure
34+
- if [ $CMAKE_CONFIGURATION == release ]; then ./configure; fi
35+
- if [ $CMAKE_CONFIGURATION == debug ]; then ./configure debug; fi
36+
37+
script:
38+
- travis_wait cmake --build $BUILD_DIR
39+
- cmake --build $BUILD_DIR --target test
40+
- cmake --build $BUILD_DIR --target check-all

AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

CMakeLists.txt

+208
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
2+
#
3+
# CMake options
4+
#
5+
6+
# CMake version
7+
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
8+
9+
#
10+
# Configure CMake environment
11+
#
12+
13+
# Register general cmake commands
14+
include(cmake/Custom.cmake)
15+
16+
# Set policies
17+
set_policy(CMP0028 NEW) # ENABLE CMP0028: Double colon in target name means ALIAS or IMPORTED target.
18+
set_policy(CMP0054 NEW) # ENABLE CMP0054: Only interpret if() arguments as variables or keywords when unquoted.
19+
set_policy(CMP0042 NEW) # ENABLE CMP0042: MACOSX_RPATH is enabled by default.
20+
set_policy(CMP0063 NEW) # ENABLE CMP0063: Honor visibility properties for all target types.
21+
22+
# Include cmake modules
23+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
24+
25+
include(GenerateExportHeader)
26+
27+
set(WriterCompilerDetectionHeaderFound NOTFOUND)
28+
# This module is only available with CMake >=3.1, so check whether it could be found
29+
# BUT in CMake 3.1 this module doesn't recognize AppleClang as compiler, so just use it as of CMake 3.2
30+
if (${CMAKE_VERSION} VERSION_GREATER "3.2")
31+
include(WriteCompilerDetectionHeader OPTIONAL RESULT_VARIABLE WriterCompilerDetectionHeaderFound)
32+
endif()
33+
34+
# Include custom cmake modules
35+
include(cmake/GetGitRevisionDescription.cmake)
36+
include(cmake/HealthCheck.cmake)
37+
include(cmake/GenerateTemplateExportHeader.cmake)
38+
39+
40+
#
41+
# Project description and (meta) information
42+
#
43+
44+
# Get git revision
45+
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
46+
string(SUBSTRING "${GIT_SHA1}" 0 12 GIT_REV)
47+
if(NOT GIT_SHA1)
48+
set(GIT_REV "0")
49+
endif()
50+
51+
# Meta information about the project
52+
set(META_PROJECT_NAME "glscbinding")
53+
set(META_PROJECT_DESCRIPTION "A C++ binding for the OpenGL SC API, generated using the gl.xml specification.")
54+
set(META_AUTHOR_ORGANIZATION "CG Internals GmbH")
55+
set(META_AUTHOR_DOMAIN "https://github.com/cginternals/glscbinding/")
56+
set(META_AUTHOR_MAINTAINER "[email protected]")
57+
set(META_VERSION_MAJOR "1")
58+
set(META_VERSION_MINOR "0")
59+
set(META_VERSION_PATCH "0")
60+
set(META_VERSION_REVISION "${GIT_REV}")
61+
set(META_VERSION "${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}")
62+
set(META_NAME_VERSION "${META_PROJECT_NAME} v${META_VERSION} (${META_VERSION_REVISION})")
63+
set(META_CMAKE_INIT_SHA "6a6f30b38a1cee31ccac3f091816f28e0f6bce4b")
64+
65+
string(MAKE_C_IDENTIFIER ${META_PROJECT_NAME} META_PROJECT_ID)
66+
string(TOUPPER ${META_PROJECT_ID} META_PROJECT_ID)
67+
68+
#
69+
# Project configuration options
70+
#
71+
72+
# Project options
73+
option(BUILD_SHARED_LIBS "Build shared instead of static libraries." ON)
74+
option(OPTION_SELF_CONTAINED "Create a self-contained install with all dependencies." OFF)
75+
option(OPTION_BUILD_TESTS "Build tests." ON)
76+
option(OPTION_BUILD_GPU_TESTS "Build tests that require an OpenGL context." ON)
77+
option(OPTION_BUILD_DOCS "Build documentation." OFF)
78+
option(OPTION_BUILD_TOOLS "Build tools." ON)
79+
option(OPTION_BUILD_EXAMPLES "Build examples." OFF)
80+
option(OPTION_BUILD_WITH_BOOST_THREAD "Use boost::thread instead of std::thread." OFF)
81+
82+
83+
#
84+
# Declare project
85+
#
86+
87+
# Generate folders for IDE targets (e.g., VisualStudio solutions)
88+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
89+
set(IDE_FOLDER "")
90+
91+
# Declare project
92+
project(${META_PROJECT_NAME} C CXX)
93+
94+
# Set output directories
95+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
96+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
97+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
98+
99+
# Create version file
100+
file(WRITE "${PROJECT_BINARY_DIR}/VERSION" "${META_NAME_VERSION}")
101+
102+
103+
#
104+
# Compiler settings and options
105+
#
106+
107+
include(cmake/CompileOptions.cmake)
108+
109+
110+
#
111+
# Project Health Check Setup
112+
#
113+
114+
# Add cmake-init template check cmake targets
115+
add_check_template_target(${META_CMAKE_INIT_SHA})
116+
117+
# Configure health check tools
118+
enable_cppcheck(On)
119+
enable_clang_tidy(On)
120+
121+
122+
#
123+
# Deployment/installation setup
124+
#
125+
126+
# Get project name
127+
set(project ${META_PROJECT_NAME})
128+
129+
# Check for system dir install
130+
set(SYSTEM_DIR_INSTALL FALSE)
131+
if("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr" OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
132+
set(SYSTEM_DIR_INSTALL TRUE)
133+
endif()
134+
135+
# Installation paths
136+
if(UNIX AND SYSTEM_DIR_INSTALL)
137+
# Install into the system (/usr/bin or /usr/local/bin)
138+
set(INSTALL_ROOT "share/${project}") # /usr/[local]/share/<project>
139+
set(INSTALL_CMAKE "share/${project}/cmake") # /usr/[local]/share/<project>/cmake
140+
set(INSTALL_EXAMPLES "share/${project}") # /usr/[local]/share/<project>
141+
set(INSTALL_DATA "share/${project}") # /usr/[local]/share/<project>
142+
set(INSTALL_BIN "bin") # /usr/[local]/bin
143+
set(INSTALL_SHARED "lib") # /usr/[local]/lib
144+
set(INSTALL_LIB "lib") # /usr/[local]/lib
145+
set(INSTALL_INCLUDE "include") # /usr/[local]/include
146+
set(INSTALL_DOC "share/doc/${project}") # /usr/[local]/share/doc/<project>
147+
set(INSTALL_SHORTCUTS "share/applications") # /usr/[local]/share/applications
148+
set(INSTALL_ICONS "share/pixmaps") # /usr/[local]/share/pixmaps
149+
set(INSTALL_INIT "/etc/init") # /etc/init (upstart init scripts)
150+
else()
151+
# Install into local directory
152+
set(INSTALL_ROOT ".") # ./
153+
set(INSTALL_CMAKE "cmake") # ./cmake
154+
set(INSTALL_EXAMPLES ".") # ./
155+
set(INSTALL_DATA ".") # ./
156+
set(INSTALL_BIN ".") # ./
157+
set(INSTALL_SHARED "lib") # ./lib
158+
set(INSTALL_LIB "lib") # ./lib
159+
set(INSTALL_INCLUDE "include") # ./include
160+
set(INSTALL_DOC "doc") # ./doc
161+
set(INSTALL_SHORTCUTS "misc") # ./misc
162+
set(INSTALL_ICONS "misc") # ./misc
163+
set(INSTALL_INIT "misc") # ./misc
164+
endif()
165+
166+
# Set runtime path
167+
set(CMAKE_SKIP_BUILD_RPATH FALSE) # Add absolute path to all dependencies for BUILD
168+
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) # Use CMAKE_INSTALL_RPATH for INSTALL
169+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE) # Do NOT add path to dependencies for INSTALL
170+
171+
if(NOT SYSTEM_DIR_INSTALL)
172+
# Find libraries relative to binary
173+
if(APPLE)
174+
set(CMAKE_INSTALL_RPATH "@loader_path/../../../${INSTALL_LIB}")
175+
else()
176+
set(CMAKE_INSTALL_RPATH "$ORIGIN/${INSTALL_LIB}")
177+
endif()
178+
endif()
179+
180+
181+
#
182+
# Project modules
183+
#
184+
185+
add_subdirectory(source)
186+
add_subdirectory(docs)
187+
add_subdirectory(deploy)
188+
189+
190+
#
191+
# Deployment (global project files)
192+
#
193+
194+
# Install version file
195+
install(FILES "${PROJECT_BINARY_DIR}/VERSION" DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
196+
197+
# Install cmake find script for the project
198+
install(FILES ${META_PROJECT_NAME}-config.cmake DESTINATION ${INSTALL_ROOT} COMPONENT dev)
199+
200+
# Install the project meta files
201+
install(FILES AUTHORS DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
202+
install(FILES LICENSE DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
203+
install(FILES README.md DESTINATION ${INSTALL_ROOT} COMPONENT runtime)
204+
205+
# Install runtime data
206+
if (TARGET cubescape OR TARGET cubescape-log OR TARGET cubescape-qt)
207+
install(DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION ${INSTALL_DATA} COMPONENT examples_data)
208+
endif()

LICENSE

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
Copyright (c) 2018-2018 Computer Graphics Systems Group at the Hasso-Plattner-Institute and CG Internals GmbH, Germany.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
6+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7+
8+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*glscbinding* is a cross-platform C++ binding for the [OpenGL SC API](https://www.khronos.org/openglsc/).

appveyor.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
version: '{build}'
2+
branches:
3+
only:
4+
- master
5+
clone_folder: c:\projects\glscbinding
6+
image:
7+
- Visual Studio 2013
8+
- Visual Studio 2015
9+
- Visual Studio 2017
10+
configuration:
11+
- Release
12+
- Debug
13+
platform:
14+
- x64
15+
environment:
16+
matrix:
17+
- arch: Win64
18+
# - arch: #does not work, Release|x64 not a valid target
19+
matrix:
20+
fast_finish: true
21+
22+
# skip unsupported combinations
23+
init:
24+
- set arch=
25+
- if "%arch%"=="Win64" ( set arch= Win64)
26+
- echo %arch%
27+
- echo %APPVEYOR_BUILD_WORKER_IMAGE%
28+
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" ( set generator="Visual Studio 15 2017%arch%" )
29+
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" ( set generator="Visual Studio 14 2015%arch%" )
30+
- if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" ( set generator="Visual Studio 12 2013%arch%" )
31+
- echo %generator%
32+
33+
before_build:
34+
- cmd: >-
35+
mkdir build
36+
37+
cd build
38+
39+
cmake --version
40+
41+
cmake .. -G %generator%
42+
43+
build:
44+
project: c:\projects\glscbinding\build\glscbinding.sln
45+
verbosity: minimal
46+
parallel: true
47+
only_commits:
48+
files:
49+
- CMakeLists.txt
50+
- appveyor.yml
51+
- sources/
52+
- cmake/

cginternals-logo.png

1.83 KB
Loading

cmake/CheckTemplate.cmake

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
#
3+
# Get cmake-init latest commit SHA on master
4+
#
5+
6+
file(DOWNLOAD
7+
"https://api.github.com/repos/cginternals/cmake-init/commits/master"
8+
"${PROJECT_BINARY_DIR}/cmake-init.github.data"
9+
)
10+
file(READ
11+
"${PROJECT_BINARY_DIR}/cmake-init.github.data"
12+
CMAKE_INIT_INFO
13+
)
14+
15+
string(REGEX MATCH
16+
"\"sha\": \"([0-9a-f]+)\","
17+
CMAKE_INIT_SHA
18+
${CMAKE_INIT_INFO})
19+
20+
string(SUBSTRING
21+
${CMAKE_INIT_SHA}
22+
8
23+
40
24+
CMAKE_INIT_SHA
25+
)
26+
27+
#
28+
# Get latest cmake-init commit on this repository
29+
#
30+
31+
# APPLIED_CMAKE_INIT_SHA can be set by parent script
32+
if(NOT APPLIED_CMAKE_INIT_SHA)
33+
# [TODO]: Get from git commit list (see cmake_init/source/scripts/check_template.sh)
34+
set(APPLIED_CMAKE_INIT_SHA "")
35+
endif ()
36+
37+
if("${APPLIED_CMAKE_INIT_SHA}" STREQUAL "")
38+
message(WARNING
39+
"No cmake-init version detected, could not verify up-to-dateness. "
40+
"Set the cmake-init version by defining a META_CMAKE_INIT_SHA for your project."
41+
)
42+
return()
43+
endif()
44+
45+
if(${APPLIED_CMAKE_INIT_SHA} STREQUAL ${CMAKE_INIT_SHA})
46+
message(STATUS "cmake-init template is up-to-date (${CMAKE_INIT_SHA})")
47+
else()
48+
message(STATUS "cmake-init template needs an update https://github.com/cginternals/cmake-init/compare/${APPLIED_CMAKE_INIT_SHA}...master")
49+
endif()

0 commit comments

Comments
 (0)