File: CMakeLists.txt

package info (click to toggle)
cuneiform 1.1.0%2Bdfsg-4
  • links: PTS
  • area: non-free
  • in suites: wheezy
  • size: 70,900 kB
  • sloc: ansic: 183,501; cpp: 101,934; makefile: 82; sh: 55
file content (67 lines) | stat: -rw-r--r-- 1,855 bytes parent folder | download | duplicates (7)
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
include_directories(Kern/include
Kern/h
Kern/hh
Kern/hhh
Kern/hdebug
Kern/hrk
Kern/hrkint
Kern/hrstr
Kern/fon/src
Kern/usage
)

# Hide non exported functions/variables
include(CheckCCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCC AND NOT WIN32)
    check_c_compiler_flag("-fvisibility=hidden -DHAVE_GCCVISIBILITY" HAVE_GCCVISIBILITY)
    if (HAVE_GCCVISIBILITY)
	    add_definitions("-fvisibility=hidden -DHAVE_GCCVISIBILITY")
    endif()
endif()

# Stop MSVC complaints about POSIX functions.
if(MSVC)
    add_definitions(-D_CRT_SECURE_NO_WARNINGS)
    if(NOT MSVC60)
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
    endif()
endif()


INCLUDE (CheckIncludeFiles)
CHECK_INCLUDE_FILES (endian.h HAVE_ENDIAN_H)

add_definitions(-D_USE_RVERLINE_)

include(FindPkgConfig)
pkg_check_modules(GraphicsMagick QUIET GraphicsMagick++)
if(GraphicsMagick_FOUND)
    set(USE_MAGICK TRUE)
    include_directories(${GraphicsMagick_INCLUDE_DIRS})
    message(STATUS "GraphicsMagick++ found at ${GraphicsMagick_INCLUDE_DIRS}.")
    set(cli_ext_libs ${GraphicsMagick_LIBRARIES})
else()
    set(USE_MAGICK FALSE)
    message(STATUS "GraphicsMagick++ not found. Only uncompressed BMP images supported.")
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Kern/include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/Kern/include/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/Kern/include)

# Libdl is needed only on Apple and Linux (that I know of).
if(NOT WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
    find_library(DL_LIB dl)
endif()

# Emulate Windows DLL symbol resolve order.
if(UNIX AND NOT APPLE)
  set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic")
endif()

if(MINGW)
  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mwindows")
endif()

add_subdirectory(Kern)
add_subdirectory(cli)