I want to create a solution in MSVC using CMake that has two projects (in CMake vocabulary one C# executive and one C++/CLR library).
How can I do this? All examples that I found are about one type of project in a CMake (all C++ or C#).
To clarify:
If I want to create a C++/CLR project using CMake, I can write code like this:
cmake_minimum_required (VERSION 3.5)
project (TestCppClr)
if (NOT MSVC)
message(FATAL_ERROR "This CMake files only wirks with MSVC.")
endif(NOT MSVC)
ADD_EXECUTABLE(testCppClr "${CMAKE_SOURCE_DIR}/main.cpp")
set_target_properties(testCppClr PROPERTIES COMMON_LANGUAGE_RUNTIME "")
and if I want to create a project targeting C#, I can write something such as this:
cmake_minimum_required (VERSION 3.5)
project(Example VERSION 0.1.0 LANGUAGES CSharp)
if (NOT MSVC)
message(FATAL_ERROR "This CMake files only wirks with MSVC.")
endif(NOT MSVC)
add_executable(Example
App.config
App.xaml
App.xaml.cs
MainWindow.xaml
MainWindow.xaml.cs
Properties/AssemblyInfo.cs
Properties/Resources.Designer.cs
Properties/Resources.resx
Properties/Settings.Designer.cs
Properties/Settings.settings)
I cannot find any way to combine these two CMake files, so I can create an executable in C++/CLR and another project in C#.
Is there any way that I can do this?