-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathCMakeLists.txt
66 lines (57 loc) · 1.61 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
cmake_minimum_required(VERSION 3.11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Set up as a C++ project
project(emulation CXX)
# Set up convenient directory variables
set(source_directory ${CMAKE_CURRENT_SOURCE_DIR}/src)
# Dependencies
find_package(PNG REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(LibZip REQUIRED)
find_package(PortAudio REQUIRED)
find_package(LibSndFile REQUIRED)
find_package(LibSampleRate REQUIRED)
find_package(GLUT REQUIRED)
find_package(OpenGL REQUIRED)
# Compile-time definitions
add_definitions(-DGL_GLEXT_PROTOTYPES)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
add_definitions(-D_LINUX)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Get sources and headers for the OE libraries
include(${source_directory}/libdiskimage.cmake)
include(${source_directory}/libemulation.cmake)
include(${source_directory}/libemulation-hal.cmake)
include(${source_directory}/libutil.cmake)
# Setup include directories
include_directories(
${libdiskimage_include}
${emulation_hal_include}
${emulation_include}
${libutil_include}
${PNG_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIR}
${PORTAUDIO_INCLUDE_DIRS}
${LIBSNDFILE_INCLUDE_DIR}
${LIBSAMPLERATE_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
${OPENGL_INCLUDE_DIR}
)
# libemulation as a static library
add_library(emulation STATIC
${libdiskimage}
${emulation_hal}
${emulation}
${libutil}
)
target_link_libraries(emulation
${PNG_LIBRARIES}
${LIBXML2_LIBRARIES}
${LIBZIP_LIBRARY}
${PORTAUDIO_LIBRARIES}
${LIBSNDFILE_LIBRARIES}
${LIBSAMPLERATE_LIBRARIES}
${GLUT_LIBRARIES}
${OPENGL_LIBRARIES}
)