Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_printer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhenfei.zhang
fmp_printer
Commits
52686b0b
Commit
52686b0b
authored
Dec 18, 2018
by
xiaojing.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.Cmake优化
parent
fd9b4844
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
35 deletions
+48
-35
CMakeLists.txt
+48
-35
No files found.
CMakeLists.txt
View file @
52686b0b
...
...
@@ -7,13 +7,32 @@ set(CMAKE_AUTOMOC ON)
set
(
CMAKE_AUTOUIC ON
)
set
(
CMAKE_AUTORCC ON
)
find_package
(
Qt5 COMPONENTS Widgets Gui Core Network Concurrent Multimedia PrintSupport REQUIRED
)
#通过批处理文件获取版本和资源文件需要的一些信息
find_path
(
BATPATH fmprc_cmake.bat PATHS
${
CMAKE_CURRENT_SOURCE_DIR
}
/../
)
MESSAGE
(
bat path is
${
BATPATH
}
)
set
(
CMAKE_BUILD_TYPE Debug
)
find_package
(
Qt5 COMPONENTS Widgets Gui Core Sql Network Concurrent REQUIRED
)
IF
(
CMAKE_BUILD_TYPE MATCHES
"Debug"
)
message
(
"debug mode "
)
set
(
CTKCORE CTKCored.lib
)
set
(
CTKPLUG CTKPluginFrameworkd.lib
)
set
(
LOG4 log4cxxd
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG
${
fmPOS_SOURCE_DIR
}
/debug/plugins
)
ELSEIF
(
CMAKE_BUILD_TYPE MATCHES
"Release"
)
set
(
CTKCORE CTKCore.lib
)
set
(
LOG4 log4cxx
)
set
(
CTKPLUG CTKPluginFramework.lib
)
set
(
CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE
${
fmPOS_SOURCE_DIR
}
/Release/plugins
)
ENDIF
()
set
(
ORIGIN_TARGET
${
TARGET_NAME
}
)
set
(
ABSPATH
${
BATPATH
}
/fmprc_cmake.bat
)
execute_process
(
COMMAND
${
ABSPATH
}
${
TARGET_NAME
}
OUTPUT_VARIABLE VER
)
#通过批处理文件获取版本和资源文件需要的一些信息
message
(
STATUS
"The bat :
${
ORIGIN_TARGET
}
"
)
set
(
ABSPATH
${
fmPOS_SOURCE_DIR
}
/fmprc_cmake.bat
)
message
(
STATUS
"The bat :
${
ABSPATH
}
"
)
execute_process
(
COMMAND
${
ABSPATH
}
${
TARGET_NAME
}
WORKING_DIRECTORY
${
fmPOS_SOURCE_DIR
}
OUTPUT_VARIABLE VER
)
string
(
REGEX REPLACE
"
\r
|
\n
"
" "
VERTEMP
${
VER
}
)
string
(
STRIP
${
VERTEMP
}
SEXY_STRING
)
string
(
REPLACE
" "
";"
SEXY_LIST
${
SEXY_STRING
}
)
...
...
@@ -52,40 +71,34 @@ configure_file(
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/../pluginrc.h"
"
${
PROJECT_SOURCE_DIR
}
/res/resource.h"
COPYONLY
)
configure_file
(
"
${
PROJECT_SOURCE_DIR
}
/../pluginrc.rc"
"
${
PROJECT_SOURCE_DIR
}
/res/
${
ORIGIN_TARGET
}
.rc"
COPYONLY
)
file
(
GLOB DIR_SRCS
${
PROJECT_SOURCE_DIR
}
/*.h
${
PROJECT_SOURCE_DIR
}
/*.cpp
${
PROJECT_SOURCE_DIR
}
/QsLog/*.h
${
PROJECT_SOURCE_DIR
}
/QsLog/*.cpp
${
PROJECT_SOURCE_DIR
}
/global/*.h
${
PROJECT_SOURCE_DIR
}
/global/*.cpp
)
#编译及相关信息配置
set
(
CMAKE_BUILD_TYPE Debug
)
find_package
(
Qt5 COMPONENTS Widgets Gui Core Network Concurrent Multimedia PrintSupport REQUIRED
)
IF
(
CMAKE_BUILD_TYPE MATCHES
"Debug"
)
message
(
"debug mode "
)
set
(
CTKCORE CTKCored
)
set
(
CTKPLUG CTKPluginFrameworkd
)
set
(
LIBRARY_OUTPUT_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/../debug/plugins
)
ELSEIF
(
CMAKE_BUILD_TYPE MATCHES
"Release"
)
set
(
CTKCORE CTKCore
)
set
(
CTKPLUG CTKPluginFramework
)
set
(
LIBRARY_OUTPUT_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/../Release/plugins
)
ENDIF
()
INCLUDE_DIRECTORIES
(
../include/ctk
)
INCLUDE_DIRECTORIES
(
../include/interface
)
link_directories
(
${
BATPATH
}
/lib
)
link_libraries
(
${
CTKCORE
}
${
CTKPLUG
}
)
aux_source_directory
(
../fmp_printer/ DIR_SRCS
)
aux_source_directory
(
../fmp_printer/QsLog/ DIR_LOG
)
aux_source_directory
(
../fmp_printer/global/ DIR_GLOBAL
)
INCLUDE_DIRECTORIES
(
${
fmPOS_SOURCE_DIR
}
/include/ctk
)
INCLUDE_DIRECTORIES
(
${
fmPOS_SOURCE_DIR
}
/include/interface
)
INCLUDE_DIRECTORIES
(
${
fmPOS_SOURCE_DIR
}
/include/log4cxx
)
INCLUDE_DIRECTORIES
(
${
fmPOS_SOURCE_DIR
}
/include/common
)
ADD_LIBRARY
(
${
TARGET_NAME
}
SHARED
${
DIR_SRCS
}
${
DIR_LOG
}
${
DIR_GLOBAL
}
${
RCC_SCRS
}
)
link_directories
(
${
fmPOS_SOURCE_DIR
}
/lib
)
target_link_libraries
(
${
TARGET_NAME
}
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::Multimedia Qt5::PrintSupport
)
ADD_LIBRARY
(
${
TARGET_NAME
}
SHARED
${
DIR_SRCS
}
res/fmp_printer.qrc res/fmp_printer.rc
)
target_link_libraries
(
${
TARGET_NAME
}
Qt5::Widgets
Qt5::Core
Qt5::Gui
Qt5::Network
Qt5::Concurrent
Qt5::Multimedia
Qt5::PrintSupport
${
CTKCORE
}
${
CTKPLUG
}
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment