116 lines
3.0 KiB
CMake
116 lines
3.0 KiB
CMake
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
||
|
||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||
|
||
#项目名称
|
||
PROJECT(Triangle-ES2)
|
||
|
||
#dubug 模式-----------------------it's very import for Debug
|
||
set(CMAKE_BUILD_TYPE "Debug")
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fPIC -pipe -g -O0 -Wall -W -D_REENTRANT -D__VXWORKS__")
|
||
|
||
#编译宏定义
|
||
#ADD_DEFINITIONS(-D_MWV207_OS_=106)
|
||
#ADD_DEFINITIONS(-DXORG_SHOW=1)
|
||
|
||
# 添加头文件
|
||
include_directories(
|
||
"/usr/local/include"
|
||
)
|
||
|
||
# 设置第三方库的查找目录,LINUX必须放在前面,后面会找不到,原因未知
|
||
link_directories(
|
||
"/usr/lib"
|
||
"/usr/local/lib"
|
||
/lib/aarch64-linux-gnu/mali
|
||
)
|
||
|
||
|
||
|
||
# 增加头文件库
|
||
#include_directories( "/usr/lib/gcc/aarch64-linux-gnu/9/include" )
|
||
|
||
# 查找指定目录下的所有*.h头文件,并将文件列表保存到指定变量
|
||
#file(GLOB_RECURSE JPG_Include "./jpgLib_prj/src/*.h")
|
||
# 查找指定目录下的所有*.c源文件,并将文件列表保存到指定变量
|
||
#file(GLOB_RECURSE JPG_SRC "./jpgLib_prj/src/*.c")
|
||
|
||
# 添加指定目录下的所有头文件和源文件,并将文件列表保存到指定变量
|
||
|
||
set(Triangle_SRC src/triangle-es2.c)
|
||
|
||
|
||
|
||
|
||
# 将指定目录下的头文件和源文件放到指定目录下
|
||
source_group("src" FILES ${Triangle_SRC})
|
||
|
||
|
||
# 编译成可执行文件
|
||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build/bin)
|
||
|
||
add_executable(TriangleEsDemo ${Triangle_SRC})
|
||
|
||
# 查找对应的第三方库
|
||
#find_library(OPENGL_LIBRARY GL "OpenGL library")
|
||
#find_library(GLU_LIBRARY GLU "GLU library" )
|
||
|
||
set(DEP_LIBS
|
||
dl
|
||
gbm
|
||
m
|
||
pthread
|
||
EGL
|
||
mali
|
||
)
|
||
|
||
# 链接第三方库和自己工程生成的库
|
||
target_link_libraries(TriangleEsDemo
|
||
${DEP_LIBS}
|
||
)
|
||
|
||
|
||
add_executable(TriangleEsX11Demo src/triangle-es2-x11.c)
|
||
target_link_libraries(TriangleEsX11Demo
|
||
${DEP_LIBS}
|
||
X11
|
||
)
|
||
|
||
|
||
add_executable(SimpleEs src/simple-es2.c)
|
||
|
||
# 查找对应的第三方库
|
||
#find_library(OPENGL_LIBRARY GL "OpenGL library")
|
||
#find_library(GLU_LIBRARY GLU "GLU library" )
|
||
|
||
|
||
# 链接第三方库和自己工程生成的库
|
||
target_link_libraries(SimpleEs
|
||
${DEP_LIBS}
|
||
)
|
||
|
||
|
||
add_executable(color_test src/color_test.c)
|
||
|
||
target_link_libraries(color_test
|
||
dl
|
||
)
|
||
|
||
# # demo
|
||
# add_executable(demo src/demo.cpp)
|
||
|
||
# # 链接第三方库和自己工程生成的库
|
||
# target_link_libraries(demo
|
||
# -Wl,--start-group
|
||
# #stdc++
|
||
# glut
|
||
# dl
|
||
# m
|
||
# pthread
|
||
# X11
|
||
# EGL
|
||
# GLESv2
|
||
# OpenGL
|
||
# GL
|
||
# -Wl,--end-group)
|