-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
45 lines (38 loc) · 1.73 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME opengles-cpp)
project(${PROJECT_NAME})
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LIB_assimp assimp)
set(LIB_glfw3 glfw)
set(LIB_freetype freetype)
set(LIB_glesv2 GLESv2)
# link_directories(${CMAKE_SOURCE_DIR}/lib)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
find_library(LIB_assimp assimp ${CMAKE_SOURCE_DIR}/lib)
find_library(LIB_glfw3 glfw3 ${CMAKE_SOURCE_DIR}/lib)
find_library(LIB_freetype freetype ${CMAKE_SOURCE_DIR}/lib)
find_library(LIB_glesv2 glesv2 ${CMAKE_SOURCE_DIR}/lib)
endif()
message(STATUS ${CMAKE_SYSTEM_NAME})
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE release)
endif()
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/item)
include_directories(${CMAKE_SOURCE_DIR}/scene)
include_directories(${CMAKE_SOURCE_DIR}/view)
include_directories(${CMAKE_SOURCE_DIR}/factory)
include_directories(${CMAKE_SOURCE_DIR}/utiliy)
include_directories(${CMAKE_SOURCE_DIR}/include)
FILE(GLOB_RECURSE ITEM ${CMAKE_SOURCE_DIR}/item/*.cpp)
FILE(GLOB_RECURSE SCENE ${CMAKE_SOURCE_DIR}/scene/*.cpp)
FILE(GLOB_RECURSE VIEW ${CMAKE_SOURCE_DIR}/view/*.cpp)
FILE(GLOB_RECURSE FACTORY ${CMAKE_SOURCE_DIR}/factory/*.cpp)
FILE(GLOB_RECURSE UTILIY ${CMAKE_SOURCE_DIR}/utiliy/*.cpp)
FILE(GLOB MAIN "${CMAKE_SOURCE_DIR}/*.cpp")
add_executable(${PROJECT_NAME} ${MAIN} ${VIEW} ${SCENE} ${ITEM} ${FACTORY} ${UTILIY})
target_link_libraries(${PROJECT_NAME}${ARCH}${VERSION} pthread ${LIB_assimp} ${LIB_glfw3} ${LIB_freetype} ${LIB_glesv2})