aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: f54204d7bbe2ee2ebf6656c0d0292e716cf4cfe4 (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 3.0)
project(arider)

# set version number
set(ARIDER_MAJOR_VERSION 0)
set(ARIDER_MINOR_VERSION 2)
set(ARIDER_PATCH_VERSION 0)
set(ARIDER_VERSION
  ${ARIDER_MAJOR_VERSION}.${ARIDER_MINOR_VERSION}${ARIDER_PATCH_VERSION})

# set standard
set(CMAKE_CXX_STANDARD 14)

# set include directories
set(ARIDER_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/include)

# set source directory
set(ARIDER_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src)
set(ARIDER_TEST_DIR ${CMAKE_SOURCE_DIR}/test)

# setting right output directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

set(YAGE_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/YAGE/include/
  ${CMAKE_SOURCE_DIR}/YAGE/include/YAGE/)
set(YAGE_LIBRARIES yage)

# setting up configuration header
configure_file (
  ${CMAKE_SOURCE_DIR}/config/ariderconfig.hpp.in
  ${CMAKE_SOURCE_DIR}/include/ariderconfig.hpp
  )

# adding my executable
add_executable(${PROJECT_NAME}
  ${ARIDER_SOURCE_DIR}/animation.cpp
  ${ARIDER_SOURCE_DIR}/block.cpp  
  ${ARIDER_SOURCE_DIR}/character.cpp
  ${ARIDER_SOURCE_DIR}/game.cpp
  ${ARIDER_SOURCE_DIR}/level.cpp
  ${ARIDER_SOURCE_DIR}/main.cpp
  ${ARIDER_SOURCE_DIR}/particle.cpp
  ${ARIDER_SOURCE_DIR}/player.cpp)

# adding sdl2 library
include(FindPkgConfig)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
pkg_search_module(SDL2 REQUIRED sdl2)

# add yage library
add_subdirectory(YAGE)

# adding include directories
include_directories(${ARIDER_INCLUDE_DIRS}
  ${YAGE_INCLUDE_DIRS}
  ${GLEW_INCLUDE_DIRS}
  ${SLD2_INCLUDE_DIRS})

# link libraries
target_link_libraries(${CMAKE_PROJECT_NAME}
  ${YAGE_LIBRARIES}
  ${OPENGL_LIBRARIES}
  ${GLEW_LIBRARIES}
  ${SDL2_LIBRARIES})