From 57a2d13dbe721a407fd40d1361cca1c0087b0893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Tue, 28 Jun 2022 11:24:35 +0300 Subject: [PATCH] install cmake files to custom path --- CMakeLists.txt | 9 ++++++++- install.bat | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85d699f..a609a63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,11 @@ cmake_minimum_required(VERSION 3.0) project(cmake) file(GLOB CMAKES "*.cmake" "*.in" "*.keystore") -install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules) +if(INSTALL_DIR) + set(INSTFILES "CMakeLists.txt" "install.bat") + install(FILES ${CMAKES} ${INSTFILES} DESTINATION ${INSTALL_DIR}/cmake) + message(STATUS "Install path for cmake files -> \"${INSTALL_DIR}/cmake\"") +else() + install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules) + message(STATUS "Install path for cmake files -> \"${CMAKE_ROOT}/Modules\"") +endif() diff --git a/install.bat b/install.bat index 06051b4..afbee17 100644 --- a/install.bat +++ b/install.bat @@ -1,6 +1,7 @@ @echo off if not exist build mkdir build cd build && ^ -cmake_mgw .. && ^ +cmake -G "CodeBlocks - MinGW Makefiles" .. && ^ make install && ^ cd .. +pause