forked from manujoz/voice-recognition
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (51 loc) · 2.07 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
cmake_minimum_required(VERSION 3.15)
# Name of the project (will be the name of the plugin)
project (voice-recognition)
# Essential include files to build a node addon,
# you should add this line in every CMake.js based project.
include_directories(${CMAKE_JS_INC})
# Declare the source files location
file(GLOB SOURCE_FILES "src/cpp/*.cpp" "src/cpp/*.h")
# This line will tell CMake that we're building a shared library
# from the above source files
# named after the project's name
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
# Flags to compile
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:twoPhase-)
target_compile_options(${PROJECT_NAME} PRIVATE /fp:precise) #/fp:strict is incompatible with /clr
# Add properties
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_ROOTNAMESPACE ${PROJECT_NAME})
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_KEYWORD "ManagedCProj")
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_CLRSupport "true")
set_property(TARGET ${PROJECT_NAME} PROPERTY DOTNET_TARGET_FRAMEWORK_VERSION "4.8")
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_GLOBAL_WindowsTargetPlatformVersion "10.0.18362.0")
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES_COPY_LOCAL "false")
# Add assemblies
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES
"System"
"System.Data"
"System.Data.Entity"
"System.Data.Linq"
"System.Data.Services.Client"
"System.Data.Services.Design"
"System.Web.Abstractions"
"System.Web.Extensions"
"System.Speech"
)
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCE_CsVoiceRecognition "bin/CsVoiceRecognition.dll")
# Set common language runtime
set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX ""
SUFFIX ".node"
COMMON_LANGUAGE_RUNTIME ""
) # "pure" and "safe" unsupported in VS 2017
# Add directories
target_include_directories(${PROJECT_NAME}
PRIVATE ${CMAKE_SOURCE_DIR}/node_modules/node-addon-api
PRIVATE ${CMAKE_JS_INC})
# Add libraries
target_link_libraries(${PROJECT_NAME}
PUBLIC
${CMAKE_JS_LIB}
)
##message(STATUS "EJEMPLO DE IMPRIMIR MENSAJE")