-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
66 lines (54 loc) · 2.17 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
63
64
65
66
cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
project(launchdb)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Set variable for config
set(INSTALL_DIR /usr/bin)
set(LAUNCHDB_VERSION_MAJOR 0)
set(LAUNCHDB_VERSION_MINOR 3)
set(LAUNCHDB_VERSION_PATCH 0)
set(LAUNCHDB_VERSION_META "dev")
# System info
if (UNIX)
find_program(LSB_RELEASE lsb_release)
execute_process(COMMAND ${LSB_RELEASE} -is
OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(COMMAND ${LSB_RELEASE} -rs
OUTPUT_VARIABLE LSB_RELEASE_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(COMMAND ${LSB_RELEASE} -cs
OUTPUT_VARIABLE LSB_CODENAME_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# Shared headers
set(SHARED_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include)
file(GLOB SHARED_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.hpp)
configure_file("${SHARED_INCLUDE_PATH}/launchdb/config.h.in" "${SHARED_INCLUDE_PATH}/launchdb/config.h")
add_subdirectory(src/sqlite)
add_subdirectory(src/postgres)
add_subdirectory(src/migrate)
add_subdirectory(src/create)
add_subdirectory(src/grab)
# DEB package
if (UNIX)
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
set(CPACK_PACKAGE_VERSION_MAJOR ${LAUNCHDB_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${LAUNCHDB_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${LAUNCHDB_VERSION_PATCH})
set(CPACK_PACKAGE_CONTACT "Poddubny Mikhail [email protected]")
set(CPACK_PACKAGE_DESCRIPTION "Database creation tool")
set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION})
#set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${LSB_CODENAME_SHORT}-${LSB_RELEASE_SHORT})
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-dbg")
endif()
endif()
include(CPack)