Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Plugins/SWIG/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function(add_swig_plugin target language interfaces)
configure_plugin(${target})

# By adding nwserver-linux to the SWIG directory, we can check for any undefined symbols from mismatching headers.
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/nwserver-linux)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/nwserver-linux)
add_library( nwserver SHARED IMPORTED )
set_target_properties( nwserver PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/nwserver-linux )
target_link_libraries(${target} nwserver)
Expand All @@ -29,7 +29,14 @@ function(add_swig_plugin target language interfaces)
SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON
POSITION_INDEPENDENT_CODE ON)

add_custom_command(TARGET ${target}_swig_compilation POST_BUILD
if(CMAKE_GENERATOR MATCHES "Make")
set(post_process_target ${target}_swig_compilation)
else()
message(STATUS "Generator '${CMAKE_GENERATOR}' does not create intermediate SWIG projects. Post processing will occur after plugin generation.")
set(post_process_target ${target})
endif()

add_custom_command(TARGET ${post_process_target} POST_BUILD
COMMAND chmod a+x postprocess.sh && ./postprocess.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${target}
)
Expand Down