This repository has been archived by the owner on May 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
75 lines (62 loc) · 1.94 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
cmake_minimum_required(VERSION 2.8)
# add modules
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
# set version
set(LIBNPENGINE_VERSION_MAJOR "0")
set(LIBNPENGINE_VERSION_MINOR "4")
set(LIBNPENGINE_VERSION_PATCH "0")
set(LIBNPENGINE_VERSION
"${LIBNPENGINE_VERSION_MAJOR}.${LIBNPENGINE_VERSION_MINOR}.${LIBNPENGINE_VERSION_PATCH}"
)
# append git revision if available
include(get-git-revision)
get_git_revision(LIBNPENGINE_VERSION_GIT)
if(NOT "${LIBNPENGINE_VERSION_GIT}" STREQUAL "")
set(LIBNPENGINE_VERSION "${LIBNPENGINE_VERSION}-${LIBNPENGINE_VERSION_GIT}")
endif()
message(STATUS "Configuring libnpengine version " ${LIBNPENGINE_VERSION})
# project name and language
project (libnpengine CXX)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2")
# include version number in header
configure_file(${PROJECT_SOURCE_DIR}/include/npengineversion.hpp.in
${PROJECT_SOURCE_DIR}/include/npengineversion.hpp)
find_package(SFML 2 REQUIRED COMPONENTS system window graphics)
find_package(Boost REQUIRED COMPONENTS locale)
find_package(GStreamer REQUIRED)
find_package(GLIB REQUIRED)
find_package(NPA REQUIRED)
include_directories(
${SFML_INCLUDE_DIR}
${GSTREAMER_INCLUDE_DIRS}
${GSTREAMER_VIDEO_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
${NPA_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/include
)
link_directories(
${Boost_LIBRARY_DIRS}
)
add_library(npengine SHARED
src/drawable.cpp
src/game.cpp
src/movie.cpp
src/nsbbuiltins.cpp
src/nsbcontext.cpp
src/nsbdebugger.cpp
src/nsbinterpreter.cpp
src/nsbmagichandlers.cpp
src/playable.cpp
src/resourcemgr.cpp
src/text.cpp
)
# install headers and library
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION include/libnpengine
FILES_MATCHING PATTERN "*.hpp")
install(TARGETS npengine DESTINATION lib)
# create packages
set(CPACK_GENERATOR "TBZ2")
set(CPACK_PACKAGE_VERSION ${LIBNPENGINE_VERSION})
include(CPack)