forked from OneLoneCoder/olcPixelGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
66 lines (50 loc) · 1.5 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
# This CMakeList.txt currently only supports compilation of
# a program on windows or linux, but only with the dependancies
# for oclPixelGameEngine.h
# NOTE: THIS CMAKELIST WILL NOT INSTALL DEPENDANCIES, IT WILL JUST FIND THEM AND
# COMPILE / LINK THEM RESPECTIVELY, YOU NEED TO INSTALL THEM YOURSELF
# Any problems? submit an issue, or contact the author, "Ben (plane000)#8618" on Discord
# Currently linked / compiled by default is:
# Threads (pthread), OpenGL, GLX, libPNG, X11
cmake_minimum_required(VERSION 3.7)
project(olcPixelGameEngine)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CMakeFiles/)
set(Executable output)
set(SourceDir src) # Change src/ to your source directory
set(IncludeDir include/) # Change include/ to your include directory
include_directories(${IncludeDir})
file(GLOB_RECURSE SourceFiles
${SourceDir}/*.cpp
olcExampleProgram.cpp # Remove this
)
set(THREADS_PREFER_PTHREAD_FLAD ON)
find_package(Threads REQUIRED)
find_package(OpenGL REQUIRED)
if (UNIX)
find_package(X11 REQUIRED)
find_package(PNG REQUIRED)
include_directories(${PNG_INCLUDE_DIR})
endif (UNIX)
if (WIN32)
include_directories(${WinSDK})
endif (WIN32)
add_executable(${Executable}
${SourceFiles}
)
link_libraries(${Executable}
Threads::Threads
OpenGL::OpenGL
OpenGL::GL
OpenGL::GLX
)
if (UNIX)
target_link_libraries(${Executable}
${X11_LIBRARIES}
PNG::PNG
)
endif (UNIX)
if (WIN32)
target_link_libraries(${Executable}
${WinSDK}
)
endif (WIN32)