68 lines
1.3 KiB
CMake
68 lines
1.3 KiB
CMake
project(SparrowRenderer)
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
if(WIN32)
|
|
set(SYSTEM_LIB_PATH "win32")
|
|
set(GLEW_LIB_NAME "glew32")
|
|
else(WIN32)
|
|
set(SYSTEM_LIB_PATH "linux")
|
|
set(GLEW_LIB_NAME "GLEW")
|
|
endif(WIN32)
|
|
|
|
set(LIB_SRC_LIST
|
|
framebuffer.cpp
|
|
gbuffer.cpp
|
|
lights.cpp
|
|
meshbuilder.cpp
|
|
phongentity.cpp
|
|
phongmaterial.cpp
|
|
phongmodule.cpp
|
|
shader.cpp
|
|
skyboxmodule.cpp
|
|
sparrowrenderer.cpp
|
|
parametricmesh.cpp
|
|
texture.cpp
|
|
scene.cpp
|
|
deferredmodule.cpp
|
|
forwardmodule.cpp
|
|
shadersource.cpp
|
|
light.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
|
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "Debug")
|
|
set(CPP_DEFINES -DRENDER_DEBUG)
|
|
endif()
|
|
|
|
file(GLOB LIBRARY_RES_FILES *.h *.frag *.vert)
|
|
|
|
add_library(${LIBRARY_NAME} STATIC ${LIB_SRC_LIST} ${LIBRARY_RES_FILES})
|
|
add_definitions(-std=c++11 ${CPP_DEFINES})
|
|
|
|
include_directories(
|
|
${INCLUDE_ROOT}
|
|
)
|
|
|
|
find_library(GLEW_LIBRARY
|
|
NAMES
|
|
${GLEW_LIB_NAME}
|
|
PATHS
|
|
${LIB_ROOT}
|
|
)
|
|
|
|
target_link_libraries(
|
|
${LIBRARY_NAME}
|
|
${GLEW_LIBRARY}
|
|
${OPENGL_LIBRARIES}
|
|
)
|