From 2c74c8a08becb4cc12f3b7b280e46e9816a5dc21 Mon Sep 17 00:00:00 2001 From: Bernhard Guillon Date: Tue, 30 Jun 2026 20:31:21 +0200 Subject: Reorganize into hello/ and foobar/ subdirectories --- hello/CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 hello/CMakeLists.txt (limited to 'hello/CMakeLists.txt') diff --git a/hello/CMakeLists.txt b/hello/CMakeLists.txt new file mode 100644 index 0000000..3d1427d --- /dev/null +++ b/hello/CMakeLists.txt @@ -0,0 +1,25 @@ +set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Program.cs) +set(TARGET HelloCMake) +set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/${TARGET}.dll) + +add_custom_command( + OUTPUT ${OUTPUT_FILE} + COMMAND dotnet ${CSC_DLL} + -target:exe + -out:${OUTPUT_FILE} + -lib:${RUNTIME_DIR} + -reference:System.Private.CoreLib.dll + -reference:System.Runtime.dll + -reference:System.Console.dll + -reference:${CMAKE_BINARY_DIR}/FooBar.dll + -main:Program + ${SOURCES} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/HelloCMake.runtimeconfig.json + ${CMAKE_BINARY_DIR}/${TARGET}.runtimeconfig.json + DEPENDS ${SOURCES} ${CMAKE_BINARY_DIR}/FooBar.dll + COMMENT "Compiling ${TARGET} with Roslyn csc..." +) + +add_custom_target(${TARGET} ALL DEPENDS ${OUTPUT_FILE}) +add_dependencies(${TARGET} FooBar) -- cgit v1.2.3