From 4b789f893446ac66035ffc439e221351d77b8f68 Mon Sep 17 00:00:00 2001 From: Jun Liu Date: Wed, 13 Sep 2023 14:38:12 -0700 Subject: [PATCH] [Cmake] Set cmake default build type Release and path to /opt/rocm (#914) [ROCm/composable_kernel commit: 5fe687fa270aeb9e387278a52ea4f09d997c4b6b] --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a79af9cc32..e3b60347d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,18 @@ cmake_minimum_required(VERSION 3.14) +# This has to be initialized before the project() command appears +# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE +if( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." ) +endif() + +# Default installation path +if(WIN32) + set(CMAKE_INSTALL_PREFIX "/opt/rocm/x86_64-w64-mingw32" CACHE PATH "") +else() + set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "") +endif() + set(version 1.1.0) # Check support for CUDA/HIP in Cmake project(composable_kernel VERSION ${version})