-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
executable file
·42 lines (35 loc) · 1.1 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
cmake_minimum_required(VERSION 3.1)
# -------------- Plugin Config ---------------
execute_process(COMMAND node -p "require('@nodegui/nodegui/plugin').CMAKE_HELPER_FILE"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE NODEGUI_PLUGIN_CMAKE_HELPER
)
string(REPLACE "\n" "" NODEGUI_PLUGIN_CMAKE_HELPER ${NODEGUI_PLUGIN_CMAKE_HELPER})
string(REPLACE "\"" "" NODEGUI_PLUGIN_CMAKE_HELPER ${NODEGUI_PLUGIN_CMAKE_HELPER})
include("${NODEGUI_PLUGIN_CMAKE_HELPER}")
# -------------- User Config ---------------
set(PLUGIN_ADDON_NAME "nodegui_plugin_title_bar")
project(${PLUGIN_ADDON_NAME})
set(OS_SPECIFIC_SRC "")
if(APPLE)
set(OS_SPECIFIC_SRC
"${PROJECT_SOURCE_DIR}/src/main.mm"
)
else()
set(OS_SPECIFIC_SRC
"${PROJECT_SOURCE_DIR}/src/main.cpp"
)
endif()
add_library(${PLUGIN_ADDON_NAME} SHARED
"${CMAKE_JS_SRC}"
"${OS_SPECIFIC_SRC}"
)
AddPluginConfig(${PLUGIN_ADDON_NAME})
target_include_directories(${PLUGIN_ADDON_NAME} PRIVATE
"${CMAKE_JS_INC}"
"${PROJECT_SOURCE_DIR}"
)
target_link_libraries(${PLUGIN_ADDON_NAME} PRIVATE
"${CMAKE_JS_LIB}"
Qt5::Widgets
)