This repository has been archived by the owner on Dec 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
/
CMakeLists.txt
54 lines (45 loc) · 1.54 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
cmake_minimum_required(VERSION 3.1)
project(WebChimera.js)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif()
endforeach()
elseif(APPLE)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/deps/VLC.app/Contents/MacOS/lib")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
file(GLOB SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
src/[^.]*.cpp
src/[^.]*.h
README.md
package.json
)
include_directories(${CMAKE_JS_INC} deps)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/deps/libvlc_wrapper)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB} libvlc_wrapper)
if(WIN32)
target_compile_definitions(${PROJECT_NAME}
PUBLIC
BUILDING_NODE_EXTENSION
)
endif()
if(NOT WIN32 OR ${NODE_ARCH} STREQUAL "x64")
target_compile_definitions(${PROJECT_NAME}
PUBLIC
V8_31BIT_SMIS_ON_64BIT_ARCH
V8_COMPRESS_POINTERS
V8_REVERSE_JSARGS
)
endif()
#get_cmake_property(_variableNames VARIABLES)
#foreach(_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()