2019-03-17 19:36:55 +01:00
|
|
|
file(GLOB CODING_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/coding/*.h")
|
|
|
|
file(GLOB CODING_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/coding/*.c")
|
|
|
|
file(GLOB LAYOUT_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/layout/*.h")
|
|
|
|
file(GLOB LAYOUT_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/layout/*.c")
|
|
|
|
file(GLOB META_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/meta/*.h")
|
|
|
|
file(GLOB META_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/meta/*.c")
|
2021-08-26 22:37:34 +02:00
|
|
|
file(GLOB UTIL_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/util/*.h")
|
|
|
|
file(GLOB UTIL_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/util/*.c")
|
2019-03-17 19:36:55 +01:00
|
|
|
set(EXT_HEADERS
|
2020-01-11 17:34:51 +01:00
|
|
|
${VGM_SOURCE_DIR}/ext_includes/pstdint.h)
|
2019-03-17 19:36:55 +01:00
|
|
|
file(GLOB MAIN_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
|
|
|
|
file(GLOB MAIN_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.c")
|
|
|
|
|
|
|
|
# stack_allow.h is not being used, so no need to include it in the sources
|
|
|
|
list(REMOVE_ITEM MAIN_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/stack_alloc.h)
|
|
|
|
|
|
|
|
# Setup source groups, mainly for Visual Studio
|
|
|
|
source_group("Header Files\\coding" FILES ${CODING_HEADERS})
|
|
|
|
source_group("Header Files\\layout" FILES ${LAYOUT_HEADERS})
|
|
|
|
source_group("Header Files\\meta" FILES ${META_HEADERS})
|
2021-08-26 18:41:03 +02:00
|
|
|
source_group("Header Files\\util" FILES ${UTIL_HEADERS})
|
2019-03-17 19:36:55 +01:00
|
|
|
source_group("Header Files\\ext" FILES ${EXT_HEADERS})
|
|
|
|
source_group("Source Files\\coding" FILES ${CODING_SOURCES})
|
|
|
|
source_group("Source Files\\layout" FILES ${LAYOUT_SOURCES})
|
|
|
|
source_group("Source Files\\meta" FILES ${META_SOURCES})
|
2021-08-26 18:41:03 +02:00
|
|
|
source_group("Source Files\\util" FILES ${UTIL_SOURCES})
|
2019-03-17 19:36:55 +01:00
|
|
|
|
2021-10-02 23:36:19 +02:00
|
|
|
set(libvgmstream_sources
|
2019-03-17 19:36:55 +01:00
|
|
|
${CODING_HEADERS}
|
|
|
|
${CODING_SOURCES}
|
|
|
|
${LAYOUT_HEADERS}
|
|
|
|
${LAYOUT_SOURCES}
|
|
|
|
${META_HEADERS}
|
|
|
|
${META_SOURCES}
|
2021-08-26 18:41:03 +02:00
|
|
|
${UTIL_HEADERS}
|
|
|
|
${UTIL_SOURCES}
|
2019-03-17 19:36:55 +01:00
|
|
|
${EXT_HEADERS}
|
|
|
|
${MAIN_HEADERS}
|
2021-10-02 23:36:19 +02:00
|
|
|
${MAIN_SOURCES}
|
|
|
|
)
|
|
|
|
# Set up the proper include directories
|
|
|
|
set(libvgmstream_includes
|
|
|
|
${VGM_SOURCE_DIR}/ext_includes
|
|
|
|
coding
|
|
|
|
layout
|
|
|
|
meta
|
|
|
|
util
|
|
|
|
)
|
|
|
|
|
|
|
|
# libvgmstream.a
|
|
|
|
add_library(libvgmstream STATIC ${libvgmstream_sources})
|
2021-10-02 08:00:53 +02:00
|
|
|
set_target_properties(libvgmstream PROPERTIES PREFIX "")
|
|
|
|
|
2021-10-02 23:36:19 +02:00
|
|
|
if(USE_FFMPEG AND FFMPEG_COMPILE)
|
2021-10-02 08:00:53 +02:00
|
|
|
add_dependencies(libvgmstream avcodec)
|
|
|
|
endif()
|
2019-03-17 19:36:55 +01:00
|
|
|
|
|
|
|
setup_target(libvgmstream)
|
|
|
|
|
2021-10-02 23:36:19 +02:00
|
|
|
target_include_directories(libvgmstream PRIVATE ${libvgmstream_includes})
|
|
|
|
|
|
|
|
# libvgmstream.so
|
2021-10-25 09:06:59 +02:00
|
|
|
if(NOT EMSCRIPTEN)
|
|
|
|
add_library(libvgmstream_shared SHARED EXCLUDE_FROM_ALL ${libvgmstream_sources})
|
|
|
|
set_target_properties(libvgmstream_shared PROPERTIES
|
|
|
|
PREFIX ""
|
|
|
|
OUTPUT_NAME "libvgmstream"
|
|
|
|
)
|
|
|
|
|
|
|
|
if(USE_FFMPEG AND FFMPEG_COMPILE)
|
|
|
|
add_dependencies(libvgmstream_shared avcodec)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
setup_target(libvgmstream_shared TRUE)
|
|
|
|
|
|
|
|
target_include_directories(libvgmstream_shared PRIVATE ${libvgmstream_includes})
|
2021-10-02 23:36:19 +02:00
|
|
|
endif()
|