-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
62 lines (49 loc) · 1.66 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.8)
project(rusql)
include(cmake/set_system_include_flag.cmake)
include(cmake/address_sanitizer.cmake)
include(cmake/detect_compiler.cmake)
check_compiling_with_clang(COMPILING_WITH_CLANG)
check_compiling_with_gcc(COMPILING_WITH_GCC)
if(${COMPILING_WITH_CLANG})
if(APPLE)
include_directories(SYSTEM "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/")
endif()
endif()
if(MINGW)
include(cmake/enable_gnu11.cmake)
else()
include(cmake/enable_cpp11.cmake)
endif()
if(UNIX)
#Always compile with debugging symbols
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
else()
if(MSVC)
message(FATAL_ERROR "Were not supporting MSVC at this time")
elseif(MINGW)
# Assume were running cross compilation.
add_definitions("-DGLEW_STATIC" "-DAL_LIBTYPE_STATIC" "-DALURE_STATIC_LIBRARY" "-DBOOST_THREAD_USE_LIB")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
else()
message(FATAL_ERROR "Unsupported platform detected")
endif()
endif()
include(cmake/warning_settings.cmake)
get_sane_warning_flags(warnings)
include(cmake/join.cmake)
join("${warnings}" " " warnings)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${warnings}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules")
find_package(MYSQL REQUIRED)
include_directories(${MYSQL_INCLUDE_DIR})
find_package(Boost COMPONENTS system thread REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
set(rusql_INCLUDE_DIRS ${MYSQL_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} PARENT_SCOPE)
add_subdirectory(rusql)
add_subdirectory(tests)
install(FILES
cmake/modules/FindMYSQL.cmake
cmake/modules/Findrusql.cmake
DESTINATION share/cmake-2.8/Modules
)