-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
72 lines (60 loc) · 2.3 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
# CMake build file for 3dfsb
# Use:
# cmake . ; make
# ...to build 3dfsb.
# More ideas to improve this file: http://sourceforge.net/p/hugin/hugin/ci/default/tree/CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(3dfsb C)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
#
# Check build type and set options accordingly
#
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
# allow user to specify lib suffix
set(LIB_SUFFIX "" CACHE STRING "Define suffix of lib directory name (32/64)" )
IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
MESSAGE("Building in Debug mode, resulting programs will be SLOW")
ADD_DEFINITIONS(-DDEBUG)
IF(UNIX)
ADD_DEFINITIONS(-Wall)
ENDIF(UNIX)
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
# Generate xpm images from png images
IF(NOT MOGRIFY)
EXEC_PROGRAM(mogrify ARGS -format xpm images/*.png
OUTPUT_VARIABLE MOGRIFY)
SET(MOGRIFY "${MOGRIFY}" CACHE STRING "Mogrify")
ENDIF(NOT MOGRIFY)
# Generate .h files from resource files
IF(NOT XXD)
EXEC_PROGRAM(xxd ARGS -i resources/xorg.conf resources/xorg.conf.h
OUTPUT_VARIABLE XXD)
SET(XXD "${XXD}" CACHE STRING "XXD")
ENDIF(NOT XXD)
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT)
find_package(GStreamer REQUIRED)
find_package(LibMagic REQUIRED)
find_package(ImageMagick COMPONENTS mogrify REQUIRED)
find_package(LibM REQUIRED)
find_package(GLIB COMPONENTS gobject REQUIRED)
find_package(X11 REQUIRED)
find_package(Xdo REQUIRED)
find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
include_directories(${SDL_INCLUDE_DIR}
${GSTREAMER_INCLUDE_DIRS}
)
add_library(input input.c)
add_library(str_replace str_replace.c)
add_library(media media.c)
add_library(config config.c)
add_library(tools tools.c)
add_executable(3dfsb 3dfsb.c)
add_dependencies(3dfsb images)
target_link_libraries(3dfsb input str_replace media config tools ${SDL_LIBRARY} ${SDL_IMAGE_LIBRARIES} ${OPENGL_LIBRARIES} ${GSTREAMER_LIBRARIES} ${GLUT_glut_LIBRARY} ${LibMagic_LIBRARY} ${LibM_LIBRARY} ${GLIB_GOBJECT_LIBRARIES} ${GLIB_LIBRARIES} ${XDO_LIBRARIES} ${X11_XTest_LIB})