1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-23 09:15:46 +01:00

cmake function audacity_module abstracts common module setup steps...

... But leaving the wxDEBUG definition in each.  It should not be in the reused
function.
This commit is contained in:
Paul Licameli
2020-09-17 22:11:50 -04:00
committed by Leland Lucius
parent 20e818cb9e
commit 938bbeb4f9
4 changed files with 91 additions and 148 deletions

View File

@@ -1,27 +1,8 @@
set( TARGET mod-script-pipe )
set( TARGET_ROOT ${CMAKE_CURRENT_SOURCE_DIR} )
message( STATUS "========== Configuring ${TARGET} ==========" )
def_vars()
add_library( ${TARGET} MODULE )
list( APPEND SOURCES
PRIVATE
${TARGET_ROOT}/PipeServer.cpp
${TARGET_ROOT}/ScripterCallback.cpp
set( SOURCES
PipeServer.cpp
ScripterCallback.cpp
)
get_target_property( INCLUDES wxWidgets INTERFACE_INCLUDE_DIRECTORIES )
list( APPEND INCLUDES
PUBLIC
${TARGET_ROOT}
)
get_target_property( DEFINES wxWidgets INTERFACE_COMPILE_DEFINITIONS )
list( APPEND DEFINES
set( DEFINES
PRIVATE
BUILDING_SCRIPT_PIPE
@@ -32,29 +13,5 @@ list( APPEND DEFINES
# debug versions of wxWidgets...even if the build is for Release.
wxDEBUG_LEVEL=0
)
list( APPEND LOPTS
PRIVATE
$<$<PLATFORM_ID:Darwin>:-undefined dynamic_lookup>
)
list( APPEND LIBRARIES
PRIVATE
Audacity
$<$<PLATFORM_ID:Windows,CYGWIN>:wxWidgets>
)
set_target_property_all( ${TARGET} LIBRARY_OUTPUT_DIRECTORY "${_MODDIR}" )
set_target_properties( ${TARGET}
PROPERTIES
PREFIX ""
FOLDER "modules"
)
organize_source( "${TARGET_ROOT}" "" "${SOURCES}" )
target_sources( ${TARGET} PRIVATE ${SOURCES} )
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
target_link_options( ${TARGET} PRIVATE ${LOPTS} )
target_link_libraries( ${TARGET} PRIVATE ${LIBRARIES} )
audacity_module( mod-script-pipe "${SOURCES}" "wxWidgets"
"${DEFINES}" "" )