-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd438a4
commit 60557a0
Showing
3 changed files
with
62 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# $Id$ | ||
# | ||
# - Find libmysql | ||
# Find libmysql | ||
# | ||
# LIBMYSQL_INCLUDE_DIR - where to find mysql.h, etc. | ||
# LIBMYSQL_LIBRARY - List of libraries when using libmysql. | ||
# LIBMYSQL_FOUND - True if libmysql found. | ||
|
||
|
||
IF (LIBMYSQL_INCLUDE_DIR) | ||
# Already in cache, be silent | ||
SET(LIBMYSQL_FIND_QUIETLY TRUE) | ||
ENDIF () | ||
|
||
FIND_PATH(LIBMYSQL_INCLUDE_DIR mysql.h) | ||
|
||
FIND_LIBRARY(LIBMYSQL_LIBRARY mysqlclient) | ||
|
||
# handle the QUIETLY and REQUIRED arguments and set Libmysql_FOUND to TRUE if | ||
# all listed variables are TRUE | ||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBMYSQL DEFAULT_MSG LIBMYSQL_LIBRARY LIBMYSQL_INCLUDE_DIR) | ||
|
||
SET(LIBMYSQL_VERSION 0) | ||
|
||
IF(LIBMYSQL_FOUND) | ||
if (EXISTS "${LIBMYSQL_INCLUDE_DIR}/mysql_version.h") | ||
FILE(READ "${LIBMYSQL_INCLUDE_DIR}/mysql_version.h" _MYSQL_VERSION_CONENTS) | ||
STRING(REGEX REPLACE ".*#define MYSQL_SERVER_VERSION\\s+\"([0-9.]+)\".*" "\\1" LIBMYSQL_VERSION "${_MYSQL_VERSION_CONENTS}") | ||
endif() | ||
ENDIF() | ||
|
||
SET(LIBMYSQL_VERSION ${LIBMYSQL_VERSION} CACHE STRING "Version number of libmysql") | ||
|
||
MARK_AS_ADVANCED(LIBMYSQL_LIBRARY LIBMYSQL_INCLUDE_DIR LIBMYSQL_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
PROJECT(LIBGIT2-mysql C) | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) | ||
|
||
INCLUDE(../CMake/FindLibgit2.cmake) | ||
INCLUDE(../CMake/FindLibmysql.cmake) | ||
|
||
# Build options | ||
OPTION (BUILD_SHARED_LIBS "Build Shared Library (OFF for Static)" ON) | ||
OPTION (BUILD_TESTS "Build Tests" ON) | ||
|
||
# Build Release by default | ||
IF (NOT CMAKE_BUILD_TYPE) | ||
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) | ||
ENDIF () | ||
|
||
# Compile and link LIBGIT2 | ||
INCLUDE_DIRECTORIES(${LIBGIT2_INCLUDE_DIRS} ${LIBMYSQL_INCLUDE_DIR}) | ||
ADD_LIBRARY(git2-mysql mysql.c) | ||
TARGET_LINK_LIBRARIES(git2-mysql ${LIBGIT2_LIBRARIES} ${LIBMYSQL_LIBRARY}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60557a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am beginner.
Please, explain how exactly to compile.