From a68f4f242cf5c3ff790510fb89bd1a6af1dc383a Mon Sep 17 00:00:00 2001 From: Dilawar Singh <dilawars@ncbs.res.in> Date: Sat, 8 Jul 2017 11:47:05 +0530 Subject: [PATCH] Fixed to CMP0048 missing policy error. Fix found at Qucs/qucs#66. Conflicts: CMakeLists.txt --- CMakeLists.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7041adaf..ad7e56e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,25 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(MOOSE) -set(_MOOSE_VERSION_ "3.2" ) +project(moose) + +if(POLICY CMP0048) + cmake_policy(SET CMP0048 OLD ) +endif(POLICY CMP0048) + +# If from command line, version info is not passed, use the git to generate a +# version file. If GIT fails, use the previous known version. +find_program(GIT_EXEC "git") +message( STATUS "Looking for git ${GIT_EXEC}" ) +if( (NOT MOOSE_VERSION) AND GIT_EXEC) + execute_process( + COMMAND ${GIT_EXEC} describe --tags --long + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE MOOSE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif( ) +message( STATUS "Building version ${MOOSE_VERSION}" ) # Options to pass down to moose-core option(WITH_DOC "Build documentation" OFF) -- GitLab