Define MSVC default build configruations, build paths, etc

This commit is contained in:
Luke Usher 2019-05-16 12:02:16 +01:00
parent 9553eb4add
commit 863b999841
3 changed files with 35 additions and 10 deletions

View File

@ -1,10 +1,5 @@
cmake_minimum_required (VERSION 3.8)
# Enforce to use Windows 8.1 SDK
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(CMAKE_SYSTEM_VERSION 8.1 CACHE TYPE INTERNAL FORCE)
endif()
project(Cxbx-Reloaded)
# Allow devs to disable regeneration option.
@ -27,8 +22,8 @@ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/XbSymbolDatabase")
#add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/SDL2")
if ("${CMAKE_CSharp_COMPILER}")
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/cs_x86")
if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/import/cs_x86")
endif()
# Cxbx-Reloaded projects
@ -351,7 +346,7 @@ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbx")
# Issues with compile (the same with develop branch) and
# for some reason did not put the files into virtual folder?
# Might need to put the list in the source folder for workaround fix.
if ("${CMAKE_CSharp_COMPILER}")
if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
#add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/debugger")
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/src/CxbxDebugger")
endif()
@ -361,7 +356,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set_property(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PROPERTY VS_STARTUP_PROJECT cxbx)
endif()
if ("${CMAKE_CSharp_COMPILER}")
if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
# Refuse to exclude due to install is not set to optional
#set_target_properties(cstool
# PROPERTIES EXCLUDE_FROM_ALL TRUE

30
CMakeSettings.json Normal file
View File

@ -0,0 +1,30 @@
{
"configurations": [
{
"name": "x86-Release",
"generator": "Visual Studio 15 2017",
"configurationType": "Release",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\bin\\Release",
"cmakeCommandArgs": "",
"buildCommandArgs": "/v:m",
"ctestCommandArgs": ""
},
{
"name": "x86-Debug",
"generator": "Visual Studio 15 2017",
"configurationType": "Debug",
"inheritEnvironments": [
"msvc_x86"
],
"buildRoot": "${workspaceRoot}\\build\\${name}",
"installRoot": "${workspaceRoot}\\bin\\Debug",
"cmakeCommandArgs": "",
"buildCommandArgs": "/v:m",
"ctestCommandArgs": ""
}
]
}

View File

@ -183,7 +183,7 @@ target_link_libraries(cxbx
${WINS_LIB}
)
if ("${CMAKE_CSharp_COMPILER}")
if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
add_dependencies(cxbx cxbxr-debugger)
endif()