Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 99 lines (82 sloc) 3.523 kB
7a3fc92 @abw First version of VX
authored
1 cmake_minimum_required (VERSION 2.8)
2
3 project (VX)
4 enable_testing()
5
6 set(VX_VERSION_MAJOR 0)
7 set(VX_VERSION_MINOR 1)
8 set(VX_NAME "VX")
9 set(VX_AUTHOR "Andy Wardley")
10 set(VX_EMAIL "vx@wardley.org")
11 set(VX_URL "http://wardley.org/vx/")
12 set(VX_DIR ${CMAKE_INSTALL_PREFIX}/${VX_NAME})
13 set(VX_SOURCE_DIR ${PROJECT_SOURCE_DIR})
14 set(VX_TEST_DIR ${PROJECT_SOURCE_DIR}/tests)
15 set(VX_MODULE_DIR "modules")
16 set(VX_MODULE_EXT ".vxm")
17
18 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
19 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
20
21 include(CheckIncludeFile)
22 check_include_file(dirent.h VX_HAVE_DIRENT_H)
23 check_include_file(memory.h VX_HAVE_MEMORY_H)
24 check_include_file(stdint.h VX_HAVE_STDINT_H)
25 check_include_file(stdlib.h VX_HAVE_STDLIB_H)
26 check_include_file(string.h VX_HAVE_STRING_H)
27 check_include_file(strings.h VX_HAVE_STRINGS_H)
28 check_include_file(inttypes.h VX_HAVE_INTTYPES_H)
29 check_include_file(sys/stat.h VX_HAVE_SYS_STAT_H)
30 check_include_file(sys/types.h VX_HAVE_SYS_TYPES_H)
31 check_include_file(unistd.h VX_HAVE_UNISTD_H)
32 check_include_file(windows.h VX_HAVE_WINDOWS_H)
33
34 include(CheckFunctionExists)
35 check_function_exists(bcopy VX_HAVE_BCOPY)
36 check_function_exists(memmove VX_HAVE_MEMMOVE)
37 check_function_exists(memset VX_HAVE_MEMSET)
38 check_function_exists(strdup VX_HAVE_STRDUP)
39 check_function_exists(strerror VX_HAVE_STRERROR)
40 check_function_exists(strtol VX_HAVE_STRTOL)
41 check_function_exists(strtoll VX_HAVE_STRTOLL)
42 check_function_exists(strtoq VX_HAVE_STRTOQ)
43
44 find_package( ReadLine REQUIRED )
45
46 # do we also need dl and/or other platform-specific library?
47 set(
48 PROGRAM_LIBS
49 ${PROGRAM_LIBS}
50 readline m
51 )
52
53 # TODO: CMAKE_BUILD_TYPE
54
55 set(VX_DEBUG "" CACHE STRING "Set the debugging level")
56
57 if(VX_DEBUG)
58 add_definitions( -DVX_DEBUG=${VX_DEBUG} )
59 endif(VX_DEBUG)
60
61 # Build the custom vx/config.h header file.
62 # This feature alone makes CMake worth the price of admission.
63 configure_file (
64 "${PROJECT_SOURCE_DIR}/include/vx/config.h.in"
65 "${PROJECT_BINARY_DIR}/include/vx/config.h"
66 )
67
68 # location of header files for build
69 include_directories(
70 "${PROJECT_BINARY_DIR}/include"
71 "${PROJECT_SOURCE_DIR}/include"
72 )
73
74 add_subdirectory(include)
75 add_subdirectory(library)
76 add_subdirectory(programs)
77 #add_subdirectory(modules/codec)
78
79 # disabled while testing languages
80 add_subdirectory(tests)
81 #add_subdirectory(tests/core)
82
83 message(STATUS "Summary of configuration:")
84 message(STATUS " + Project source dir ........... : ${PROJECT_SOURCE_DIR}")
85 message(STATUS " + Project build dir ............ : ${PROJECT_BINARY_DIR}")
86 message(STATUS " + Installation prefix .......... : ${CMAKE_INSTALL_PREFIX}")
87 message(STATUS " + VX root dir .................. : ${VX_DIR}")
88 message(STATUS " + Readline library ............. : ${READLINE_LIBRARY}")
89 message(STATUS " + Ncurses library .............. : ${NCURSES_LIBRARY}")
90 message(STATUS " + Compile flags ................ : ${CMAKE_C_FLAGS}")
91 message(STATUS " + Debug level .................. : ${VX_DEBUG}")
92
93 # build a CPack driven installer package
94 include (InstallRequiredSystemLibraries)
95 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt")
96 set(CPACK_PACKAGE_VERSION_MAJOR "${VX_VERSION_MAJOR}")
97 set(CPACK_PACKAGE_VERSION_MINOR "${VX_VERSION_MINOR}")
98 include (CPack)
Something went wrong with that request. Please try again.