Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/CSharpOnly/CMakeLists.txt
3148 views
1
cmake_minimum_required(VERSION 3.10)
2
if(POLICY CMP0126)
3
cmake_policy(SET CMP0126 NEW)
4
endif()
5
# a simple CSharp only test case
6
project (CSharpOnly CSharp)
7
8
# C# does not make any difference between STATIC and SHARED libs
9
add_library(lib1 STATIC lib1.cs nested/lib1.cs)
10
#without the source group this test will fail to compile
11
source_group(nested FILES nested/lib1.cs)
12
add_library(lib2 SHARED lib2.cs)
13
14
add_executable(CSharpOnly csharponly.cs)
15
target_link_libraries(CSharpOnly lib1 lib2)
16
17
add_executable(CSharpConfigSpecific
18
$<$<CONFIG:Debug>:config_specific_main_debug.cs>
19
$<$<NOT:$<CONFIG:Debug>>:config_specific_main_not_debug.cs>
20
$<$<CONFIG:NotAConfig>:config_specific_main_no_exist.cs>
21
)
22
23
add_custom_target(CSharpCustom ALL SOURCES empty.cs)
24
add_custom_target(custom.cs ALL DEPENDS empty.txt)
25
26