Skip to content

Commit 6521468

Browse files
build related
1 parent 98d08da commit 6521468

File tree

17 files changed

+204
-1
lines changed

17 files changed

+204
-1
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
################################################################################
2+
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
3+
################################################################################
4+
5+
.vs/
6+
Debug/
7+
Release/
8+
*.vcxproj.user

CMakeLists.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
project(Samples)
4+
5+
# set the platform
6+
option(BUILD_LINUX "Build samples for running on Linux x86_64" ON)
7+
option(BUILD_ARM "Build samples for running on ARM x86" OFF)
8+
option(BUILD_ARM64 "Build samples for running on ARM x64" OFF)
9+
10+
option(BUILD_C_HELLOWORLD "Build the sample HelloWorld under ./samples/C/HelloWorld" ON)
11+
option(BUILD_C_GENERALSETTINGS "Build the sample GeneralSettings under ./samples/C/GeneralSettings" ON)
12+
option(BUILD_CPP_HELLOWORLD "Build the sample HelloWorld under ./samples/C++/HelloWorld" ON)
13+
option(BUILD_CPP_GENERALSETTINGS "Build the sample GeneralSettings under ./samples/C++/GeneralSettings" ON)
14+
option(BUILD_CPP_BATCHDECODE "Build the sample BatchDecode under ./samples/C++/Performance/BatchDecode" ON)
15+
option(BUILD_CPP_VIDEODECODING "Build the sample VideoDecoding under ./samples/C++/VideoDecoding" ON)
16+
17+
if(BUILD_LINUX)
18+
set(DBRLIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/Linux)
19+
elseif(BUILD_ARM)
20+
set(DBRLIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/ARM32)
21+
add_compile_options(-DDM_ARM -D__ARM_NEON__ -mfpu=neon)
22+
elseif(BUILD_ARM64)
23+
set(DBRLIB ${CMAKE_CURRENT_SOURCE_DIR}/lib/ARM64)
24+
add_compile_options(-DDM_ARM -D__ARM_NEON__)
25+
else()
26+
message(FATAL_ERROR "Please specify a supported platform")
27+
endif()
28+
29+
set (CMAKE_CXX_STANDARD 11)
30+
add_compile_options(-O2 -fPIC)
31+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXECUTABLE_LINKER_FLAGS} -O2 -fvisibility=hidden -fvisibility-inlines-hidden -L ${DBRLIB} -Wl,-rpath,${DBRLIB} -Wl,-rpath,'$ORIGIN' -static-libgcc -static-libstdc++ -s")
32+
33+
#include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)
34+
35+
36+
if(BUILD_C_HELLOWORLD)
37+
add_subdirectory(samples/C/HelloWorld)
38+
endif()
39+
if(BUILD_C_GENERALSETTINGS)
40+
add_subdirectory(samples/C/GeneralSettings)
41+
endif()
42+
if(BUILD_CPP_HELLOWORLD)
43+
add_subdirectory(samples/C++/HelloWorld)
44+
endif()
45+
if(BUILD_CPP_GENERALSETTINGS)
46+
add_subdirectory(samples/C++/GeneralSettings)
47+
endif()
48+
if(BUILD_CPP_BATCHDECODE)
49+
add_subdirectory(samples/C++/Performance/BatchDecode)
50+
endif()
51+
if(BUILD_CPP_VIDEODECODING)
52+
add_subdirectory(samples/C++/VideoDecoding)
53+
endif()
54+
55+
if(BUILD_C_HELLOWORLD OR BUILD_C_GENERALSETTINGS OR BUILD_CPP_HELLOWORLD OR BUILD_CPP_GENERALSETTINGS)
56+
File(COPY ./images/AllSupportedBarcodeTypes.png DESTINATION images)
57+
endif()
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
project(GeneralSettings)
4+
5+
file(GLOB FILE_SRCS
6+
GeneralSettings.cpp
7+
)
8+
add_executable(GeneralSettings ${FILE_SRCS})
9+
set_target_properties(GeneralSettings PROPERTIES SKIP_BUILD_RPATH TRUE)
10+
target_link_libraries(GeneralSettings DynamsoftBarcodeReader)
11+

samples/C++/GeneralSettings/GeneralSettings.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,21 @@
7373
<PropertyGroup Label="UserMacros" />
7474
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7575
<LinkIncremental>true</LinkIncremental>
76+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
77+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
7678
</PropertyGroup>
7779
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7880
<LinkIncremental>false</LinkIncremental>
81+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
82+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
7983
</PropertyGroup>
8084
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8185
<LinkIncremental>true</LinkIncremental>
86+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
8287
</PropertyGroup>
8388
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8489
<LinkIncremental>false</LinkIncremental>
90+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
8591
</PropertyGroup>
8692
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8793
<ClCompile>

samples/C++/HelloWorld/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
project(HelloWorld)
4+
5+
file(GLOB FILE_SRCS
6+
HelloWorld.cpp
7+
)
8+
add_executable(HelloWorld ${FILE_SRCS})
9+
set_target_properties(HelloWorld PROPERTIES SKIP_BUILD_RPATH TRUE)
10+
target_link_libraries(HelloWorld DynamsoftBarcodeReader)
11+

samples/C++/HelloWorld/HelloWorld.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,21 @@
7272
<PropertyGroup Label="UserMacros" />
7373
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7474
<LinkIncremental>true</LinkIncremental>
75+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
76+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
7577
</PropertyGroup>
7678
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
7779
<LinkIncremental>false</LinkIncremental>
80+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
81+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
7882
</PropertyGroup>
7983
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8084
<LinkIncremental>true</LinkIncremental>
85+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
8186
</PropertyGroup>
8287
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8388
<LinkIncremental>false</LinkIncremental>
89+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
8490
</PropertyGroup>
8591
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8692
<ClCompile>

samples/C++/Performance/BatchDecode/BarcodeStatisticsRecorder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
2+
#include "stdafx.h"
33
#include <string>
44
#include <list>
55
#include<vector>

samples/C++/Performance/BatchDecode/BatchDecode.vcxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,21 @@
8383
<PropertyGroup Label="UserMacros" />
8484
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8585
<LinkIncremental>true</LinkIncremental>
86+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
87+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
8688
</PropertyGroup>
8789
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
8890
<LinkIncremental>false</LinkIncremental>
91+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
92+
<IntDir>$(Platform)\$(Configuration)\</IntDir>
8993
</PropertyGroup>
9094
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
9195
<LinkIncremental>true</LinkIncremental>
96+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
9297
</PropertyGroup>
9398
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
9499
<LinkIncremental>false</LinkIncremental>
100+
<OutDir>$(SolutionDir)$(Platform)\</OutDir>
95101
</PropertyGroup>
96102
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
97103
<ClCompile>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
project(BatchDecode)
4+
5+
file(GLOB FILE_SRCS
6+
BatchDecode.cpp
7+
BarcodeStatisticsRecorder.cpp
8+
BarcodeFileReader.cpp
9+
DbrBarcodeFileReader.cpp
10+
)
11+
12+
add_executable(BatchDecode ${FILE_SRCS})
13+
set_target_properties(BatchDecode PROPERTIES SKIP_BUILD_RPATH TRUE)
14+
target_link_libraries(BatchDecode DynamsoftBarcodeReader)
15+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// stdafx.h : include file for standard system include files,
2+
// or project specific include files that are used frequently, but
3+
// are changed infrequently
4+
//
5+
6+
#pragma once
7+
8+
#include <stdio.h>
9+
10+
#if defined(_WIN64) || defined(_WIN32)
11+
#include "targetver.h"
12+
#include <tchar.h>
13+
#else
14+
#include <string.h>
15+
#include <strings.h>
16+
#endif
17+
18+
19+
// TODO: reference additional headers your program requires here

0 commit comments

Comments
 (0)