cmake/Tests/CSharpOnly/CMakeLists.txt

25 lines
806 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
cmake_minimum_required(VERSION 3.3)
if(POLICY CMP0126)
cmake_policy(SET CMP0126 NEW)
endif()
2017-04-14 19:02:05 +02:00
# a simple CSharp only test case
project (CSharpOnly CSharp)
# C# does not make any difference between STATIC and SHARED libs
2020-08-30 11:54:41 +02:00
add_library(lib1 STATIC lib1.cs nested/lib1.cs)
#without the source group this test will fail to compile
source_group(nested FILES nested/lib1.cs)
2017-04-14 19:02:05 +02:00
add_library(lib2 SHARED lib2.cs)
add_executable(CSharpOnly csharponly.cs)
target_link_libraries(CSharpOnly lib1 lib2)
2018-10-28 12:09:07 +01:00
2021-09-14 00:13:48 +02:00
add_executable(CSharpConfigSpecific
$<$<CONFIG:Debug>:config_specific_main_debug.cs>
$<$<NOT:$<CONFIG:Debug>>:config_specific_main_not_debug.cs>
$<$<CONFIG:NotAConfig>:config_specific_main_no_exist.cs>
)
2018-11-29 20:27:00 +01:00
add_custom_target(CSharpCustom ALL SOURCES empty.cs)
add_custom_target(custom.cs ALL DEPENDS empty.txt)