changed build system for cmake instead of qmake
This commit is contained in:
parent
7976b6e484
commit
23c6be227f
57
CMakeLists.txt
Normal file
57
CMakeLists.txt
Normal file
@ -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}
|
||||||
|
)
|
@ -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
|
|
Loading…
x
Reference in New Issue
Block a user