Skip to content

Commit bbd42f5

Browse files
committed
cmake: Fix version info for the legacy connector library.
1 parent 38e3136 commit bbd42f5

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

CMakeLists.txt

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,50 +72,54 @@ ENDIF()
7272

7373
#-----------------
7474

75-
#if(jdbc_stand_alone)
75+
if(jdbc_stand_alone)
7676

7777
add_config_option(BUILD_STATIC BOOL DEFAULT OFF
7878
"Build static connector library instead of dynamic one"
7979
)
8080

81-
if(BUILD_STATIC)
82-
set(BUILD_SHARED_LIBS OFF)
83-
else()
84-
set(BUILD_SHARED_LIBS ON)
85-
endif()
86-
87-
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} CACHE INTERNAL "")
88-
89-
9081
add_config_option(BUNDLE_DEPENDENCIES BOOL ADVANCED DEFAULT OFF
9182
"copy dependencies to install location"
9283
)
9384

94-
# TODO: support dynamic binding
95-
#add_config_option(MYSQLCLIENT_STATIC_BINDING BOOL ADVANCED DEFAULT ON "enable static binding")
96-
set(MYSQLCLIENT_STATIC_BINDING ON CACHE INTENRAL "only static biniding supported for now" FORCE)
85+
endif(jdbc_stand_alone)
86+
87+
88+
# TODO: support dynamic binding
89+
#add_config_option(MYSQLCLIENT_STATIC_BINDING BOOL ADVANCED DEFAULT ON "enable static binding")
90+
set(MYSQLCLIENT_STATIC_BINDING ON CACHE INTENRAL "only static biniding supported for now" FORCE)
91+
9792

98-
#endif(jdbc_stand_alone)
93+
if(BUILD_STATIC)
94+
set(BUILD_SHARED_LIBS OFF)
95+
else()
96+
set(BUILD_SHARED_LIBS ON)
97+
endif()
98+
99+
set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS} CACHE INTERNAL "")
99100

100101

101102
#-----------------
102103
# Version info
103104
#
104105

105-
if(NOT EXISTS "${PROJECT_BINARY_DIR}/VersionInfo.cmake")
106+
if(jdbc_stand_alone)
107+
108+
message(WARNING "Using fake version info for legacy Connector/C++")
106109

107110
set(CONCPP_VERSION_MAJOR 8)
108111
set(CONCPP_VERSION_MINOR 0)
109-
set(CONCPP_VERSION_MICRO 14)
112+
set(CONCPP_VERSION_MICRO 0)
110113
set(CONCPP_VERSION_LEVEL "")
111114
set(JDBC_ABI_VERSION_MAJOR 7)
112115

113-
configure_file(
114-
"VersionInfo.cmake.in"
115-
"${PROJECT_BINARY_DIR}/VersionInfo.cmake"
116-
@ONLY
117-
)
118-
endif()
116+
endif(jdbc_stand_alone)
117+
118+
configure_file(
119+
"VersionInfo.cmake.in"
120+
"${PROJECT_BINARY_DIR}/VersionInfo.cmake"
121+
@ONLY
122+
)
119123

120124
INCLUDE("${PROJECT_BINARY_DIR}/VersionInfo.cmake")
121125

0 commit comments

Comments
 (0)