-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
72 lines (55 loc) · 1.94 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
cmake_minimum_required(VERSION 2.6)
project(LIBPCOORDS)
INCLUDE(CheckIncludeFile)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckLibraryExists)
SET(CMAKE_BUILD_TYPE "DEBUG")
IF(CMAKE_BUILD_TYPE)
SET(CMAKE_VERBOSE_MAKEFILE ON)
ENDIF(CMAKE_BUILD_TYPE)
# with -fPIC
IF(UNIX AND NOT WIN32)
FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
IF(CMAKE_UNAME)
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_PROCESSOR)
SET(CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR} CACHE INTERNAL
"processor type (i386 and x86_64)")
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
ADD_DEFINITIONS(-fPIC)
ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
ENDIF(CMAKE_UNAME)
ENDIF(UNIX AND NOT WIN32)
IF(NOT LIB_INSTALL_DIR)
SET(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
ENDIF(NOT LIB_INSTALL_DIR)
IF(NOT MOD_INSTALL_DIR)
SET(MOD_INSTALL_DIR ${LIB_INSTALL_DIR}/${PROJECT_NAME})
ENDIF(NOT MOD_INSTALL_DIR)
add_definitions(-DPLUGIN_PATH="${MOD_INSTALL_DIR}")
add_definitions(-DPCOORDS_DATADIR="${CMAKE_INSTALL_PREFIX}")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
${CMAKE_CURRENT_SOURCE_DIR}/config.h
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/libpcoords.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/libpcoords.pc
)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpcoords.pc
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig/ )
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LIBPCOORDS_SOURCE_DIR}/cmake)
FIND_PACKAGE(FLEX REQUIRED)
FIND_PACKAGE(BISON REQUIRED)
#FIND_PACKAGE(PCRE REQUIRED)
FIND_PACKAGE(PkgConfig)
pkg_check_modules(Cairo cairo-png)
# Versions of GCC may have warnings I haven't
# it does not mean I don't care of warnings :)
set(CMAKE_C_FLAGS "-Wall -Wextra -O0 -ggdb")
#set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -O0 -ggdb")
add_subdirectory(gnulib)
add_subdirectory(libev)
add_subdirectory(src)
#SET_TARGET_PROPERTIES(pcoords PROPERTIES LINKER_LANGUAGE C)
#SET_TARGET_PROPERTIES(pcoords PROPERTIES COMPILE_FLAGS "-g")
#summary()