File tree Expand file tree Collapse file tree 8 files changed +30
-12
lines changed Expand file tree Collapse file tree 8 files changed +30
-12
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ ENDIF()
55
55
set (CMAKE_INSTALL_PREFIX "" CACHE PATH "Install location" )
56
56
57
57
58
+
58
59
##########################################################################
59
60
60
61
PROJECT (MySQL_CONCPP )
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ foreach(file ${info_files})
148
148
set (file_bin "${CMAKE_BINARY_DIR} /${file}${info_ext} " )
149
149
150
150
configure_file ("${file_src} " "${file_bin} " NEWLINE_STYLE ${newline} )
151
- install (FILES "${file_bin} " DESTINATION . COMPONENT Readme )
151
+ install (FILES "${file_bin} " DESTINATION ${INSTALL_DOC_DIR} COMPONENT Readme )
152
152
153
153
endforeach ()
154
154
Original file line number Diff line number Diff line change @@ -112,4 +112,4 @@ if(WITH_JDBC)
112
112
endif ()
113
113
114
114
115
- install (FILES "${PROJECT_BINARY_DIR} /BUILDINFO.txt" DESTINATION . COMPONENT Readme )
115
+ install (FILES "${PROJECT_BINARY_DIR} /BUILDINFO.txt" DESTINATION ${INSTALL_DOC_DIR} COMPONENT Readme )
Original file line number Diff line number Diff line change @@ -36,5 +36,5 @@ ADD_HEADERS_DIR(devapi)
36
36
ADD_HEADERS (${headers} )
37
37
ADD_HEADER_CHECKS ()
38
38
39
- INSTALL (FILES ${headers} DESTINATION include /mysqlx COMPONENT XDevAPIDev )
39
+ INSTALL (FILES ${headers} DESTINATION ${INSTALL_INCLUDE_DIR} /mysqlx COMPONENT XDevAPIDev )
40
40
Original file line number Diff line number Diff line change @@ -32,4 +32,4 @@ check_headers(${headers})
32
32
33
33
ADD_HEADERS (${headers} )
34
34
ADD_HEADER_CHECKS ()
35
- INSTALL (FILES ${headers} DESTINATION include /mysqlx/common COMPONENT XDevAPIDev )
35
+ INSTALL (FILES ${headers} DESTINATION ${INSTALL_INCLUDE_DIR} /mysqlx/common COMPONENT XDevAPIDev )
Original file line number Diff line number Diff line change @@ -33,4 +33,4 @@ check_headers(${headers})
33
33
34
34
ADD_HEADERS (${headers} )
35
35
ADD_HEADER_CHECKS ()
36
- INSTALL (FILES ${headers} DESTINATION include /mysqlx/devapi/detail COMPONENT XDevAPIDev )
36
+ INSTALL (FILES ${headers} DESTINATION ${INSTALL_INCLUDE_DIR} /mysqlx/devapi/detail COMPONENT XDevAPIDev )
Original file line number Diff line number Diff line change @@ -56,20 +56,37 @@ if(NOT DEFINED IS64BIT)
56
56
message (FATAL_ERROR "IS64BIT not defined!" )
57
57
endif ()
58
58
59
+ #
60
+ # Default locations, if not overridden with cmake options
61
+ #
62
+
63
+ set (CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING
64
+ "Include Install location (Relative to CMAKE_INSTALL_PREFIX)" )
65
+
59
66
if (IS64BIT )
60
- set (INSTALL_LIB_DIR "lib64" )
67
+ set (CMAKE_INSTALL_LIBDIR "lib64" CACHE STRING
68
+ "Library Install location (Relative to CMAKE_INSTALL_PREFIX)" )
61
69
else ()
62
- set (INSTALL_LIB_DIR "lib" )
70
+ set (CMAKE_INSTALL_LIBDIR "lib" CACHE STRING
71
+ "Library Install location (Relative to CMAKE_INSTALL_PREFIX)" )
63
72
endif ()
64
73
74
+ set (CMAKE_INSTALL_DOCDIR "." CACHE STRING
75
+ "Doc Install location (Relative to CMAKE_INSTALL_PREFIX)" )
76
+
77
+ #
78
+ # These variables should be used in install specs.
79
+ #
80
+
81
+ set (INSTALL_LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
65
82
66
83
set (INSTALL_LIB_DIR_STATIC "${INSTALL_LIB_DIR} " )
67
84
if (VS )
68
85
set (INSTALL_LIB_DIR_STATIC "${INSTALL_LIB_DIR_STATIC} /${VS} " )
69
86
endif ()
70
87
71
- set (INSTALL_INCLUDE_DIR include )
72
- set (INSTALL_DOC_DIR doc )
88
+ set (INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
89
+ set (INSTALL_DOC_DIR ${CMAKE_INSTALL_DOCDIR} )
73
90
74
91
#
75
92
# Store layout settings in the cache.
Original file line number Diff line number Diff line change @@ -126,11 +126,13 @@ TEST_OPTS=
126
126
mkdir build-dynamic && pushd build-dynamic
127
127
%if 0%{?fedora} || 0%{?rhel}
128
128
%cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_JDBC=ON -DWITH_SSL=system %{?mysql_opt} \
129
+ -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/mysql-cppconn-8 \
129
130
${TEST_OPTS}
130
131
%else
131
132
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_JDBC=ON -DWITH_SSL=system %{?mysql_opt} \
132
133
${TEST_OPTS} \
133
134
-DCMAKE_INSTALL_PREFIX="%_prefix" \
135
+ -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}/mysql-cppconn-8 \
134
136
-DCMAKE_C_FLAGS:STRING="%optflags" \
135
137
-DCMAKE_CXX_FLAGS:STRING="%optflags"
136
138
%endif
@@ -192,9 +194,7 @@ mv run_unit_tests %{buildroot}%{_libdir}/mysql-cppconn-8/static/
192
194
%endif
193
195
popd
194
196
195
- # Adjust the directory structure for header files
196
- install -d -m0755 %{buildroot}%{_includedir}/mysql-cppconn-8
197
- mv %{buildroot}%{_includedir}/{jdbc,mysqlx} %{buildroot}%{_includedir}/mysql-cppconn-8
197
+ # Add compat dir and remove unwanted file
198
198
ln -s mysql-cppconn-8 %{buildroot}%{_includedir}/mysql-cppconn
199
199
rm %{buildroot}/usr/BUILDINFO.txt
200
200
You can’t perform that action at this time.
0 commit comments