File: CMakeLists.txt

package info (click to toggle)
pxlib 0.6.7-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,688 kB
  • ctags: 715
  • sloc: ansic: 5,364; sh: 4,270; makefile: 191
file content (105 lines) | stat: -rw-r--r-- 3,168 bytes parent folder | download
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
option(ENABLE_GSF   "Build with gsf support" OFF)

if(CMAKE_COMPILER_IS_GNUCC)
  add_definitions(
    -DHAVE_CONFIG_H
    -Wall -Wpointer-arith -W
    ${PXLIB_EXTRA_GCC_FLAGS}
  )
else(CMAKE_COMPILER_IS_GNUCC)
  add_definitions(-DHAVE_CONFIG_H)
endif(CMAKE_COMPILER_IS_GNUCC)

#check system for includes
include(CheckIncludeFile)
check_include_file("fcntl.h"           HAVE_FCNTL_H)
check_include_file("iconv.h"           HAVE_ICONV_H)
check_include_file("locale.h"          HAVE_LOCALE_H)
check_include_file("unistd.h"          HAVE_UNISTD_H)
check_include_file("inttypes.h"        HAVE_INTTYPES_H)
check_include_file("stdarg.h"          HAVE_STDARG_H)
check_include_file("stddef.h"          HAVE_STDDEF_H)
check_include_file("stdint.h"          HAVE_STDINT_H)
check_include_file("stdlib.h"          HAVE_STDLIB_H)
check_include_file("stdbool.h"         HAVE_STDBOOL_H)
check_include_file("string.h"          HAVE_STRING_H)
check_include_file("strings.h"         HAVE_STRINGS_H)
check_include_file("sys/time.h"        HAVE_SYS_TIME_H)
check_include_file("sys/types.h"       HAVE_SYS_TYPES_H)
check_include_file("gsf/gsf-input-stdio.h" HAVE_GSF_GSFINPUTSTDIO_H)

#Functions
include(CheckFunctionExists)

#Big or little endian ?
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)

if(HAVE_ICONV_H)
	set(PX_HAVE_ICONV 1)
	set(PX_HAVE_RECODE 0)
else(HAVE_ICONV_H)
	if(HAVE_RECODE_H)
		set(PX_HAVE_RECODE 1)
	endif(HAVE_RECODE_H)
endif(HAVE_ICONV_H)

if(HAVE_GSF_GSFINPUTSTDIO_H)
	set(PX_HAVE_GSF 1)
else(HAVE_GSF_GSFINPUTSTDIO_H)
	set(PX_HAVE_GSF 0)
endif(HAVE_GSF_GSFINPUTSTDIO_H)

SUBDIRS( src )
SET(SOURCES
	src/gregor.c
	src/paradox.c
	src/px_crypt.c
	src/px_encode.c
	src/px_error.c
	src/px_head.c
	src/px_io.c
	src/px_memory.c
	src/px_memprof.c
	src/px_misc.c
	src/fileformat.h
	src/px_crypt.h
	src/px_encode.h
	src/px_error.h
	src/px_head.h
	src/px_intern.h
	src/px_io.h
	src/px_memory.h
	src/px_misc.h
	src/sdncal.h
	include/paradox-gsf.h
	include/paradox.h
	include/paradox-mp.h
	include/pxversion.h
  )

INCLUDE_DIRECTORIES( include . )

ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-DPXLIB_EXPORTS)

#packaging
set(CPACK_PACKAGE_NAME pxlib)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Reading and writing paradox databases")
set(CPACK_PACKAGE_VENDOR "pxlib")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "6")
set(CPACK_PACKAGE_VERSION_PATCH "6")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "/usr")
set(CPACK_GENERATOR "TGZ")
set(CPACK_SOURCE_GENERATOR "TGZ")

configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h)
configure_file(${CMAKE_SOURCE_DIR}/include/paradox.h.in ${CMAKE_BINARY_DIR}/include/paradox.h)
configure_file(${CMAKE_SOURCE_DIR}/include/paradox-gsf.h.in ${CMAKE_BINARY_DIR}/include/paradox-gsf.h)
ADD_LIBRARY(pxlib SHARED ${SOURCES})