-
Notifications
You must be signed in to change notification settings - Fork 71
/
plugins.macros.cmake
39 lines (35 loc) · 1.63 KB
/
plugins.macros.cmake
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
macro(add_vm_plugin NAME)
set(${NAME}_SOURCES_EXTRA ${ARGN})
if(OSX)
file(GLOB ${NAME}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/osx/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/unix/*.c
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/osx
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/unix
)
elseif(UNIX)
file(GLOB ${NAME}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/unix/*.c
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/unix
)
else()
file(GLOB ${NAME}_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/common/*.c
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/src/win/*.c
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/common
${CMAKE_CURRENT_SOURCE_DIR}/extracted/plugins/${NAME}/include/win
)
endif()
message(STATUS "Adding plugin: ${NAME}")
addLibraryWithRPATH(${NAME} ${${NAME}_SOURCES} ${${NAME}_SOURCES_EXTRA})
endmacro()