Files
itgmania212121/CMake/SetupOggVorbis.cmake
T
TatshandColby Klein d395028bd4 Mac fixes (#1776)
* macOS build fixes (#1773)

* macOS build fixes

Add missing headers
Threads_Pthreads: do not call pthread_setname_np() on macOS as it does not do
the same as on Linux
DebugStr() -> os_log()

* Make the project build with Makefiles on macOS

* Fix getting modifier key state on Mac (#1774)

We really need to clean up all Carbon calls here (many will go away when the
project switches to SDL2 for all platforms)

* Fix Xcode build; bump minimum version of macOS (#1775)

* Build fixes for the "Unix Makefiles" generator
Pass CMAKE_BUILD_TYPE to the external projects
* Fix indent
2018-12-31 19:28:59 -08:00

67 lines
2.6 KiB
CMake

set(SM_OGG_SRC_DIR "${SM_EXTERN_DIR}/libogg-git")
if (NOT (IS_DIRECTORY "${SM_OGG_SRC_DIR}"))
message(ERROR "Submodule for ogg missing. Run git submodule init && git submodule update first.")
endif()
externalproject_add("ogg"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
SOURCE_DIR "${SM_OGG_SRC_DIR}"
UPDATE_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
externalproject_get_property("ogg" BINARY_DIR)
set(SM_OGG_ROOT ${BINARY_DIR})
set(SM_OGG_INCLUDE_DIR "${SM_OGG_SRC_DIR}/include")
if(APPLE AND CMAKE_GENERATOR MATCHES "Unix Makefiles")
# Xcode does this and CMake is somehow aware, but with Unix Makefiles this is
# necessary for the time being.
externalproject_add_step("ogg"
fix-path
COMMAND ${CMAKE_COMMAND} -E make_directory ${SM_OGG_ROOT}/${CMAKE_BUILD_TYPE}
DEPENDEES build)
externalproject_add_step("ogg"
copy-libogg
COMMAND ${CMAKE_COMMAND} -E copy ${SM_OGG_ROOT}/libogg.a ${SM_OGG_ROOT}/${CMAKE_BUILD_TYPE}/
DEPENDEES fix-path)
endif()
set(SM_VORBIS_SRC_DIR "${SM_EXTERN_DIR}/libvorbis-git")
if (NOT (IS_DIRECTORY "${SM_VORBIS_SRC_DIR}"))
message(ERROR "Submodule for vorbis missing. Run git submodule init && git submodule update first.")
endif()
externalproject_add("vorbis"
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DOGG_INCLUDE_DIRS:STRING=${SM_OGG_INCLUDE_DIR} -DOGG_LIBRARIES:STRING=${SM_OGG_ROOT}/${CMAKE_BUILD_TYPE}/libogg.a
SOURCE_DIR "${SM_VORBIS_SRC_DIR}"
UPDATE_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
externalproject_get_property("vorbis" BINARY_DIR)
set(SM_VORBIS_ROOT ${BINARY_DIR})
set(SM_VORBIS_INCLUDE_DIR "${SM_VORBIS_SRC_DIR}/include")
if(APPLE AND CMAKE_GENERATOR MATCHES "Unix Makefiles")
# See note above
externalproject_add_step("vorbis"
fix-path
COMMAND ${CMAKE_COMMAND} -E make_directory ${SM_VORBIS_ROOT}/lib/${CMAKE_BUILD_TYPE}
DEPENDEES build)
externalproject_add_step("vorbis"
copy-libvorbis
COMMAND ${CMAKE_COMMAND} -E copy ${SM_VORBIS_ROOT}/lib/libvorbis.a ${SM_VORBIS_ROOT}/lib/${CMAKE_BUILD_TYPE}/
DEPENDEES fix-path)
externalproject_add_step("vorbis"
copy-libvorbisfile
COMMAND ${CMAKE_COMMAND} -E copy ${SM_VORBIS_ROOT}/lib/libvorbisfile.a ${SM_VORBIS_ROOT}/lib/${CMAKE_BUILD_TYPE}/
DEPENDEES fix-path)
endif()
add_dependencies("vorbis" "ogg")