From 8faa8c86e08092c15d250a6f18a58ccbb27f68f2 Mon Sep 17 00:00:00 2001
From: gcontini <1121667+gcontini@users.noreply.github.com>
Date: 周日, 01 9月 2019 18:50:18 +0800
Subject: [PATCH] Merge branch 'master' of https://github.com/open-license-manager/open-license-manager.git

---
 src/tools/bootstrap/CMakeLists.txt |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt
index 8ea8f08..856fc5f 100644
--- a/src/tools/bootstrap/CMakeLists.txt
+++ b/src/tools/bootstrap/CMakeLists.txt
@@ -1,6 +1,6 @@
 add_executable(
  bootstrap
- Main.cpp
+ bootstrap.cpp
 )
 
 
@@ -13,14 +13,24 @@
 )
 
 # add the command to generate the source code
-add_custom_command (
-  OUTPUT "${CMAKE_BINARY_DIR}/src/tools/license-generator/private-key.h" "${CMAKE_BINARY_DIR}/src/library/base/public-key.h"
-  COMMAND bootstrap "${CMAKE_BINARY_DIR}/src/tools/license-generator/private-key.h" "${CMAKE_BINARY_DIR}/src/library/base/public-key.h"
-  DEPENDS bootstrap
-)
 
-add_custom_target(private_key DEPENDS "${CMAKE_BINARY_DIR}/src/tools/license-generator/private-key.h")
-add_custom_target(public_key DEPENDS "${CMAKE_BINARY_DIR}/src/library/base/public-key.h")
+if(MINGW)
+add_custom_command (
+  OUTPUT "${CMAKE_BINARY_DIR}/private-key.h" "${CMAKE_BINARY_DIR}/public-key.h"
+  COMMAND ./bootstrap.exe "${CMAKE_BINARY_DIR}/private-key.h" "${CMAKE_BINARY_DIR}/public-key.h"
+  WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  DEPENDS bootstrap)
+else(MINGW)
+add_custom_command (
+  OUTPUT "${CMAKE_BINARY_DIR}/private-key.h" "${CMAKE_BINARY_DIR}/public-key.h"
+  COMMAND bootstrap "${CMAKE_BINARY_DIR}/private-key.h" "${CMAKE_BINARY_DIR}/public-key.h"
+  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+  DEPENDS bootstrap)
+endif(MINGW)
+
+
+add_custom_target(private_key DEPENDS "${CMAKE_BINARY_DIR}/private-key.h")
+add_custom_target(public_key DEPENDS "${CMAKE_BINARY_DIR}/public-key.h")
 
 
 # add the command to generate the source code

--
Gitblit v1.9.1