-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
81 lines (65 loc) · 2.38 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
PROJECT(goollie)
SET (CMAKE_BUILD_TYPE RELEASE)
SET(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
SET(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -O3")
SET(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -O0 -g")
SET(CMAKE_C_FLAGS_DEBUG "-DDEBUG -O0 -g")
SET(CMAKE_MODULE_PATH "${goollie_SOURCE_DIR}/CMakeModules" )
INCLUDE(FindImageMagick)
#INCLUDE(FindSDL2)
INCLUDE(FindOpenGL)
#INCLUDE(FindSDL2_mixer)
INCLUDE(FindPythonLibs)
Find_Package ( SDL2 REQUIRED )
Find_Package ( SDL2_mixer REQUIRED )
Find_Package ( SDL2_image REQUIRED )
Find_Package ( ImageMagick REQUIRED )
Find_Package ( OpenGL REQUIRED )
FIND_PACKAGE(ImageMagickLib)
SET(MY_LINK_LIBS
SDL2::SDL2
SDL2_mixer::SDL2_mixer
SDL2_image::SDL2_image
${OPENGL_LIBRARIES}
${IMAGEMAGICKLIB_LIBRARIES}
${IMAGEMAGICKLIB_CXX_LIBRARIES}
)
IF (PYTHON_LIBRARIES)
MESSAGE("Python development libraries found, building TuxCap Python bindings and examples")
MESSAGE("Python libraries ${PYTHON_LIBRARIES} include path ${PYTHON_INCLUDE_PATH}")
SET(MY_LINK_LIBS ${MY_LINK_LIBS} ${PYTHON_LIBRARIES})
ELSE (PYTHON_LIBRARIES)
MESSAGE("No Python development libraries found, skipping building of TuxCap Python bindings")
ENDIF (PYTHON_LIBRARIES)
SET (MY_DIRS ${MY_DIRS}
src
)
link_libraries (
${MY_LINK_LIBS}
png16
#`sdl2-config --libs`
)
IF(SDL_FOUND OR SDL2_FOUND)
MESSAGE("libSDL found. ${SDL_INCLUDE_DIR} ${SDL_LIBRARY}")
ELSE(SDL_FOUND)
MESSAGE(FATAL_ERROR "libSDL requested but not found.")
ENDIF(SDL_FOUND)
IF(IMAGEMAGICKLIB_FOUND)
MESSAGE("lib ImageMagick found. ${IMAGEMAGICKLIB_INCLUDE_DIR} ${IMAGEMAGICKLIB_LIBRARIES} ${IMAGEMAGICKLIB_CXX_LIBRARIES}")
ELSE(IMAGEMAGICKLIB_FOUND)
MESSAGE(FATAL_ERROR "lib ImageMagick requested but not found.")
ENDIF(IMAGEMAGICKLIB_FOUND)
IF(SDLMIXER_FOUND OR SDL2_mixer_FOUND)
MESSAGE("libSDL_mixer found. ${SDLMIXER_INCLUDE_DIR} ${SDLMIXER_LIBRARY}")
ELSE(SDLMIXER_FOUND)
MESSAGE(FATAL_ERROR "libSDL_mixer requested but not found.")
ENDIF(SDLMIXER_FOUND OR SDL2_mixer_FOUND)
IF(OPENGL_FOUND)
MESSAGE("OpenGL found. ${OPENGL_INCLUDE_DIR} ${OPENGL_LIBRARIES}")
ELSE(OPENGL_FOUND)
MESSAGE(FATAL_ERROR "OpenGL requested but not found.")
ENDIF(OPENGL_FOUND)
SET ( MY_INCLUDE_DIRS
${SDL2_INCLUDE_DIR} ${IMAGEMAGICKLIB_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH} /usr/include/tuxcap)
INCLUDE_DIRECTORIES ( ${MY_INCLUDE_DIRS} )
SUBDIRS( ${MY_DIRS} )