mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-23 17:11:13 +01:00
Updates the cmake build system
It's still has some work, but it successfully builds on all 3 main platforms. Some of the outstanding items include: Install target testing (mostly important for Linux) CMakeList clean up and comments Debug and Release build verification Audit of compile/link options Need a Mac signed and notarized build (and probably more)
This commit is contained in:
@@ -1,10 +1,53 @@
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
set(TARGET portmidi)
|
||||
set(TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET})
|
||||
add_library( ${TARGET} STATIC )
|
||||
|
||||
list( APPEND SOURCES
|
||||
PRIVATE
|
||||
${TARGET_ROOT}/pm_common/portmidi.c
|
||||
${TARGET_ROOT}/pm_common/pmutil.c
|
||||
${TARGET_ROOT}/porttime/porttime.c
|
||||
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/pm_win/pmwin.c>
|
||||
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/pm_win/pmwinmm.c>
|
||||
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/porttime/ptwinmm.c>
|
||||
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/finddefault.c>
|
||||
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/pmmac.c>
|
||||
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/pmmacosxcm.c>
|
||||
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_mac/readbinaryplist.c>
|
||||
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/porttime/ptmacosx_mach.c>
|
||||
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux/finddefault.c>
|
||||
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux/pmlinux.c>
|
||||
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux/pmlinuxalsa.c>
|
||||
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/porttime/ptlinux.c>
|
||||
)
|
||||
|
||||
list( APPEND INCLUDES
|
||||
PRIVATE
|
||||
${TARGET_ROOT}/pm_common
|
||||
${TARGET_ROOT}/porttime
|
||||
$<$<PLATFORM_ID:Windows>:${TARGET_ROOT}/pm_win>
|
||||
$<$<PLATFORM_ID:Linux>:${TARGET_ROOT}/pm_linux>
|
||||
$<$<PLATFORM_ID:Darwin>:${TARGET_ROOT}/pm_win>
|
||||
)
|
||||
|
||||
list( APPEND DEFINES
|
||||
PRIVATE
|
||||
$<$<PLATFORM_ID:Linux>:PMALSA=1>
|
||||
)
|
||||
|
||||
list( APPEND OPTIONS
|
||||
PRIVATE
|
||||
$<$<PLATFORM_ID:Linux>:
|
||||
-Wno-pointer-to-int-cast
|
||||
-Wno-int-to-pointer-cast
|
||||
-Wno-implicit-function-declaration
|
||||
>
|
||||
)
|
||||
|
||||
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
|
||||
target_sources( ${TARGET} PRIVATE ${SOURCES} )
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
|
||||
target_compile_features( ${TARGET} PRIVATE ${FEATURES} )
|
||||
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
|
||||
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
|
||||
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )
|
||||
|
||||
set(CMAKE_CACHEFILE_DIR ${CMAKE_BINARY_DIR})
|
||||
add_subdirectory( "${TARGET_SOURCE}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}" EXCLUDE_FROM_ALL )
|
||||
set_target_properties(portmidi-static PROPERTIES
|
||||
OSX_ARCHITECTURES ""
|
||||
OUTPUT_NAME ${TARGET})
|
||||
|
||||
Reference in New Issue
Block a user