-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (51 loc) · 1.71 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
cmake_minimum_required(VERSION 3.25)
set(PLATFORM "win" CACHE STRING "Platform")
set(ARCH "x64" CACHE STRING "Arch")
message(STATUS "PLATFORM: ${PLATFORM}")
message(STATUS "ARCH: ${ARCH}")
file(READ src/ppuc_version.h version)
string(REGEX MATCH "PPUC_EXECUTABLE_VERSION_MAJOR[ ]+([0-9]+)" _tmp ${version})
set(VERSION_MAJOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "PPUC_EXECUTABLE_VERSION_MINOR[ ]+([0-9]+)" _tmp ${version})
set(VERSION_MINOR "${CMAKE_MATCH_1}")
string(REGEX MATCH "PPUC_EXECUTABLE_VERSION_PATCH[ ]+([0-9]+)" _tmp ${version})
set(VERSION_PATCH "${CMAKE_MATCH_1}")
project(ppuc_executable VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
DESCRIPTION "Pinball Power-Up Controller (PPUC)")
if(PLATFORM STREQUAL "win")
if(ARCH STREQUAL "x86")
add_compile_definitions(WIN32)
endif()
elseif(PLATFORM STREQUAL "macos")
set(CMAKE_OSX_DEPLOYMENT_TARGET 13.0)
if (ARCH STREQUAL "arm64")
set(CMAKE_OSX_ARCHITECTURES arm64)
elseif(ARCH STREQUAL "x64")
set(CMAKE_OSX_ARCHITECTURES x86_64)
endif()
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "@executable_path")
elseif(PLATFORM STREQUAL "linux" OR PLATFORM STREQUAL "android")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
endif()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_C_VISIBILITY_PRESET hidden)
add_executable(ppuc_pinmame
src/ppuc.cpp
)
target_include_directories(ppuc_pinmame PUBLIC
third-party/include
)
target_link_directories(ppuc_pinmame PUBLIC
third-party/runtime-libs/${PLATFORM}/${ARCH}
)
target_link_libraries(ppuc_pinmame LINK_PUBLIC
pinmame
ppuc
dmdutil
openal
cargs
)