mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-05 08:33:53 +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,31 +1,55 @@
|
||||
#directory cmake-proxies/sbsms
|
||||
set( TARGET sbsms )
|
||||
set( TARGET_SOURCE ${LIB_SRC_DIRECTORY}${TARGET} )
|
||||
project( ${TARGET} )
|
||||
|
||||
set( SOURCES
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/buffer.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/dBTable.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/fft.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/grain.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/resample.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/sbsms.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/slide.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/sms.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/subband.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/track.cpp
|
||||
${LIB_SRC_DIRECTORY}sbsms/src/trackpoint.cpp
|
||||
)
|
||||
# This defines the #define on both Windows and Linux.
|
||||
add_definitions(
|
||||
-D_LIB
|
||||
-DNDEBUG
|
||||
)
|
||||
add_library( ${TARGET} STATIC ${SOURCES})
|
||||
add_library( ${TARGET} STATIC )
|
||||
|
||||
target_include_directories( ${TARGET} PRIVATE
|
||||
${TARGET_SOURCE}/include
|
||||
${TARGET_SOURCE}/win
|
||||
list( APPEND SOURCES
|
||||
PRIVATE
|
||||
${TARGET_ROOT}/src/buffer.cpp
|
||||
${TARGET_ROOT}/src/dBTable.cpp
|
||||
${TARGET_ROOT}/src/fft.cpp
|
||||
${TARGET_ROOT}/src/grain.cpp
|
||||
${TARGET_ROOT}/src/resample.cpp
|
||||
${TARGET_ROOT}/src/sbsms.cpp
|
||||
${TARGET_ROOT}/src/slide.cpp
|
||||
${TARGET_ROOT}/src/sms.cpp
|
||||
${TARGET_ROOT}/src/subband.cpp
|
||||
${TARGET_ROOT}/src/track.cpp
|
||||
${TARGET_ROOT}/src/trackpoint.cpp
|
||||
)
|
||||
|
||||
target_link_libraries( ${TARGET} )
|
||||
list( APPEND INCLUDES
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/private
|
||||
PUBLIC
|
||||
${TARGET_ROOT}/include
|
||||
)
|
||||
|
||||
list( APPEND OPTIONS
|
||||
PRIVATE
|
||||
$<$<C_COMPILER_ID:CLANG>:-Wno-enum-compare>
|
||||
$<$<C_COMPILER_ID:GNU>:-Wno-enum-compare>
|
||||
)
|
||||
|
||||
find_package( Threads )
|
||||
if( Threads_FOUND AND CMAKE_USE_PTHREADS_INIT )
|
||||
set( MULTITHREADED 1 )
|
||||
endif()
|
||||
|
||||
if( UNIX )
|
||||
check_cxx_compiler_flag( "-msse" ENABLE_SSE )
|
||||
if( ENABLE_SSE )
|
||||
list( APPEND OPTIONS
|
||||
PRIVATE -msse
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
configure_file( config.h.in private/config.h )
|
||||
|
||||
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} )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user