Skip to content

Commit

Permalink
Modified CMake scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ajanicijamd committed Oct 25, 2024
1 parent 5d73408 commit 3c22365
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(_STRIP_LIBRARIES_DEFAULT ON)
endif()

if(DEFINED CMAKE_INSTALL_LIBDIR AND NOT DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR)
if(DEFINED CMAKE_DEFAULT_INSTALL_LIBDIR AND NOT DEFINED CMAKE_INSTALL_LIBDIR)
# always have a fresh install
unset(CMAKE_INSTALL_LIBDIR CACHE)
include(GNUInstallDirs) # install directories
# force this because dyninst always installs to lib
set(CMAKE_DEFAULT_INSTALL_LIBDIR
"${CMAKE_INSTALL_LIBDIR}"
set(CMAKE_INSTALL_LIBDIR
"${CMAKE_DEFAULT_INSTALL_LIBDIR}"
CACHE STRING "Object code libraries" FORCE)
endif()

Expand Down
8 changes: 4 additions & 4 deletions cmake/ElfUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ set(_eu_root ${PROJECT_BINARY_DIR}/external/elfutils)
set(_eu_inc_dirs $<BUILD_INTERFACE:${_eu_root}/include>)
set(_eu_lib_dirs $<BUILD_INTERFACE:${_eu_root}/${CMAKE_INSTALL_LIBDIR}>)
set(_eu_libs
$<BUILD_INTERFACE:${_eu_root}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}>
$<BUILD_INTERFACE:${_eu_root}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}>
$<BUILD_INTERFACE:${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}>
$<BUILD_INTERFACE:${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}>
)
set(_eu_build_byproducts
"${_eu_root}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${_eu_root}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}")
"${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libdw${CMAKE_STATIC_LIBRARY_SUFFIX}"
"${_eu_root}/${CMAKE_INSTALL_LIBDIR}/libelf${CMAKE_STATIC_LIBRARY_SUFFIX}")

externalproject_add(
rocprofiler-systems-elfutils-build
Expand Down
34 changes: 17 additions & 17 deletions cmake/PAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ if(NOT EXISTS "${ROCPROFSYS_PAPI_INSTALL_DIR}")
${ROCPROFSYS_PAPI_INSTALL_DIR}/include)
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR})
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR})
execute_process(
COMMAND
${CMAKE_COMMAND} -E touch
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.so)
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so)
set(_ROCPROFSYS_PAPI_BUILD_BYPRODUCTS
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.so)
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so)
endif()

rocprofiler_systems_add_option(ROCPROFSYS_PAPI_AUTO_COMPONENTS
Expand Down Expand Up @@ -235,12 +235,12 @@ add_custom_target(
COMMAND ${MAKE_EXECUTABLE} distclean
COMMAND ${CMAKE_COMMAND} -E rm -rf ${ROCPROFSYS_PAPI_INSTALL_DIR}/include/*
COMMAND ${CMAKE_COMMAND} -E rm -rf
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/*
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/*
COMMAND
${CMAKE_COMMAND} -E touch
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.so
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so
WORKING_DIRECTORY ${ROCPROFSYS_PAPI_SOURCE_DIR}/src
COMMENT "Cleaning PAPI...")

Expand All @@ -251,16 +251,16 @@ set(PAPI_INCLUDE_DIR
${ROCPROFSYS_PAPI_INSTALL_DIR}/include
CACHE PATH "PAPI include folder" FORCE)
set(PAPI_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_pfm_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.so
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.so
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_STATIC_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpapi.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpapi.a
CACHE FILEPATH "PAPI library" FORCE)
set(PAPI_pfm_STATIC_LIBRARY
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/libpfm.a
${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/libpfm.a
CACHE FILEPATH "PAPI library" FORCE)

target_include_directories(rocprofiler-systems-papi SYSTEM
Expand All @@ -273,8 +273,8 @@ rocprofiler_systems_target_compile_definitions(
$<BUILD_INTERFACE:TIMEMORY_USE_PAPI=1>)

install(
DIRECTORY ${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_DEFAULT_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_DEFAULT_INSTALL_LIBDIR}/${PROJECT_NAME}
DIRECTORY ${ROCPROFSYS_PAPI_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT papi
FILES_MATCHING
PATTERN "*.so*")
Expand Down
4 changes: 2 additions & 2 deletions cmake/Packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ install(
if(ROCPROFSYS_BUILD_LIBUNWIND)
install(
DIRECTORY
${PROJECT_BINARY_DIR}/external/timemory/external/libunwind/install/${CMAKE_DEFAULT_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_DEFAULT_INSTALL_LIBDIR}/${PROJECT_NAME}
${PROJECT_BINARY_DIR}/external/timemory/external/libunwind/install/${CMAKE_INSTALL_LIBDIR}/
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}
COMPONENT libunwind
FILES_MATCHING
PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
Expand Down
2 changes: 1 addition & 1 deletion external/timemory

0 comments on commit 3c22365

Please sign in to comment.