summaryrefslogtreecommitdiffstats
path: root/Tests/UseSWIG/NamespaceCsharp/CMakeLists.txt
blob: 51ec1b29117cbf1902d0202514d461cd0278fbff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cmake_minimum_required(VERSION 3.12...3.13)

project(TestNamespaceCsharp CXX)

include(CTest)

find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})

set(UseSWIG_MODULE_VERSION 2)


add_library(ns_example STATIC ns_example.cpp)
target_include_directories(ns_example PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")

set_property(SOURCE ns_example.i PROPERTY CPLUSPLUS ON)

swig_add_library(ns_csharp TYPE SHARED LANGUAGE csharp SOURCES ns_example.i)
set_target_properties(ns_csharp PROPERTIES SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE)

target_link_libraries(ns_csharp PRIVATE ns_example)

get_target_property(NS_CSHARP_SUPPORT_FILES_DIR ns_csharp SWIG_SUPPORT_FILES_DIRECTORY)

add_test(NAME NamespaceCsharp COMMAND "${CMAKE_COMMAND}" "-DSUPPORT_FILES_DIRECTORY=${NS_CSHARP_SUPPORT_FILES_DIR}" -P "${CMAKE_CURRENT_SOURCE_DIR}/ValidateSupportFiles.cmake")