From 23c6be227f302b98aa26f075a64826e45b2e129e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselme=20Fran=C3=A7ois?= Date: Mon, 7 Sep 2015 09:39:35 +0200 Subject: [PATCH] changed build system for cmake instead of qmake --- CMakeLists.txt | 57 +++++++++++++++++++++++++++++++++++++ sparrowRenderer.pro | 69 --------------------------------------------- 2 files changed, 57 insertions(+), 69 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 sparrowRenderer.pro diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..32113fc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,57 @@ +project(SparrowRenderer) +cmake_minimum_required(VERSION 2.8) + +find_package(OpenGL REQUIRED) + +if(WIN32) + set(SYSTEM_LIB_PATH "win32") +else(WIN32) + set(SYSTEM_LIB_PATH "linux") +endif(WIN32) + +set(LIB_SRC_LIST + asciientity.cpp + asciimodule.cpp + framebuffer.cpp + gbuffermodule.cpp + gridmesh.cpp + lights.cpp + meshbuilder.cpp + phongentity.cpp + phongmaterial.cpp + phongmodule.cpp + shader.cpp + skyboxmodule.cpp + sparrowrenderer.cpp + sphere.cpp + texture.cpp +) + +set(LIBRARY_NAME ${PROJECT_NAME}) + +set(DEPENDENCIES_ROOT ${PROJECT_SOURCE_DIR}/../cpp_dependencies) +set(INCLUDE_ROOT ${DEPENDENCIES_ROOT}/include) +set(LIB_ROOT ${DEPENDENCIES_ROOT}/lib/${SYSTEM_LIB_PATH}) + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIB_ROOT}) #for SHARED +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_ROOT}) #for STATIC + +add_library(${LIBRARY_NAME} STATIC ${LIB_SRC_LIST}) +add_definitions(-std=c++11) + +include_directories( + ${INCLUDE_ROOT} +) + +find_library(GLM_LIBRARY + NAMES + glm + PATHS + ${LIB_ROOT} +) + +target_link_libraries( + ${LIBRARY_NAME} + ${GLEW_LIBRARY} + ${OPENGL_LIBRARIES} +) diff --git a/sparrowRenderer.pro b/sparrowRenderer.pro deleted file mode 100644 index 6f6c19a..0000000 --- a/sparrowRenderer.pro +++ /dev/null @@ -1,69 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2015-06-16T15:37:51 -# -#------------------------------------------------- - -QT -= core gui - -Debug:TARGET = sparrowRendererd -Release:TARGET = sparrowRenderer -TEMPLATE = lib -CONFIG += c++11 staticlib - -INCLUDEPATH += ../cpp_dependencies/include -win32 { - DESTDIR = $$PWD/../cpp_dependencies/lib/win32 - LIBS += -L../../cpp_dependencies/lib/win32 - LIBS += -lglew32 -lopengl32 -lglu32 -} -unix { - DESTDIR = $$PWD/../cpp_dependencies/lib/linux - LIBS += -L../../cpp_dependencies/lib/linux - LIBS += -lGL -lGLEW -lGLU -} - -SOURCES += shader.cpp \ - gridmesh.cpp \ - texture.cpp \ - phongmaterial.cpp \ - sphere.cpp \ - lights.cpp \ - sparrowrenderer.cpp \ - phongmodule.cpp \ - skyboxmodule.cpp \ - framebuffer.cpp \ - meshbuilder.cpp \ - asciimodule.cpp \ - asciientity.cpp \ - phongentity.cpp \ - gbuffermodule.cpp - -HEADERS += shader.h \ - camera.h \ - glassert.h \ - material.h \ - gridmesh.h \ - texture.h \ - phongmaterial.h \ - sphere.h \ - lights.h \ - sparrowrenderer.h \ - phongmodule.h \ - skyboxmodule.h \ - module.h \ - resource.h \ - framebuffer.h \ - meshbuilder.h \ - mesh.h \ - image.h \ - asciimodule.h \ - asciientity.h \ - phongentity.h \ - entity.h \ - gbuffermodule.h - -OTHER_FILES += *.frag *.vert *.glsl *.todo - -DISTFILES += \ - modules.todo