-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cmake_linux.cmake
More file actions
84 lines (69 loc) · 2.13 KB
/
.cmake_linux.cmake
File metadata and controls
84 lines (69 loc) · 2.13 KB
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
82
83
84
set( EXEC incaribus )
set( EXT cpp )
## IMPORTED SHARED LIBRARY NAME
set( SHARED_LIB_NAME
Jsnp
SWEngine-OpenGLModule
glfw
yaml-cpp
openal
sndfile
)
## IMPORTED SHARED LIBRARY LOCATION
set( SHARED_LIB_LOCATION
${CMAKE_SOURCE_DIR}/libraries/libJsnp.so
${CMAKE_SOURCE_DIR}/libraries/libSWEngine-OpenGLModule.so
${CMAKE_SOURCE_DIR}/libraries/libglfw.so
${CMAKE_SOURCE_DIR}/libraries/libyaml-cpp.so
${CMAKE_SOURCE_DIR}/libraries/libopenal.so
${CMAKE_SOURCE_DIR}/libraries/libsndfile.so
)
## <=====================================>
## GET SOURCES
## <=====================================>
foreach(filePath ${SRC_FOLDERS})
string(APPEND TMP "${filePath}*.${EXT};")
endforeach()
file(GLOB SRC ${TMP})
## <=====================================>
## OUTPUT
## <=====================================>
## EXECUTABLE
add_executable(${EXEC} ${SRC})
## or SHARED LIB
# add_library(${EXEC} SHARED ${SRC})
## or STATIC LIB
# add_library(${EXEC} STATIC ${SRC})
## <=====================================>
## ADD INCLUDES
## <=====================================>
target_include_directories(${EXEC} PRIVATE ${INC_FOLDERS})
include_directories (/usr/include/freetype2)
target_link_libraries(${EXEC} PUBLIC ${FT})
## <=====================================>
## ADD PARAMETER
## <=====================================>
if (UNIX)
target_compile_options(${EXEC} PRIVATE -g3)
endif (UNIX)
## <=====================================>
## SHARED LIBRARY LINKING
## <=====================================>
list(LENGTH SHARED_LIB_NAME list_len)
math(EXPR LIST_LEN "${list_len} - 1")
foreach(ctr RANGE ${LIST_LEN})
list(GET SHARED_LIB_NAME ${ctr} lib)
list(GET SHARED_LIB_LOCATION ${ctr} loc)
add_library(${lib} SHARED IMPORTED)
set_target_properties(${lib} PROPERTIES
IMPORTED_LOCATION ${loc}
)
endforeach()
target_link_libraries(${EXEC}
PUBLIC
${SHARED_LIB_NAME}
)
## <=====================================>
## PACKAGE LINKING
## <=====================================>
## <=====================================>