-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
81 lines (59 loc) · 1.49 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
cmake_minimum_required(VERSION 3.1)
#add_definitions(-DEXCLUDE_LOG_MODULE)
#add_compile_definitions(MG_ENABLE_OPENSSL=1)
# cpp version (be different for other platform, TODO).
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(LIB_NAME libikrigretarget)
project(${LIB_NAME})
########### other prj
if(UNIX AND NOT APPLE)
set(EMBED_ASSIMP ON)
endif()
if(EMBED_ASSIMP)
add_subdirectory(contrib/assimp)
endif()
########### cxx flags
# linux
if(UNIX AND NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -no-pie -fPIC")
endif()
################## lib
# add lib then set property
# or add lib with property
add_library(${LIB_NAME} STATIC)
################## inc
include_directories(./code)
################## src
file(GLOB APP_HEADER_FILES
./code/*.h ./code/*.hpp
)
file(GLOB APP_SOURCE_FILES
./code/*.cpp
)
# SET(APP_SOURCE_FILES
# ./code/*.cpp
# )
SET (ALL_SRCS
${APP_HEADER_FILES}
${APP_SOURCE_FILES}
)
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${ALL_SRCS})
target_sources(${LIB_NAME} PRIVATE
${ALL_SRCS}
)
#file(GLOB mysrc "./code/*.cpp")
################## lib
#add_library(${LIB_NAME} STATIC # SHARED
# ${mysrc}
#)
################## link
if(APPLE)
else()
#find_package(OpenGL REQUIRED COMPONENTS OpenGL EGL GLX)
#message(STATUS "OPENGL_INCLUDE_DIR: ${OPENGL_INCLUDE_DIR}")
#target_link_libraries(${LIB_NAME} PRIVATE OpenGL::OpenGL OpenGL::EGL OpenGL::GLX)
endif()
########### other prj
add_subdirectory(test)
add_subdirectory(python)