-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'gsoc2023-aos_sphere_demo-denizdiktas' of github.com:CGA…
…L/cgal-public-dev into gsoc2023-aos_sphere_demo-denizdiktas
- Loading branch information
Showing
4 changed files
with
608 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (C) 2022 The Qt Company Ltd. | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
cmake_minimum_required(VERSION 3.16) | ||
project(earth LANGUAGES CXX) | ||
|
||
if(NOT DEFINED INSTALL_EXAMPLESDIR) | ||
set(INSTALL_EXAMPLESDIR "examples") | ||
endif() | ||
|
||
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/opengl/earth") | ||
|
||
find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL OpenGLWidgets Widgets) | ||
|
||
qt_standard_project_setup() | ||
|
||
qt_add_executable(earth | ||
main.cpp | ||
mainwidget.cpp mainwidget.h | ||
) | ||
|
||
set_target_properties(earth PROPERTIES | ||
WIN32_EXECUTABLE TRUE | ||
MACOSX_BUNDLE TRUE | ||
) | ||
|
||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE") | ||
|
||
target_link_libraries(earth PRIVATE | ||
Qt6::Core | ||
Qt6::Gui | ||
Qt6::OpenGL | ||
Qt6::OpenGLWidgets | ||
Qt6::Widgets | ||
) | ||
|
||
|
||
install(TARGETS earth | ||
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" | ||
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" | ||
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
#include <QApplication> | ||
#include <QLabel> | ||
#include <QSurfaceFormat> | ||
|
||
#ifndef QT_NO_OPENGL | ||
#include "mainwidget.h" | ||
#endif | ||
|
||
#include <iostream> | ||
using namespace std; | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication app(argc, argv); | ||
|
||
QSurfaceFormat format; | ||
format.setVersion(3, 3); | ||
format.setProfile(QSurfaceFormat::CoreProfile); | ||
//format.setProfile(QSurfaceFormat::CompatibilityProfile); | ||
//format.setOptions(QSurfaceFormat::DeprecatedFunctions); | ||
//QSurfaceFormat::setDefaultFormat(format); | ||
format.setDepthBufferSize(24); | ||
QSurfaceFormat::setDefaultFormat(format); | ||
|
||
app.setApplicationName("cube"); | ||
app.setApplicationVersion("0.1"); | ||
#ifndef QT_NO_OPENGL | ||
MainWidget widget; | ||
widget.show(); | ||
#else | ||
QLabel note("OpenGL Support required"); | ||
note.show(); | ||
#endif | ||
return app.exec(); | ||
} |
Oops, something went wrong.