CMakeLists.txt 747 Bytes
Newer Older
1
cmake_minimum_required(VERSION 3.3)
2
3
4
5
# a simple CSharp only test case
project (CSharpOnly CSharp)

# C# does not make any difference between STATIC and SHARED libs
6
7
8
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)
9
10
11
12
add_library(lib2 SHARED lib2.cs)

add_executable(CSharpOnly csharponly.cs)
target_link_libraries(CSharpOnly lib1 lib2)
13

14
15
16
17
18
19
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>
  )

20
21
add_custom_target(CSharpCustom ALL SOURCES empty.cs)
add_custom_target(custom.cs ALL DEPENDS empty.txt)