Skip to content

Commit

Permalink
Make cmake finder more energyplus / EnergyPlus aware
Browse files Browse the repository at this point in the history
  • Loading branch information
kbenne authored and axelstudios committed Apr 21, 2015
1 parent c12e604 commit 3921ece
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions openstudiocore/CMake/FindEnergyPlus.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ foreach(PATH ${ENERGYPLUS_POSSIBLE_PATHS})
if(IS_MATCH)
if(${VERSION_MAJOR_MINOR} VERSION_LESS "8.0.0")
find_program(ENERGYPLUS_EXE "energyplus" PATHS "${PATH}" "${PATH}/bin" NO_DEFAULT_PATH)
elseif(${VERSION_MAJOR_MINOR} VERSION_GREATER "8.3.0")
find_program(ENERGYPLUS_EXE "energyplus" PATHS "${PATH}" "${PATH}/bin" NO_DEFAULT_PATH)
elseif(${VERSION_MAJOR_MINOR} VERSION_EQUAL "8.3.0")
find_program(ENERGYPLUS_EXE "energyplus" PATHS "${PATH}" "${PATH}/bin" NO_DEFAULT_PATH)
else()
find_program(ENERGYPLUS_EXE "EnergyPlus" PATHS "${PATH}" "${PATH}/bin" NO_DEFAULT_PATH)
endif()
Expand Down Expand Up @@ -130,7 +134,7 @@ mark_as_advanced(
# compatible and it also doesn't know about EnergyPlus build SHA.
if(ENERGYPLUS_GE_8_2_0 AND ENERGYPLUS_BUILD_SHA)
if(NOT (ENERGYPLUS_BUILD_SHA STREQUAL BUILD_SHA))
message(FATAL_ERROR "Found EnergyPlus version: ${VERSION} with build SHA: ${BUILD_SHA}, but project requires build SHA: ${ENERGYPLUS_BUILD_SHA}")
message(FATAL_ERROR "Found EnergyPlus version: ${VERSION} with build SHA: ${BUILD_SHA}, but project requires version: ${EnergyPlus_FIND_VERSION} with build SHA: ${ENERGYPLUS_BUILD_SHA}")
endif()
endif()

Expand All @@ -140,13 +144,3 @@ if(NOT (${VERSION_MAJOR_MINOR} VERSION_EQUAL "${EnergyPlus_FIND_VERSION_MAJOR}.$
message(FATAL_ERROR "Found EnergyPlus version: ${VERSION} , but project requires ${EnergyPlus_FIND_VERSION_MAJOR}.${EnergyPlus_FIND_VERSION_MINOR}")
endif()

# Do this because we are not sure if we will have found energyplus or EnergyPlus
get_filename_component(ENERGYPLUS_NAME "${ENERGYPLUS_EXE}" NAME_WE)

# Do this because we want to use the FindPackageHandleStandardArgs routine's standard find messaging
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${ENERGYPLUS_NAME} FOUND_VAR EnergyPlus_FOUND
REQUIRED_VARS ENERGYPLUS_EXE ENERGYPLUS_IDD ENERGYPLUS_WEATHER_DIR
VERSION_VAR VERSION
)

5 comments on commit 3921ece

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

iteration (kbenne) - x86_64-MacOS-10.9-clang: Build Failed

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.

iteration (kbenne) - x86_64-Linux-Ubuntu-14.04-clang-3.5: Build Failed

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.

iteration (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.

iteration (kbenne) - i386-Windows-7-VisualStudio-12: Build Failed

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.

iteration (kbenne) - Win64-Windows-7-VisualStudio-12: Build Failed

Build Badge Test Badge

Please sign in to comment.