Skip to content

Commit 76a9154

Browse files
committed
Indicate Driver Company and Version on Driver Manager
* use versioninfo.rc.in template * use `1 VERSIONINFO` for it to work properly * Set version variables * Add `.rc` to gitignore * Add `@` variables to rc template
1 parent 3958622 commit 76a9154

File tree

3 files changed

+81
-6
lines changed

3 files changed

+81
-6
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,6 @@ java/.mvn/.develocity/
108108
# rat
109109
filtered_rat.txt
110110
rat.txt
111+
112+
# rc
113+
*.rc

cpp/src/arrow/flight/sql/odbc/CMakeLists.txt

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,28 @@ add_subdirectory(tests)
5454

5555
arrow_install_all_headers("arrow/flight/sql/odbc")
5656

57+
# ODBC Release information
58+
set(ODBC_PACKAGE_VERSION_MAJOR "1")
59+
set(ODBC_PACKAGE_VERSION_MINOR "0")
60+
set(ODBC_PACKAGE_VERSION_PATCH "0")
61+
set(ODBC_PACKAGE_NAME "Apache Arrow Flight SQL ODBC")
62+
set(ODBC_PACKAGE_VENDOR "Apache Arrow")
63+
5764
set(ARROW_FLIGHT_SQL_ODBC_SRCS entry_points.cc odbc_api.cc)
5865

5966
if(WIN32)
60-
list(APPEND ARROW_FLIGHT_SQL_ODBC_SRCS odbc.def)
67+
set(VER_FILEVERSION
68+
"${ODBC_PACKAGE_VERSION_MAJOR},${ODBC_PACKAGE_VERSION_MINOR},${ODBC_PACKAGE_VERSION_PATCH},0"
69+
)
70+
set(VER_FILEVERSION_STR
71+
${ODBC_PACKAGE_VERSION_MAJOR}.${ODBC_PACKAGE_VERSION_MINOR}.${ODBC_PACKAGE_VERSION_PATCH}
72+
)
73+
set(VER_COMPANYNAME_STR ${ODBC_PACKAGE_VENDOR})
74+
set(VER_PRODUCTNAME_STR ${ODBC_PACKAGE_NAME})
75+
76+
configure_file("install/versioninfo.rc.in" "install/versioninfo.rc" @ONLY)
77+
78+
list(APPEND ARROW_FLIGHT_SQL_ODBC_SRCS odbc.def install/versioninfo.rc)
6179
endif()
6280

6381
add_arrow_lib(arrow_flight_sql_odbc
@@ -100,12 +118,12 @@ if(ARROW_FLIGHT_SQL_ODBC_INSTALLER)
100118
set(CPACK_RESOURCE_FILE_LICENSE
101119
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../LICENSE.txt")
102120
# Tentative version 1.0.0
103-
set(CPACK_PACKAGE_VERSION_MAJOR "1")
104-
set(CPACK_PACKAGE_VERSION_MINOR "0")
105-
set(CPACK_PACKAGE_VERSION_PATCH "0")
121+
set(CPACK_PACKAGE_VERSION_MAJOR ${ODBC_PACKAGE_VERSION_MAJOR})
122+
set(CPACK_PACKAGE_VERSION_MINOR ${ODBC_PACKAGE_VERSION_MINOR})
123+
set(CPACK_PACKAGE_VERSION_PATCH ${ODBC_PACKAGE_VERSION_PATCH})
106124

107-
set(CPACK_PACKAGE_NAME "Apache Arrow Flight SQL ODBC")
108-
set(CPACK_PACKAGE_VENDOR "Apache Arrow")
125+
set(CPACK_PACKAGE_NAME ${ODBC_PACKAGE_NAME})
126+
set(CPACK_PACKAGE_VENDOR ${ODBC_PACKAGE_VENDOR})
109127
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Arrow Flight SQL ODBC Driver")
110128
set(CPACK_PACKAGE_CONTACT "#TODO arrow maintainers")
111129

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
#define VER_FILEVERSION @VER_FILEVERSION@
19+
#define VER_FILEVERSION_STR "@VER_FILEVERSION_STR@\0"
20+
21+
#define VER_PRODUCTVERSION @VER_FILEVERSION@
22+
#define VER_PRODUCTVERSION_STR "@VER_FILEVERSION_STR@\0"
23+
24+
#define VER_COMPANYNAME_STR "@VER_COMPANYNAME_STR@\0"
25+
#define VER_PRODUCTNAME_STR "@VER_PRODUCTNAME_STR@\0"
26+
27+
1 VERSIONINFO
28+
FILEVERSION VER_FILEVERSION
29+
PRODUCTVERSION VER_PRODUCTVERSION
30+
BEGIN
31+
BLOCK "StringFileInfo"
32+
BEGIN
33+
BLOCK "040904E4"
34+
BEGIN
35+
VALUE "CompanyName", VER_COMPANYNAME_STR
36+
VALUE "FileVersion", VER_FILEVERSION_STR
37+
VALUE "ProductName", VER_PRODUCTNAME_STR
38+
VALUE "ProductVersion", VER_PRODUCTVERSION_STR
39+
END
40+
END
41+
42+
BLOCK "VarFileInfo"
43+
BEGIN
44+
/* The following line should only be modified for localized versions. */
45+
/* It consists of any number of WORD,WORD pairs, with each pair */
46+
/* describing a language,codepage combination supported by the file. */
47+
/* */
48+
/* For example, a file might have values "0x409,1252" indicating that it */
49+
/* supports English language (0x409) in the Windows ANSI codepage (1252). */
50+
51+
VALUE "Translation", 0x409, 1252
52+
53+
END
54+
END

0 commit comments

Comments
 (0)