Skip to content

Commit

Permalink
Merge pull request #4348 from NREL/EnableCIPackaging
Browse files Browse the repository at this point in the history
Enable packaging flags
  • Loading branch information
kbenne committed Jul 18, 2014
2 parents f829dc3 + f2da8ca commit 3ea5ad3
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .decent_ci-Linux.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
compilers:
- name: "gcc"
version: "4.8"
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON -DBUILD_PACKAGE:BOOL=ON
- name: cppcheck
compiler_extra_flags: --enable=warning --suppress="*:*gtest*" --suppress="constStatement:*Objex*" --suppress="cppcheckError:*" --suppres="uninitvar:*"
4 changes: 2 additions & 2 deletions .decent_ci-MacOS.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
compilers:
- name: clang
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON -DBUILD_PACKAGE:BOOL=ON
- name: clang
build_type: Debug
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON -DBUILD_PACKAGE:BOOL=ON

4 changes: 2 additions & 2 deletions .decent_ci-Windows.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
compilers:
- name: Visual Studio
version: 12
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON -DBUILD_PACKAGE:BOOL=ON
- name: Visual Studio
version: 12
architecture: Win64
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON
cmake_extra_flags: -DBUILD_TESTING:BOOL=ON -DBUILD_PACKAGE:BOOL=ON


24 changes: 23 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@ set( CMAKE_VERSION_MAJOR 8 )
set( CMAKE_VERSION_MINOR 2 )
set( CMAKE_VERSION_PATCH 0 )

set( CMAKE_VERSION_BUILD "Unknown" CACHE STRING "Build number" )
find_package(Git)
if(GIT_FOUND)
execute_process(COMMAND "${GIT_EXECUTABLE}" "rev-parse" "--short=10" "HEAD"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
TIMEOUT 10
RESULT_VARIABLE RESULT
OUTPUT_VARIABLE GIT_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${RESULT} EQUAL 0 AND NOT "${GIT_VERSION}" EQUAL "${CMAKE_VERSION_BUILD}")
set(CMAKE_VERSION_BUILD ${GIT_VERSION} CACHE STRING "Build number" FORCE) # git sha
endif()

get_filename_component(GIT_DIR "${GIT_EXECUTABLE}" PATH)
else()
set(GIT_DIR "")
endif()


set(CPACK_PACKAGE_CONTACT "Kyle Benne <[email protected]>")

option( BUILD_PACKAGE "Build package" OFF )
option( BUILD_TESTING "Build testing targets" OFF )
option( BUILD_FORTRAN "Build Fortran stuff" OFF )
Expand Down Expand Up @@ -52,7 +74,7 @@ install( FILES idd/Energy+.idd DESTINATION ./ )

if( BUILD_PACKAGE )
set(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};EnergyPLus;ALL;/"
"${CMAKE_BINARY_DIR};EnergyPlus;ALL;/"
)

if( BUILD_FORTRAN )
Expand Down
22 changes: 21 additions & 1 deletion CPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@ set( CPACK_PACKAGE_VENDOR "US Department of Energy" )

set(CPACK_PACKAGE_VERSION_MAJOR "${CMAKE_VERSION_MAJOR}" )
set(CPACK_PACKAGE_VERSION_MINOR "${CMAKE_VERSION_MINOR}" )
set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_VERSION_PATCH}" )
set(CPACK_PACKAGE_VERSION_PATCH "${CMAKE_VERSION_PATCH}" )
set(CPACK_PACKAGE_VERSION_BUILD "${CMAKE_VERSION_BUILD}" )

set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${CPACK_PACKAGE_VERSION_BUILD}")

set(PROJECT_VERSION_STRING ${CPACK_PACKAGE_VERSION_MAJOR}-${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH} )

set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")

if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-win64")
else()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-win32")
endif()
else()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CMAKE_SYSTEM_NAME}")
endif()

if(NOT CMAKE_BUILD_TYPE STREQUAL "" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CMAKE_BUILD_TYPE}")
endif()

if( win32 AND NOT unix )
include(InstallRequiredSystemLibraries)
if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
Expand Down

5 comments on commit 3ea5ad3

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (kbenne) - x86_64-MacOS-10.9-clang: OK (968 of 968 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (kbenne) - x86_64-MacOS-10.9-clang-Debug: OK (963 of 968 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (kbenne) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (968 of 968 tests passed)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (kbenne) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

develop (kbenne) - i386-Windows-7-VisualStudio-12: OK (968 of 968 tests passed)

Build Badge Test Badge

Please sign in to comment.