summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl/test/CMakeLists.txt
blob: 154fec843034edcb396bc6167382f5ac26a3412d (plain)
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
cmake_minimum_required(VERSION 2.8)

find_package(OpenGL REQUIRED)
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)
find_package(PNG REQUIRED)

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE debug)
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wold-style-cast -std=gnu++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")

set(ADD_LIBS "")

if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  set(PLATFORM_WINDOWS 1)
  set(PLATFORM_LINUX   0)
  set(PLATFORM_OTHER   0)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  set(PLATFORM_WINDOWS 0)
  set(PLATFORM_LINUX   1)
  set(PLATFORM_OTHER   0)
  set(ADD_LIBS "-lrt")
else()
  set(PLATFORM_WINDOWS 0)
  set(PLATFORM_LINUX   0)
  set(PLATFORM_OTHER   1)
endif()

configure_file(../../../common/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/common/config.h)


set(TEXTURE_SOURCES
../gldevice.cpp
../../../common/logger.cpp
../../../common/image.cpp
texture_test.cpp
)

set(MODEL_SOURCES
../gldevice.cpp
../../engine/modelfile.cpp
../../../common/logger.cpp
../../../common/image.cpp
../../../common/iman.cpp
../../../common/stringutils.cpp
../../../app/system.cpp
model_test.cpp
)

set(TRANSFORM_SOURCES
../gldevice.cpp
../../../common/logger.cpp
../../../common/image.cpp
../../../common/iman.cpp
../../../app/system.cpp
transform_test.cpp
)

set(LIGHT_SOURCES
../gldevice.cpp
../../../common/logger.cpp
../../../common/image.cpp
../../../common/iman.cpp
../../../app/system.cpp
light_test.cpp
)

include_directories(../../../ ${CMAKE_CURRENT_BINARY_DIR})

set(LIBS
${SDL_LIBRARY}
${SDLIMAGE_LIBRARY}
${OPENGL_LIBRARY}
${PNG_LIBRARIES}
${ADD_LIBS}
)

add_executable(texture_test ${TEXTURE_SOURCES})
target_link_libraries(texture_test ${LIBS})

# Temporarily disabling because of dependencies on CEngine et al.
#add_executable(model_test ${MODEL_SOURCES})
#target_link_libraries(model_test ${LIBS})

add_executable(transform_test ${TRANSFORM_SOURCES})
target_link_libraries(transform_test ${LIBS})

add_executable(light_test ${LIGHT_SOURCES})
target_link_libraries(light_test ${LIBS})