forked from bianster/mysqlfs
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
62 lines (44 loc) · 1.8 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required (VERSION 2.6)
project (MySQLfs)
# The version number.
set (MySQLfs_VERSION_MAJOR 1)
set (MySQLfs_VERSION_MINOR 0)
MESSAGE(STATUS "Compiling MySQLfs ${MySQLfs_VERSION_MAJOR}.${MySQLfs_VERSION_MINOR} on ${CMAKE_SYSTEM}")
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
FIND_PACKAGE(MySQL)
IF(MYSQL_FOUND)
MESSAGE(STATUS "MySQL found at: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
ELSE(MYSQL_FOUND)
MESSAGE(SEND_ERROR "Couldn't find MySQL include files and/or library")
ENDIF(MYSQL_FOUND)
set(MYSQL_MIN_VERSION 5000)
find_package(FUSE 2.6 REQUIRED)
if(FUSE_FOUND)
MESSAGE(STATUS "FUSE found at: ${FUSE_INCLUDE_DIRS}, ${FUSE_LIBRARIES}")
endif()
set(FUSE_USE_VERSION 26)
find_package( LibM REQUIRED )
IF(LibM_FOUND)
MESSAGE(STATUS "LibM found at: ${LibM_LIBRARY_DIR}, ${LibM_LIBRARIES}")
ELSE(LibM_FOUND)
MESSAGE(SEND_ERROR "Couldn't find LibM include files and/or library")
ENDIF(LibM_FOUND)
# configure a header file to pass some of the CMake settings
# to the source code
MESSAGE(STATUS "Writing ${PROJECT_SOURCE_DIR}/src/Config.h.in to ${PROJECT_BINARY_DIR}/Config.h")
configure_file (
"${PROJECT_SOURCE_DIR}/src/Config.h.in"
"${PROJECT_BINARY_DIR}/Config.h"
)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
include_directories("${PROJECT_BINARY_DIR}")
add_definitions(${FUSE_DEFINITIONS})
include_directories(${FUSE_INCLUDE_DIRS})
include_directories(${MYSQL_INCLUDE_DIR})
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lm")
add_subdirectory(src)
FILE(GLOB files "${PROJECT_SOURCE_DIR}/src/sql/updates/*.sql")
MESSAGE(STATUS "SQL updates: ${files}")
install(FILES "mysqlfs_setup" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ DESTINATION bin)
install(FILES ${files} DESTINATION share/mysqlfs/sql/update)