Skip to content

Commit

Permalink
auto-clone C/C, if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Sep 12, 2016
1 parent 79fa256 commit 5ea5a7f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ FOREACH(_base
ENDIF()
ENDFOREACH()

FOREACH(tool gtar tar git)
STRING(TOUPPER ${tool} TOOL)
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
ENDFOREACH()

# Following autotools tradition, add preprocessor definitions
# specified in environment variable CPPFLAGS
Expand Down
14 changes: 14 additions & 0 deletions cmake/mariadb_connector_c.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
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")
Expand Down
6 changes: 0 additions & 6 deletions sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,6 @@ IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
ENDIF()
ENDIF()

FOREACH(tool gtar tar git)
STRING(TOUPPER ${tool} TOOL)
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
ENDFOREACH()

CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in
${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY)
Expand Down

0 comments on commit 5ea5a7f

Please sign in to comment.