-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
41 lines (34 loc) · 1.46 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
cmake_minimum_required(VERSION 2.8.5)
project(libsaturn)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# ensure that the cxx files get compiled with c++11 support enabled
set(CMAKE_CXX_FLAGS "--std=c++11 ${CMAKE_CXX_FLAGS}")
# ensure the linker can find libsaturn
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# create a standalone library file for integration
set(SATURN_LIB_SRC ${CMAKE_CURRENT_SOURCE_DIR})
add_library (libsaturn
${SATURN_LIB_SRC}/src/dcpu.cpp
# device files
${SATURN_LIB_SRC}/src/device/clock.cpp
${SATURN_LIB_SRC}/src/device/keyboard.cpp
${SATURN_LIB_SRC}/src/device/lem1802.cpp
${SATURN_LIB_SRC}/src/device/m35fd.cpp
${SATURN_LIB_SRC}/src/device/disk.cpp
${SATURN_LIB_SRC}/src/device/fstream_disk.cpp
${SATURN_LIB_SRC}/src/device/mem_disk.cpp
${SATURN_LIB_SRC}/src/device/sped3.cpp
# misc
${SATURN_LIB_SRC}/src/utilities.cpp
)
# ensure that the output file for libsaturn only contains one lib (ie, not liblibsaturn)
set_target_properties(libsaturn PROPERTIES PREFIX "")
# if testing has been enabled, build the tests and run them! :D
add_executable(test_libsaturn
${CMAKE_CURRENT_SOURCE_DIR}/tests/tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_device.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_disk.cpp
)
target_link_libraries(test_libsaturn libsaturn)