Skip to content

Commit

Permalink
Merge branch 'develop' into FixLCC_Escalataion_6144
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGlazer committed Sep 5, 2019
2 parents 77dfe1f + 5be6096 commit 55cd95c
Show file tree
Hide file tree
Showing 172 changed files with 29,861 additions and 2,542 deletions.
7 changes: 7 additions & 0 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,10 @@ if("Ninja" STREQUAL ${CMAKE_GENERATOR})
endif()
endif()

# Xcode/Ninja generators undefined MAKE
if(CMAKE_GENERATOR MATCHES "Make")
set(MAKE "$(MAKE)")
else()
set(MAKE make)
endif()

56 changes: 53 additions & 3 deletions cmake/Install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ if( WIN32 AND NOT UNIX )
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries)
if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION "./")
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION "./")
endif()
endif()

Expand Down Expand Up @@ -443,7 +443,7 @@ elseif(WIN32)
# You need at least one "install(..." command for it to be registered as a component
install(CODE "MESSAGE(\"Registering filetypes.\")" COMPONENT RegisterFileType)
install(CODE "MESSAGE(\"Copying and Registering DLLs\")" COMPONENT CopyAndRegisterSystemDLLs)

install(CODE "MESSAGE(\"Creating start menu.\")" COMPONENT CreateStartMenu)

endif()

Expand Down Expand Up @@ -482,6 +482,44 @@ set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake")
########################################################## D O C U M E N T A T I O N #############################################################

if ( BUILD_DOCS )
# Call the build of target documentation explicitly here.
# Note: This is because you can't do `add_dependencies(package documentation)` (https://gitlab.kitware.com/cmake/cmake/issues/8438)
# Adding another custom target to be added to the "ALL" one (so it runs) and make it depend on the actual "documentation" target doesn't work
# because it'll always run if you have enabled BUILD_DOCS, regardless of whether you are calling the target "package" or not
# add_custom_target(run_documentation ALL)
# add_dependencies(run_documentation documentation)
#message(FATAL_ERROR "CMAKE_COMMAND=${CMAKE_COMMAND}")

# +env will pass the current environment and will end up respecting the -j parameter
# this ↓↓↓ here -- https://stackoverflow.com/a/41268443/531179
#install(CODE "execute_process(COMMAND +env \"${CMAKE_COMMAND}\" --build \"${CMAKE_BINARY_DIR}\" --target documentation)")
# Except it doesn't work with install(execute_process...

# Passing $(MAKE) doesn't work either, and isn't a great idea for cross platform support anyways
# install(CODE "execute_process(COMMAND ${MAKE} ${DOC_BUILD_FLAGS} -C \"${CMAKE_BINARY_DIR}\" documentation)")

# So instead, we just used the number of threads that are available. That's not ideal, since it ignores any "-j N" option passed by the user
# But LaTeX should run quickly enough to not be a major inconvenience.
# There no need to do that for Ninja for eg, so only do it for Make and MSVC

# flag -j to cmake --build was added at 3.12 (VERSION_GREATER_EQUAL need cmake >= 3.7, we apparently support 2.8...)
if(NOT(CMAKE_VERSION VERSION_LESS "3.12") AND ((CMAKE_GENERATOR MATCHES "Make") OR WIN32))
include(ProcessorCount)
ProcessorCount(N)
if(NOT N EQUAL 0)
set(DOC_BUILD_FLAGS "-j ${N}")
endif()
endif()
if(WIN32)
# Win32 is multi config, so you must specify a config when calling cmake.
# Let's just use Release, it won't have any effect on LaTeX anyways.
set(DOC_CONFIG_FLAG "--config Release")
endif()

# Getting these commands to work (especially with macro expansion) is tricky. Check the resulting `cmake_install.cmake` file in your build folder if need to debug this
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build \"${CMAKE_BINARY_DIR}\" ${DOC_CONFIG_FLAG} ${DOC_BUILD_FLAGS} --target documentation)"
COMPONENT Documentation)

install(FILES "${CMAKE_BINARY_DIR}/doc-pdf/Acknowledgments.pdf" DESTINATION "./Documentation" COMPONENT Documentation)
install(FILES "${CMAKE_BINARY_DIR}/doc-pdf/AuxiliaryPrograms.pdf" DESTINATION "./Documentation" COMPONENT Documentation)
install(FILES "${CMAKE_BINARY_DIR}/doc-pdf/EMSApplicationGuide.pdf" DESTINATION "./Documentation" COMPONENT Documentation)
Expand All @@ -496,9 +534,11 @@ if ( BUILD_DOCS )
install(FILES "${CMAKE_BINARY_DIR}/doc-pdf/PlantApplicationGuide.pdf" DESTINATION "./Documentation" COMPONENT Documentation)
install(FILES "${CMAKE_BINARY_DIR}/doc-pdf/TipsAndTricksUsingEnergyPlus.pdf" DESTINATION "./Documentation" COMPONENT Documentation)
install(FILES "${CMAKE_BINARY_DIR}/doc-pdf/UsingEnergyPlusForCompliance.pdf" DESTINATION "./Documentation" COMPONENT Documentation)
else()
message(AUTHOR_WARNING "BUILD_DOCS isn't enabled, so package won't include the PDFs")
endif ()

########################################################## S Y S T E M L I B R A R I E S #############################################################
########################################################## S Y S T E M L I B R A R I E S ######################################################

# TODO: is this unecessary now? I had forgotten to actually create a Libraries via cpack_add_component but everything seemed fined
# At worse, try not to uncomment this as is, but place it inside an if(PLATFORM) statement
Expand Down Expand Up @@ -559,6 +599,12 @@ cpack_add_component(Licenses
DESCRIPTION "License files for EnergyPlus"
REQUIRED)

# No need for system privileges for this
cpack_add_component(CreateStartMenu
DISPLAY_NAME "Start Menu links"
DESCRIPTION "Create Start Menu Links"
)

cpack_add_component(RegisterFileType
DISPLAY_NAME "Associate with EP-Launch and IDFEditor"
DESCRIPTION "Associate *.idf, *.imf, and *.epg files with EP-Launch, *.ddy and *.expidf with IDFEditor.exe"
Expand All @@ -585,6 +631,10 @@ cpack_ifw_configure_component(Symlinks
REQUIRES_ADMIN_RIGHTS
)

cpack_ifw_configure_component(CreateStartMenu
SCRIPT cmake/qtifw/install_win_createstartmenu.qs
)

cpack_ifw_configure_component(RegisterFileType
SCRIPT cmake/qtifw/install_registerfiletype.qs
REQUIRES_ADMIN_RIGHTS
Expand Down
13 changes: 1 addition & 12 deletions cmake/qtifw/install_operations.qs
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,7 @@ function Component()
// On Windows
if( kernel == "winnt" ) {

// Create Shortcuts in the Windows Start Menu
component.addOperation("CreateShortcut", "@TargetDir@/Documentation/index.html", "@StartMenuDir@/EnergyPlus Documentation.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PostProcess/EP-Compare/EP-Compare.exe", "@StartMenuDir@/EP-Compare.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/EPDraw/EPDrawGUI.exe", "@StartMenuDir@/EPDrawGUI.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/EP-Launch.exe", "@StartMenuDir@/EP-Launch.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles.html", "@StartMenuDir@/Example Files Summary.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles-ObjectsLink.html", "@StartMenuDir@/ExampleFiles Link to Objects.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFEditor/IDFEditor.exe", "@StartMenuDir@/IDFEditor.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.exe", "@StartMenuDir@/IDFVersionUpdater.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/readme.html", "@StartMenuDir@/Readme Notes.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/WeatherConverter/Weather.exe", "@StartMenuDir@/Weather Statistics and Conversions.lnk");

// Create Shortcuts in the Windows Start Menu: done separately (optional)

// Note: Associate file types: done separately (optional)

Expand Down
29 changes: 29 additions & 0 deletions cmake/qtifw/install_win_createstartmenu.qs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Windows commands to be performed elevated: copy and register DLLs

function Component()
{
Component.prototype.createOperations = function()
{
// call default implementation
component.createOperations();

// ... add custom operations

var kernel = systemInfo.kernelType;
// On Windows
if( kernel == "winnt" ) {

component.addOperation("CreateShortcut", "@TargetDir@/Documentation/index.html", "@StartMenuDir@/EnergyPlus Documentation.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PostProcess/EP-Compare/EP-Compare.exe", "@StartMenuDir@/EP-Compare.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/EPDraw/EPDrawGUI.exe", "@StartMenuDir@/EPDrawGUI.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/EP-Launch.exe", "@StartMenuDir@/EP-Launch.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles.html", "@StartMenuDir@/Example Files Summary.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/ExampleFiles/ExampleFiles-ObjectsLink.html", "@StartMenuDir@/ExampleFiles Link to Objects.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFEditor/IDFEditor.exe", "@StartMenuDir@/IDFEditor.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/IDFVersionUpdater/IDFVersionUpdater.exe", "@StartMenuDir@/IDFVersionUpdater.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/readme.html", "@StartMenuDir@/Readme Notes.lnk");
component.addOperation("CreateShortcut", "@TargetDir@/PreProcess/WeatherConverter/Weather.exe", "@StartMenuDir@/Weather Statistics and Conversions.lnk");

}
}
}

7 comments on commit 55cd95c

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (9 of 9 tests passed, 0 test warnings)

Build Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-MacOS-10.13-clang: OK (2556 of 2556 tests passed, 7 test warnings)

Messages:\n

  • 7 tests had: BND diffs.

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4: OK (2596 of 2596 tests passed, 7 test warnings)

Messages:\n

  • 7 tests had: BND diffs.

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-UnitTestsCoverage-Debug: OK (1218 of 1218 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

FixLCC_Escalataion_6144 (JasonGlazer) - Win64-Windows-10-VisualStudio-16: OK (2556 of 2556 tests passed, 7 test warnings)

Messages:\n

  • 7 tests had: BND diffs.

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

FixLCC_Escalataion_6144 (JasonGlazer) - x86_64-Linux-Ubuntu-18.04-gcc-7.4-IntegrationCoverage-Debug: OK (673 of 673 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.