Skip to content

Commit

Permalink
Update CMakeLists.txt to work with the new version
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 28, 2020
1 parent e30aed0 commit 584b19b
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
set(CMAKE_USER_MAKE_RULES_OVERRIDE ${CMAKE_SOURCE_DIR}/cmake/UserOverride.cmake)

file(STRINGS "version" LFORTRAN_VERSION)
if (LFORTRAN_VERSION MATCHES git)
# CMake only allows integers in the version, so we use the version 0.1.1 to
# mean an unreleased git commit
set(LFORTRAN_VERSION "0.1.1")
endif ()

project(lfortran LANGUAGES C CXX VERSION ${LFORTRAN_VERSION})
project(lfortran LANGUAGES C CXX)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

Expand Down Expand Up @@ -45,14 +40,10 @@ include(GNUInstallDirs)
include(InstallRequiredSystemLibraries)
set(CPACK_GENERATOR "TBZ2")
set(CPACK_STRIP_FILES YES)
if (LFORTRAN_VERSION STREQUAL "0.1.1")
set(CPACK_PACKAGE_FILE_NAME lfortran-git-${CMAKE_SYSTEM_NAME})
endif()
set(CPACK_PACKAGE_FILE_NAME lfortran-${LFORTRAN_VERSION}-${CMAKE_SYSTEM_NAME})
include(CPack)
# So that CPACK_PACKAGE_FILE_NAME prints the correct value below
if (LFORTRAN_VERSION STREQUAL "0.1.1")
set(CPACK_PACKAGE_FILE_NAME lfortran-git-${CMAKE_SYSTEM_NAME})
endif()
set(CPACK_PACKAGE_FILE_NAME lfortran-${LFORTRAN_VERSION}-${CMAKE_SYSTEM_NAME})


if (NOT CMAKE_CXX_STANDARD)
Expand Down Expand Up @@ -175,7 +166,7 @@ enable_testing()
message("\n")
message("Configuration results")
message("---------------------")
message("CMAKE_PROJECT_VERSION: ${CMAKE_PROJECT_VERSION}")
message("LFORTRAN_VERSION: ${LFORTRAN_VERSION}")
message("CPACK_PACKAGE_FILE_NAME: ${CPACK_PACKAGE_FILE_NAME}")
message("C compiler : ${CMAKE_C_COMPILER}")
message("C++ compiler : ${CMAKE_CXX_COMPILER}")
Expand Down

0 comments on commit 584b19b

Please sign in to comment.