summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt50
1 files changed, 2 insertions, 48 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f12093..771f46b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,51 +5,5 @@ set(DOTNET_ROOT /usr/share/dotnet)
set(CSC_DLL ${DOTNET_ROOT}/sdk/10.0.109/Roslyn/bincore/csc.dll)
set(RUNTIME_DIR ${DOTNET_ROOT}/shared/Microsoft.NETCore.App/10.0.9)
-set(OUTPUT_DIR ${CMAKE_BINARY_DIR})
-
-# FooBar library
-set(FOOBAR_SOURCES ${CMAKE_SOURCE_DIR}/FooBar.cs)
-set(FOOBAR_OUTPUT ${OUTPUT_DIR}/FooBar.dll)
-
-add_custom_command(
- OUTPUT ${FOOBAR_OUTPUT}
- COMMAND dotnet ${CSC_DLL}
- -target:library
- -out:${FOOBAR_OUTPUT}
- -lib:${RUNTIME_DIR}
- -reference:System.Private.CoreLib.dll
- -reference:System.Runtime.dll
- -reference:System.Console.dll
- ${FOOBAR_SOURCES}
- DEPENDS ${FOOBAR_SOURCES}
- COMMENT "Compiling FooBar library with Roslyn csc..."
-)
-
-add_custom_target(FooBar ALL DEPENDS ${FOOBAR_OUTPUT})
-
-# HelloCMake executable
-set(SOURCES ${CMAKE_SOURCE_DIR}/Program.cs)
-set(TARGET HelloCMake)
-set(OUTPUT_FILE ${OUTPUT_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:${FOOBAR_OUTPUT}
- -main:Program
- ${SOURCES}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${CMAKE_SOURCE_DIR}/HelloCMake.runtimeconfig.json
- ${OUTPUT_DIR}/${TARGET}.runtimeconfig.json
- DEPENDS ${SOURCES} ${FOOBAR_OUTPUT}
- COMMENT "Compiling ${TARGET} with Roslyn csc..."
-)
-
-add_custom_target(${TARGET} ALL DEPENDS ${OUTPUT_FILE})
-add_dependencies(${TARGET} FooBar)
+add_subdirectory(foobar)
+add_subdirectory(hello)