Skip to content

Commit bd38f2f

Browse files
author
Huang-Ming Huang
committed
Merge fast-1.2 branch to master
1 parent da07be5 commit bd38f2f

File tree

193 files changed

+22096
-13508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+22096
-13508
lines changed

.gitignore

-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1 @@
11
build
2-
examples/performance_test/example.h
3-
examples/performance_test/example.inl
4-
examples/performance_test/example.cpp
5-
examples/simple/MDRefreshSample.h
6-
examples/simple/MDRefreshSample.inl
7-
examples/simple/MDRefreshSample.cpp
8-
tests/test1.h
9-
tests/test1.inl
10-
tests/test1.cpp
11-
tests/test2.h
12-
tests/test2.inl
13-
tests/test2.cpp
14-
examples/message_printer/MDRefreshSample.cpp
15-
examples/message_printer/MDRefreshSample.h
16-
examples/message_printer/MDRefreshSample.inl

CMakeLists.txt

+28-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# The name of our project is "mFAST". CMakeLists files in this project can
22
# refer to the root source directory of the project as ${MFAST_SOURCE_DIR} and
33
# to the root binary directory of the project as ${MFAST_BINARY_DIR}.
4-
if(WIN32)
4+
5+
if(MSVC_IDE)
56
cmake_minimum_required (VERSION 2.8.8)
67
else()
78
cmake_minimum_required (VERSION 2.6.4)
@@ -10,7 +11,7 @@ endif()
1011
project (mFAST)
1112

1213
set(MFAST_MAJOR_VERSION 1)
13-
set(MFAST_MINOR_VERSION 0)
14+
set(MFAST_MINOR_VERSION 2)
1415
set(MFAST_PATCH_VERSION 0)
1516
set(MFAST_VERSION ${MFAST_MAJOR_VERSION}.${MFAST_MINOR_VERSION}.${MFAST_PATCH_VERSION})
1617

@@ -63,9 +64,9 @@ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
6364
# Select flags.
6465
# Initialize CXXFLAGS.
6566
if (CMAKE_COMPILER_IS_GNUCXX OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
66-
set(CMAKE_CXX_FLAGS "-W -Wall ${CMAKE_CXX_FLAGS}")
67+
set(CMAKE_CXX_FLAGS "-W -Wall ${CMAKE_CXX_FLAGS}")
6768
elseif (MSVC)
68-
add_definitions(/D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS)
69+
add_definitions(/D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS)
6970
endif()
7071

7172
# variables to be used later
@@ -83,11 +84,11 @@ link_directories (${PROJECT_BINARY_DIR}/src)
8384
# Install fast_type_gen batch file to set up the PATH environment
8485
# variable for using BOOST libraries
8586

86-
if(WIN32)
87+
if(MSVC_IDE)
8788
configure_file(invoke.bat.in
8889
"${PROJECT_BINARY_DIR}/bin/invoke.bat"
8990
@ONLY)
90-
endif(WIN32)
91+
endif(MSVC_IDE)
9192

9293
#============================================================
9394
# FASTTYPEGEN_TARGET (public macro)
@@ -96,26 +97,26 @@ endif(WIN32)
9697

9798
macro(FASTTYPEGEN_TARGET Name)
9899
set(FASTTYPEGEN_TARGET_usage "FASTTYPEGEN_TARGET(<Name> Input1 Input2 ...]")
99-
100+
set(INPUTS)
100101
foreach (input ${ARGN})
101-
get_filename_component(noext_name ${input} NAME_WE)
102-
set(FASTTYPEGEN_${Name}_INPUTS_NOEXT ${FASTTYPEGEN_${Name}_INPUTS_NOEXT} ${noext_name})
102+
get_filename_component(noext_name ${input} NAME_WE)
103+
set(FASTTYPEGEN_${Name}_INPUTS_NOEXT ${FASTTYPEGEN_${Name}_INPUTS_NOEXT} ${noext_name})
103104
endforeach(input)
104105

105106
foreach(var ${FASTTYPEGEN_${Name}_INPUTS_NOEXT})
106-
set(FASTTYPEGEN_${Name}_OUTPUTS ${FASTTYPEGEN_${Name}_OUTPUTS} ${CMAKE_CURRENT_BINARY_DIR}/${var}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${var}.h ${CMAKE_CURRENT_BINARY_DIR}/${var}.inl)
107+
set(FASTTYPEGEN_${Name}_OUTPUTS ${FASTTYPEGEN_${Name}_OUTPUTS} ${CMAKE_CURRENT_BINARY_DIR}/${var}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${var}.h ${CMAKE_CURRENT_BINARY_DIR}/${var}.inl)
107108
endforeach(var)
108109

109110
foreach (input ${ARGN})
110-
set(INPUTS ${INPUTS} ${CMAKE_CURRENT_SOURCE_DIR}/${input})
111+
set(INPUTS ${INPUTS} ${CMAKE_CURRENT_SOURCE_DIR}/${input})
111112
endforeach(input)
112113

113-
114114
## Notice that the file copy operator is performed at the time when "cmake" is called and "Makefiles" are generated.
115115
## Not at the time when "make" is called.
116116
# file(COPY ${ARGN} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
117117

118-
if (WIN32)
118+
119+
if (MSVC_IDE)
119120
add_custom_command(
120121
OUTPUT ${FASTTYPEGEN_${Name}_OUTPUTS}
121122
COMMAND ${PROJECT_BINARY_DIR}/bin/invoke.bat
@@ -145,14 +146,15 @@ endmacro()
145146
# Recurse into the "src" and "unit-tests" subdirectories. This does not actually
146147
# cause another cmake executable to run. The same process will walk through
147148
# the project's entire directory structure.
149+
enable_testing()
148150

149151
add_subdirectory (tests)
150152

151153
if (BUILD_SHARED_LIBS)
152-
set(MFAST_LIBRARIES mfast_coder mfast)
154+
set(MFAST_LIBRARIES mfast_coder mfast_xml_parser mfast)
153155
add_definitions( -DMFAST_DYN_LINK )
154156
else()
155-
set(MFAST_LIBRARIES mfast_coder_static mfast_static)
157+
set(MFAST_LIBRARIES mfast_coder_static mfast_xml_parser_static mfast_static)
156158
endif()
157159

158160
add_subdirectory (examples)
@@ -170,11 +172,14 @@ add_custom_target(dist
170172
# Provide mfast-config.cmake and mfast-config.version to be used by other applications
171173
# ===============================
172174

173-
export(PACKAGE ${CMAKE_PROJECT_NAME})
175+
if (NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
176+
export(PACKAGE ${CMAKE_PROJECT_NAME})
177+
endif(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
178+
174179
export(TARGETS fast_type_gen ${MFAST_LIBRARIES} FILE "${PROJECT_BINARY_DIR}/mFASTTargets.cmake")
175180

176181
# Create the mFASTConfig.cmake for the build tree
177-
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
182+
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}")
178183
configure_file(mFASTConfig.cmake.in
179184
"${PROJECT_BINARY_DIR}/mFASTConfig.cmake"
180185
@ONLY)
@@ -199,3 +204,9 @@ install(FILES
199204

200205
# Install the export set for use with the install-tree
201206
install(EXPORT mFASTTargets DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
207+
208+
FILE(GLOB schema_files "${CMAKE_CURRENT_SOURCE_DIR}/schema/*.*")
209+
210+
install(FILES
211+
${schema_files}
212+
DESTINATION ${INSTALL_DATA_DIR}/mfast)

0 commit comments

Comments
 (0)