Skip to content

Commit e0474b6

Browse files
author
Bogdan Degtyariov
committed
Updated packages cmake script
1 parent ac6839e commit e0474b6

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

PackageSpecs.cmake

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ endif()
126126
# Licenses for binary packages
127127
# ======================================================================
128128

129-
if (0)
129+
#if (0)
130130

131131
if(EXISTS "${CMAKE_SOURCE_DIR}/LICENSE.mysql.txt")
132132
set(LIC_FILE "LICENSE.mysql") # Without ".txt" extension
@@ -142,23 +142,34 @@ else()
142142
set(newline UNIX)
143143
endif()
144144

145-
set(info_files README ${LIC_FILE})
146145

147-
foreach(file ${info_files})
146+
if(EXISTS "${CMAKE_SOURCE_DIR}/README.txt")
147+
set(info_files README ${LIC_FILE})
148+
set(CPACK_RESOURCE_FILE_README "README${info_ext}")
149+
else()
150+
set(info_files README.md CONTRIBUTING.md ${LIC_FILE})
151+
set(CPACK_RESOURCE_FILE_README "README.md")
152+
endif()
148153

149-
set(file_src "${CMAKE_SOURCE_DIR}/${file}.txt")
150-
set(file_bin "${CMAKE_BINARY_DIR}/${file}${info_ext}")
154+
foreach(file ${info_files})
155+
if (${file} MATCHES "[.]*\\.md")
156+
set(file_src "${CMAKE_SOURCE_DIR}/${file}")
157+
set(file_bin "${CMAKE_BINARY_DIR}/${file}")
158+
else()
159+
set(file_src "${CMAKE_SOURCE_DIR}/${file}.txt")
160+
set(file_bin "${CMAKE_BINARY_DIR}/${file}${info_ext}")
161+
endif()
151162

152163
configure_file("${file_src}" "${file_bin}" NEWLINE_STYLE ${newline})
153164
install(FILES "${file_bin}" DESTINATION ${INSTALL_DOC_DIR} COMPONENT Readme)
165+
message("Installing README files: ${file_bin}")
154166

155167
endforeach()
156168

157-
set(CPACK_RESOURCE_FILE_README "README${info_ext}")
158169
set(CPACK_RESOURCE_FILE_LICENSE "${LIC_FILE}${info_ext}")
159170
#set(CPACK_RESOURCE_FILE_INSTALL "...") # FIXME
160171

161-
endif()
172+
#endif()
162173

163174
# ======================================================================
164175
# Specs for source package

0 commit comments

Comments
 (0)