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")