Skip to content

Commit

Permalink
Build a source package using cpack
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Aug 7, 2020
1 parent 055669f commit 73e3dc7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,27 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(LFORTRAN_CXX_NO_RTTI_FLAG "/GR-")
endif ()

# build a CPack driven installer package
# Build a CPack driven installer package
#
# To build a source package:
#
# cpack --config CPackSourceConfig.cmake
#
# To build a binary package:
#
# cpack
#
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_SOURCE_GENERATOR "TBZ2")
set(CPACK_SOURCE_STRIP_FILES YES)
if (LFORTRAN_VERSION STREQUAL "0.1.1")
set(CPACK_SOURCE_PACKAGE_FILE_NAME lfortran-git-Source)
endif()
include(CPack)
# So that CPACK_PACKAGE_FILE_NAME prints the correct value below
if (LFORTRAN_VERSION STREQUAL "0.1.1")
Expand Down Expand Up @@ -126,6 +140,7 @@ message("Configuration results")
message("---------------------")
message("CMAKE_PROJECT_VERSION: ${CMAKE_PROJECT_VERSION}")
message("CPACK_PACKAGE_FILE_NAME: ${CPACK_PACKAGE_FILE_NAME}")
message("CPACK_SOURCE_PACKAGE_FILE_NAME: ${CPACK_SOURCE_PACKAGE_FILE_NAME}")
message("C compiler : ${CMAKE_C_COMPILER}")
message("C++ compiler : ${CMAKE_CXX_COMPILER}")
message("Build type: ${CMAKE_BUILD_TYPE}")
Expand Down

0 comments on commit 73e3dc7

Please sign in to comment.