Last active
July 24, 2018 14:46
-
-
Save DavidHamburg/4b18fc8f0311644678d53972684e358c to your computer and use it in GitHub Desktop.
cmake c++/cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.5) | |
project(myproject) | |
set(SOURCE_FILES src/main.cpp) | |
add_executable(myproject ${SOURCE_FILES}) | |
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6") | |
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DOTNET_REFERENCES "System") | |
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr /EHa") | |
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") | |
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") | |
TARGET_LINK_LIBRARIES(myproject) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment