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

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

set(CMAKE_BUILD_TYPE debug)
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -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/device.cpp
../../../common/logger.cpp
../../../common/image.cpp
texture_test.cpp
)

set(MODEL_SOURCES
../gldevice.cpp
../../common/device.cpp
../../common/modelfile.cpp
../../../common/logger.cpp
../../../common/image.cpp
../../../common/iman.cpp
../../../common/stringutils.cpp
../../../app/system.cpp
model_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})

add_executable(model_test ${MODEL_SOURCES})
target_link_libraries(model_test ${LIBS})