-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
117 lines (99 loc) · 3.5 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
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
106
107
108
109
110
111
112
113
114
115
116
117
cmake_minimum_required (VERSION 2.8)
project (PACMAN-G2)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
include (CheckIncludeFile)
include (CheckIncludeFiles)
include (CheckFunctionExists)
string(TOLOWER ${CMAKE_PROJECT_NAME} CMAKE_PROJECT_NAME_LOWER)
set (PACMAN_G2_VERSION 3.8.9)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_GNU_SOURCE")
SET(ENABLE_NLS TRUE CACHE BOOL "Translation program messages to the user's native language ?")
FIND_PACKAGE(Doxygen QUIET)
message("searched for doxy")
IF(DOXYGEN_FOUND)
message("found doxy")
SET(HAS_DOXYGEN TRUE CACHE BOOL "Use Doxygen")
ENDIF(DOXYGEN_FOUND)
FIND_PACKAGE(Asciidoc QUIET)
message("searched for ascii doc")
IF(ASCIIDOC_FOUND)
message("found asciidoc")
SET(HAS_ASCIIDOC TRUE CACHE BOOL "Use Asciidoc")
ENDIF(ASCIIDOC_FOUND)
FIND_PACKAGE(Po4a QUIET)
message("searched for Po4a")
IF(PO4A_FOUND)
message("found Po4a")
SET(HAS_PO4A TRUE CACHE BOOL "Po4a bindings")
ENDIF(PO4A_FOUND)
FIND_PACKAGE(SWIG QUIET)
IF(SWIG_FOUND)
message("found SWIG")
INCLUDE(${SWIG_USE_FILE})
SET(CMAKE_SWIG_FLAGS "-I${CMAKE_SOURCE_DIR}/lib/libpacman/")
ENDIF(SWIG_FOUND)
FIND_PACKAGE(Mono QUIET)
message("searched for Mono")
IF(MONO_FOUND AND SWIG_FOUND)
message("found Mono")
SET(HAS_CSHARP TRUE CACHE BOOL "C# bindings")
ADD_SUBDIRECTORY(bindings/csharp)
ENDIF(MONO_FOUND AND SWIG_FOUND)
FIND_PACKAGE(Java QUIET)
message("searched for Java")
IF(JAVA_FOUND AND SWIG_FOUND)
find_package(JNI REQUIRED)
message("found Java")
SET(HAS_JAVA TRUE CACHE BOOL "Java bindings")
ADD_SUBDIRECTORY(bindings/java)
ENDIF(JAVA_FOUND AND SWIG_FOUND)
FIND_PACKAGE(Perl QUIET)
message("searched for Perl")
IF(PERL_FOUND AND SWIG_FOUND)
find_package(PerlLibs REQUIRED)
message("found Perl")
SET(HAS_PERL TRUE CACHE BOOL "Perl bindings")
ADD_SUBDIRECTORY(bindings/perl)
ENDIF(PERL_FOUND AND SWIG_FOUND)
FIND_PACKAGE(Vala QUIET)
message("searched for Vala")
IF(VALA_FOUND AND SWIG_FOUND)
message("found Vala")
SET(HAS_VALA TRUE CACHE BOOL "Vala bindings")
ADD_SUBDIRECTORY(bindings/vala)
ENDIF(VALA_FOUND AND SWIG_FOUND)
FIND_PACKAGE(PythonInterp QUIET)
message("searched for Python")
IF(PYTHONINTERP_FOUND AND SWIG_FOUND)
message("found Python")
FIND_PACKAGE(PythonLibs REQUIRED)
SET(HAS_PYTHON TRUE CACHE BOOL "Python bindings")
ADD_SUBDIRECTORY(bindings/python)
ENDIF(PYTHONINTERP_FOUND AND SWIG_FOUND)
IF((HAS_CSHARP OR HAS_JAVA OR HAS_PERL OR HAS_VALA OR HAS_PYTHON) AND SWIG_FOUND)
message("has bindings and SWIG")
ENDIF((HAS_CSHARP OR HAS_JAVA OR HAS_PERL OR HAS_VALA OR HAS_PYTHON) AND SWIG_FOUND)
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE(memory.h HAVE_MEMORY_H)
CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H)
CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILES("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS)
CHECK_FUNCTION_EXISTS(dcgettext HAVE_DCGETTEXT)
CHECK_FUNCTION_EXISTS(gettext HAVE_GETTEXT)
CHECK_FUNCTION_EXISTS(iconv HAVE_ICONV)
CHECK_FUNCTION_EXISTS(strverscmp HAVE_STRVERSCMP)
CONFIGURE_FILE (
"${PROJECT_SOURCE_DIR}/cmake_config.h"
"${PROJECT_SOURCE_DIR}/config.h"
)
ADD_SUBDIRECTORY(lib/libftp)
ADD_SUBDIRECTORY(lib/libpacman)
ADD_SUBDIRECTORY(src/versort)
ADD_SUBDIRECTORY(src/vercmp)
ADD_SUBDIRECTORY(src/pacman-g2)