Skip to content

Commit 1725e38

Browse files
committed
Add server and webpack
1 parent aa51dfa commit 1725e38

File tree

12 files changed

+6114
-151
lines changed

12 files changed

+6114
-151
lines changed

.gitignore

Lines changed: 3 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,4 @@
1-
build
2-
third-party
3-
4-
# Created by https://www.gitignore.io/api/osx,vim,c++,linux,windows
5-
# Edit at https://www.gitignore.io/?templates=osx,vim,c++,linux,windows
6-
7-
### C++ ###
8-
# Prerequisites
9-
*.d
10-
11-
# Compiled Object files
12-
*.slo
13-
*.lo
14-
*.o
15-
*.obj
16-
17-
# Precompiled Headers
18-
*.gch
19-
*.pch
20-
21-
# Compiled Dynamic libraries
22-
*.so
23-
*.dylib
24-
*.dll
25-
26-
# Fortran module files
27-
*.mod
28-
*.smod
29-
30-
# Compiled Static libraries
31-
*.lai
32-
*.la
33-
*.a
34-
*.lib
35-
36-
# Executables
37-
*.exe
38-
*.out
39-
*.app
40-
41-
### Linux ###
42-
*~
43-
44-
# temporary files which can be created if a process still has a handle open of a deleted file
45-
.fuse_hidden*
46-
47-
# KDE directory preferences
48-
.directory
49-
50-
# Linux trash folder which might appear on any partition or disk
51-
.Trash-*
52-
53-
# .nfs files are created when an open file is removed but is still being accessed
54-
.nfs*
55-
56-
### OSX ###
57-
# General
581
.DS_Store
59-
.AppleDouble
60-
.LSOverride
61-
62-
# Icon must end with two \r
63-
Icon
64-
65-
# Thumbnails
66-
._*
67-
68-
# Files that might appear in the root of a volume
69-
.DocumentRevisions-V100
70-
.fseventsd
71-
.Spotlight-V100
72-
.TemporaryItems
73-
.Trashes
74-
.VolumeIcon.icns
75-
.com.apple.timemachine.donotpresent
76-
77-
# Directories potentially created on remote AFP share
78-
.AppleDB
79-
.AppleDesktop
80-
Network Trash Folder
81-
Temporary Items
82-
.apdisk
83-
84-
### Vim ###
85-
# Swap
86-
[._]*.s[a-v][a-z]
87-
[._]*.sw[a-p]
88-
[._]s[a-rt-v][a-z]
89-
[._]ss[a-gi-z]
90-
[._]sw[a-p]
91-
92-
# Session
93-
Session.vim
94-
95-
# Temporary
96-
.netrwhist
97-
# Auto-generated tag files
98-
tags
99-
# Persistent undo
100-
[._]*.un~
101-
102-
### Windows ###
103-
# Windows thumbnail cache files
104-
Thumbs.db
105-
ehthumbs.db
106-
ehthumbs_vista.db
107-
108-
# Dump file
109-
*.stackdump
110-
111-
# Folder config file
112-
[Dd]esktop.ini
113-
114-
# Recycle Bin used on file shares
115-
$RECYCLE.BIN/
116-
117-
# Windows Installer files
118-
*.cab
119-
*.msi
120-
*.msix
121-
*.msm
122-
*.msp
123-
124-
# Windows shortcuts
125-
*.lnk
126-
127-
# End of https://www.gitignore.io/api/osx,vim,c++,linux,windows
2+
build/
3+
node_modules/
4+
server/public/

CMakeLists.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
cmake_minimum_required( VERSION 3.1 )
2-
project( HelloCV )
1+
set(OPENCV_DIR "../opencv")
2+
3+
cmake_minimum_required(VERSION 3.1)
4+
project(HelloCV)
35

46
# Use C++ 11 by default
5-
set( CMAKE_CXX_STANDARD 11 )
7+
set(CMAKE_CXX_STANDARD 11)
68

79
# Set Release as default build type
810
if(NOT CMAKE_BUILD_TYPE)
911
set(CMAKE_BUILD_TYPE Release)
1012
endif(NOT CMAKE_BUILD_TYPE)
1113

1214
# Does not work
13-
# find_package( OpenCV REQUIRED PATHS third-party/opencv-4.1.0/build_wasm NO_DEFAULT_PATH)
15+
# find_package(OpenCV REQUIRED PATHS "${OPENCV_DIR}/build_wasm" NO_DEFAULT_PATH)
1416

1517
# Needed for opencv2/opencv.hpp
16-
include_directories( third-party/opencv-4.1.0/include )
18+
include_directories("${OPENCV_DIR}/include")
1719

1820
# Needed by opencv.hpp for opencv2/opencv_modules.hpp
19-
include_directories( third-party/opencv-4.1.0/build_wasm )
21+
include_directories("${OPENCV_DIR}/build_wasm")
2022

2123
# Needed by opencv_modules.hpp for every module
22-
file( GLOB opencv_include_modules "third-party/opencv-4.1.0/modules/*/include" )
23-
include_directories( ${opencv_include_modules} )
24+
file(GLOB opencv_include_modules "${OPENCV_DIR}/modules/*/include")
25+
include_directories(${opencv_include_modules})
2426

2527
# Our hello world executable
26-
add_executable( hello hello.cpp )
28+
add_executable(hello src/hello.cpp)
2729

2830
# Link to opencv.js precompiled libraries
29-
file( GLOB opencv_js "third-party/opencv-4.1.0/build_wasm/lib/*.a" )
30-
target_link_libraries( hello ${opencv_js} )
31+
file(GLOB opencv_js "${OPENCV_DIR}/build_wasm/lib/*.a")
32+
target_link_libraries(hello ${opencv_js})
3133

3234
# Specify linker arguments
33-
# set_target_properties( hello PROPERTIES LINK_FLAGS "-s DEMANGLE_SUPPORT=1 --preload-file assets --bind" )
34-
set_target_properties( hello PROPERTIES LINK_FLAGS "-s DEMANGLE_SUPPORT=1 --bind" )
35+
# set_target_properties(hello PROPERTIES LINK_FLAGS "-s DEMANGLE_SUPPORT=1 --preload-file assets --bind")
36+
set_target_properties(hello PROPERTIES LINK_FLAGS "-s DEMANGLE_SUPPORT=1 --bind")

build-wasm.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
mkdir -p build
2+
( \
3+
cd build; \
4+
emconfigure cmake ..; \
5+
emmake make clean; \
6+
emmake make; \
7+
cd ..\
8+
)

index.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)