-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
30 lines (29 loc) · 1.56 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
PROJECT(VIEWER1.0)
cmake_minimum_required(VERSION 2.8)
FILE(WRITE ./include/config.h "#define MESH_VIEWER_PATH \"${PROJECT_SOURCE_DIR}\"")
add_compile_options(-Wall -g -O)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -no-pie)
#生成可执行程序
#set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11)
#set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -std=c99)
add_subdirectory(./src)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
link_libraries(-Wl,--start-group glfw3 GL Xrandr Xi X11 Xxf86vm pthread Xinerama Xcursor m dl freetype png z harfbuzz -Wl,--end-group )
add_compile_options(-lstdc++)
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
if("$CMAKE_CXX_COMPILER_ID" STREQUAL "GNU")
add_compile_options(-static-libstdc++ -static-libgcc)
endif()
link_libraries( glfw3 opengl32)
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")
include_directories(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/thirdpart/glad/include ${PROJECT_SOURCE_DIR}/thirdpart/cstructures/include ${PROJECT_SOURCE_DIR}/thirdpart/freetype/include ${PROJECT_SOURCE_DIR}/thirdpart/glfw/include)
link_directories(${PROJECT_SOURCE_DIR}/lib ${PROJECT_SOURCE_DIR}/temp_libs )
aux_source_directory(${PROJECT_SOURCE_DIR}/Demo mysrc)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/temp_libs)
#link_libraries()
#add_subdirectory(/src)
add_executable(main ${mysrc})
target_link_libraries(main -Wl,--start-group freetype viewer cstructures
-Wl,--end-group)
#target_link_libraries(main -Wl,--start-group viewer_matrix4x4 viewer_openglalg viewer_world_manager cstructures freetype -Wl,--end-group)