Skip to content

Commit

Permalink
Fixing paths for lm sensors in HPX configs, and correcting cmake warn…
Browse files Browse the repository at this point in the history
…ings.
  • Loading branch information
khuck committed Jan 27, 2021
1 parent a531e54 commit 3ced879
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 65 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ endif()
################################################################################

if((DEFINED LM_SENSORS_ROOT) OR (APEX_WITH_LM_SENSORS))
find_package(LMSensors)
find_package(LM_SENSORS)
if (LM_SENSORS_FOUND)
include_directories(${LM_SENSORS_INCLUDE_DIRS})
set(LIBS ${LIBS} ${LM_SENSORS_LIBRARIES})
Expand All @@ -531,7 +531,7 @@ if((DEFINED APEX_WITH_ACTIVEHARMONY) AND (NOT APEX_WITH_ACTIVEHARMONY))
endif()

if(((DEFINED ACTIVEHARMONY_ROOT) OR (APEX_BUILD_ACTIVEHARMONY)) OR (APEX_WITH_ACTIVEHARMONY))
find_package(ActiveHarmony)
find_package(ACTIVEHARMONY)
if (ACTIVEHARMONY_FOUND)
include_directories(${ACTIVEHARMONY_INCLUDE_DIRS})
set(LIBS ${LIBS} ${ACTIVEHARMONY_LIBRARIES})
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/APEX_SetupActiveHarmony.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if(APEX_WITH_ACTIVEHARMONY)

find_package(ActiveHarmony)
find_package(ACTIVEHARMONY)
if(NOT ACTIVEHARMONY_FOUND)
hpx_error("apex" "Requested APEX_WITH_ACTIVEHARMONY but could not find \
Active Harmony. Please specify ACTIVEHARMONY_ROOT.")
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/APEX_SetupLMSensors.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Setup an imported target for lmsensors
if(APEX_WITH_LM_SENSORS)

find_package(LMSensors)
find_package(LM_SENSORS)

if (NOT LM_SENSORS_FOUND)
hpx_error("apex" "Requested APEX_WITH_LM_SENSORS but could not find LM \
Expand Down
File renamed without changes.
61 changes: 0 additions & 61 deletions cmake/Modules/FindLMSensors.cmake

This file was deleted.

41 changes: 41 additions & 0 deletions cmake/Modules/FindLM_SENSORS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# - Try to find LM_SENSORS
# Once done this will define
# LM_SENSORS_FOUND - True if LM_SENSORS found.
# LM_SENSORS_INCLUDE_DIR - where to find LM_SENSORS.h, etc.
# LM_SENSORS_LIBRARIES - List of libraries when using LM_SENSORS.


if(NOT DEFINED $LM_SENSORS_ROOT)
if(DEFINED ENV{LM_SENSORS_ROOT})
# message(" env LM_SENSORS_ROOT is defined as $ENV{LM_SENSORS_ROOT}")
set(LM_SENSORS_ROOT $ENV{LM_SENSORS_ROOT})
endif()
endif()

find_path(LM_SENSORS_INCLUDE_DIR sensors/sensors.h
HINTS ${LM_SENSORS_ROOT}/include
/opt/local/include /usr/local/include /usr/include)

find_library(LM_SENSORS_LIBRARY NAMES sensors
HINTS ${LM_SENSORS_ROOT}/lib
/usr/lib /usr/lib64 /usr/local/lib /opt/local/lib)




include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LM_SENSORS_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LM_SENSORS DEFAULT_MSG
LM_SENSORS_LIBRARY LM_SENSORS_INCLUDE_DIR)

mark_as_advanced(LM_SENSORS_INCLUDE_DIR LM_SENSORS_LIBRARY)

if (LM_SENSORS_FOUND)
set(LM_SENSORS_LIBRARIES ${LM_SENSORS_LIBRARY} )
set(LM_SENSORS_INCLUDE_DIRS ${LM_SENSORS_INCLUDE_DIR})
set(LM_SENSORS_DIR ${LM_SENSORS_ROOT})
add_definitions(-DAPEX_HAVE_LM_SENSORS)
message(STATUS "Found LM_SENSORS: ${LM_SENSORS_LIBRARY}")
endif ()

0 comments on commit 3ced879

Please sign in to comment.