Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c9db190f
Commit
c9db190f
authored
Jul 10, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake: update submodules automatically during the build
parent
bfa9990e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
15 deletions
+31
-15
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/mariadb_connector_c.cmake
cmake/mariadb_connector_c.cmake
+0
-14
cmake/submodules.cmake
cmake/submodules.cmake
+30
-0
No files found.
CMakeLists.txt
View file @
c9db190f
...
...
@@ -363,7 +363,7 @@ ENDIF()
SET
(
MYSQLD_STATIC_PLUGIN_LIBS
""
CACHE INTERNAL
""
)
# mariadb_connector_c fetches submodules which is useful for plugins
INCLUDE
(
submodules
)
INCLUDE
(
mariadb_connector_c
)
# this does ADD_SUBDIRECTORY(libmariadb)
# Add storage engines and plugins.
...
...
cmake/mariadb_connector_c.cmake
View file @
c9db190f
IF
(
NOT EXISTS
${
CMAKE_SOURCE_DIR
}
/libmariadb/CMakeLists.txt AND GIT_EXECUTABLE
)
EXECUTE_PROCESS
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
submodule init
WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
)
EXECUTE_PROCESS
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
submodule update
WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
)
ENDIF
()
IF
(
NOT EXISTS
${
CMAKE_SOURCE_DIR
}
/libmariadb/CMakeLists.txt
)
MESSAGE
(
FATAL_ERROR
"No MariaDB Connector/C! Run
git submodule init
git submodule update
Then restart the build.
"
)
ENDIF
()
SET
(
OPT CONC_
)
IF
(
CMAKE_BUILD_TYPE STREQUAL
"Debug"
)
...
...
cmake/submodules.cmake
0 → 100644
View file @
c9db190f
# update submodules automatically
IF
(
GIT_EXECUTABLE AND EXISTS
"
${
CMAKE_SOURCE_DIR
}
/.git"
)
EXECUTE_PROCESS
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
config --get cmake.update-submodules
WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
OUTPUT_VARIABLE cmake_update_submodules
)
IF
(
cmake_update_submodules MATCHES no
)
SET
(
update_result 0
)
ELSEIF
(
cmake_update_submodules MATCHES force
)
MESSAGE
(
"-- Updating submodules (forced)"
)
EXECUTE_PROCESS
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
submodule update --init --force
WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
RESULT_VARIABLE update_result
)
ELSEIF
(
cmake_update_submodules MATCHES yes
)
EXECUTE_PROCESS
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
submodule update --init
WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
RESULT_VARIABLE update_result
)
ELSE
()
MESSAGE
(
"-- Updating submodules"
)
EXECUTE_PROCESS
(
COMMAND
"
${
GIT_EXECUTABLE
}
"
submodule update --init
WORKING_DIRECTORY
"
${
CMAKE_SOURCE_DIR
}
"
RESULT_VARIABLE update_result
)
ENDIF
()
ENDIF
()
IF
(
update_result OR NOT EXISTS
${
CMAKE_SOURCE_DIR
}
/libmariadb/CMakeLists.txt
)
MESSAGE
(
FATAL_ERROR
"No MariaDB Connector/C! Run
git submodule update --init
Then restart the build.
"
)
ENDIF
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment