From a98c3541b725f6bbb2e7d49201f4469d4548dac7 Mon Sep 17 00:00:00 2001
From: Gabriele Contini <contini.mailing@gmail.com>
Date: 周六, 07 12月 2019 18:13:59 +0800
Subject: [PATCH] modified cmake scripts for easy export and import

---
 test/CMakeLists.txt |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c1be16e..ca37f3d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -8,11 +8,16 @@
 	"${CMAKE_CURRENT_SOURCE_DIR}/../src/templates/licensecc_properties_test.h.in" 
 	"${CMAKE_BINARY_DIR}/licensecc_properties_test.h.tmp"
 )
-
-cmake_policy(SET CMP0070 NEW)
-file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/include/$<CONFIG>/licensecc_properties_test.h" 
+IF(${CMAKE_VERSION} VERSION_GREATER  3.0)
+	file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/include/$<CONFIG>/licensecc_properties_test.h" 
 		INPUT "${CMAKE_BINARY_DIR}/licensecc_properties_test.h.tmp")
+	include_directories ( ${CMAKE_BINARY_DIR}/include/$<CONFIG> )
+ELSE(${CMAKE_VERSION} VERSION_GREATER  3.0)
+#patch for Centos 7 cmake 2.8.11 :(
+	file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/include/$<CONFIGURATION>/licensecc_properties_test.h" 
+		INPUT "${CMAKE_BINARY_DIR}/licensecc_properties_test.h.tmp")
+	include_directories ( ${CMAKE_BINARY_DIR}/include/$<CONFIGURATION> )
+endif(${CMAKE_VERSION} VERSION_GREATER  3.0)
 
-include_directories ( ${CMAKE_BINARY_DIR}/include/$<CONFIG> )
 add_subdirectory(library)
 add_subdirectory(functional)
\ No newline at end of file

--
Gitblit v1.9.1