-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
44 lines (37 loc) · 1.2 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
cmake_minimum_required(VERSION 3.19)
project(gm82snd CXX)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "/O2 /GS- /W2 /WX")
endif()
add_library(gm82snd SHARED GMFMODSimpleGrix/source/main_STUDIO.cpp)
target_include_directories(gm82snd PRIVATE GMFMODSimpleGrix/source)
target_link_directories(gm82snd PRIVATE GMFMODSimpleGrix/source)
target_link_libraries(gm82snd fmodex_vc)
option(INSTALL_GEX "Install the generated .gex" OFF)
set(GEX_URL https://raw.githubusercontent.com/GM82Project/gm82gex/main/gm82gex.py)
set(GEX_PY ${CMAKE_SOURCE_DIR}/gm82gex.py)
file(DOWNLOAD ${GEX_URL} STATUS DOWNLOAD_STATUS)
list(GET DOWNLOAD_STATUS 0 STATUS_CODE)
if(${STATUS_CODE} EQUAL 0)
file(DOWNLOAD ${GEX_URL} ${GEX_PY})
else()
message(WARNING "Couldn't redownload gm82gex.py")
endif()
if (INSTALL_GEX)
add_custom_command(
TARGET gm82snd
POST_BUILD
COMMAND py ${GEX_PY} gm82snd.gej
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Building .gex"
)
else()
add_custom_command(
TARGET gm82snd
POST_BUILD
COMMAND py ${GEX_PY} gm82snd.gej --noinstall
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Building .gex"
)
endif()