CMakeLists.txt 806 B

123456789101112131415161718192021222324
  1. cmake_minimum_required(VERSION 3.3)
  2. if(POLICY CMP0126)
  3. cmake_policy(SET CMP0126 NEW)
  4. endif()
  5. # a simple CSharp only test case
  6. project (CSharpOnly CSharp)
  7. # C# does not make any difference between STATIC and SHARED libs
  8. add_library(lib1 STATIC lib1.cs nested/lib1.cs)
  9. #without the source group this test will fail to compile
  10. source_group(nested FILES nested/lib1.cs)
  11. add_library(lib2 SHARED lib2.cs)
  12. add_executable(CSharpOnly csharponly.cs)
  13. target_link_libraries(CSharpOnly lib1 lib2)
  14. add_executable(CSharpConfigSpecific
  15. $<$<CONFIG:Debug>:config_specific_main_debug.cs>
  16. $<$<NOT:$<CONFIG:Debug>>:config_specific_main_not_debug.cs>
  17. $<$<CONFIG:NotAConfig>:config_specific_main_no_exist.cs>
  18. )
  19. add_custom_target(CSharpCustom ALL SOURCES empty.cs)
  20. add_custom_target(custom.cs ALL DEPENDS empty.txt)