From bb3140e4afd04b0c2aa87796c6f91ce8e009ed2c Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 21 Oct 2018 15:07:18 -0400 Subject: [PATCH] update build system --- .gitignore | 7 +++++-- CMakeLists.txt | 12 ++++++++---- CMakeSettings.json | 15 +++++++-------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 2c690ee..3802bc3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ -gui/command.cpp -.vs/ \ No newline at end of file +Build/ +Builds/ +*.vs/ +*.vscode/ +*.user diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ca8a2a..9ee6432 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,10 +7,14 @@ project(ITHVNR) set(WDK_HOME "C:\\WinDDK\\7600.16385.1" CACHE FILEPATH "Windows Driver Kit path") set(CMAKE_INSTALL_PREFIX "" CACHE FILEPATH "installation path") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/Debug") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/Release") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/Debug") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/Release") +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") + set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Builds/${CMAKE_BUILD_TYPE}/x64) +else() + set(CMAKE_FINAL_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Builds/${CMAKE_BUILD_TYPE}/x86) +endif() +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY}) set(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION ON) diff --git a/CMakeSettings.json b/CMakeSettings.json index 9e9c651..2ca513f 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -4,14 +4,13 @@ "name": "x86-Debug", "generator": "Ninja", "configurationType": "Debug", - "inheritEnvironments": [ - "msvc_x86" - ], - "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}", - "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}", - "cmakeCommandArgs": "", - "buildCommandArgs": "-v", - "ctestCommandArgs": "" + "inheritEnvironments": ["msvc_x86"] + }, + { + "name": "x86-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "inheritEnvironments": ["msvc_x86"] } ] } \ No newline at end of file