diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d237087c3a157433f353aa1b657b6055296735f..78296ee7d1fb961f5f06da93aa33969756cf9e80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,12 +61,12 @@ if(WITH_MPI) endif() if(ENABLE_EXTRAE) - find_package(Extrae REQUIRED) - if(Extrae_FOUND) + find_package(EXTRAE REQUIRED) + if(EXTRAE_FOUND) target_include_directories(nesmik - PRIVATE ${Extrae_INCLUDE_DIRS}) + PRIVATE ${EXTRAE_INCLUDE_DIRS}) # We link publicy with seqtrace, as we need it to be in the right order to libc to find malloc with dlsym .. - target_link_libraries(nesmik PUBLIC ${Extrae_LIBRARIES}) + target_link_libraries(nesmik PUBLIC ${EXTRAE_LIBRARIES}) target_compile_definitions(nesmik PRIVATE "ENABLE_EXTRAE") else() message(FATAL_ERROR "Couldn't find Extrae") diff --git a/cmake/FindEXTRAE.cmake b/cmake/FindEXTRAE.cmake new file mode 100644 index 0000000000000000000000000000000000000000..97e04c4c6b56c1a95f4a164f3b2ab30d4f1a1c1c --- /dev/null +++ b/cmake/FindEXTRAE.cmake @@ -0,0 +1,87 @@ +#[=======================================================================[.rst: +FindEXTRAE +------- + +Finds the EXTRAE library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides the following imported targets, if found: + The EXTRAE library + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables: + +``EXTRAE_FOUND`` + True if the system has the EXTRAE library. +``EXTRAE_DIR`` + The root directory of the EXTRAE library. +``EXTRAE_INCLUDE_DIRS`` + Include directories needed to use EXTRAE. +``EXTRAE_LIBRARIES`` + Libraries needed to link to EXTRAE. + +Cache Variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``EXTRAE_DIR`` + The EXTRAE installation directory (prefix). +#]=======================================================================] + + +if(NOT EXTRAE_DIR) + if(DEFINED ENV{EXTRAE_HOME}) + message(STATUS "Find EXTRAE: No EXTRAE_DIR provided: Falling back on $ENV{EXTRAE_HOME}") + set(EXTRAE_DIR $ENV{EXTRAE_HOME} ) + else() + message(STATUS "Find EXTRAE: Trying to find EXTRAE in the normal system paths as $EXTRAE_HOME is not specified") + endif() +endif() + + + +if(DEFINED EXTRAE_LIB) + find_library(EXTRAE_LIBRARY + NAMES ${EXTRAE_LIB} + HINTS ${EXTRAE_DIR} + PATH_SUFFIXES lib lib64) +else() + find_library(EXTRAE_LIBRARY + NAMES seqtrace + HINTS ${EXTRAE_DIR} + PATH_SUFFIXES lib lib64) +endif() + + +find_path(EXTRAE_INCLUDE_DIR + NAMES extrae.h + PATHS ${EXTRAE_DIR} + PATH_SUFFIXES include + ) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EXTRAE + REQUIRED_VARS + EXTRAE_LIBRARY + EXTRAE_INCLUDE_DIR + ) + +if(EXTRAE_FOUND) + set(EXTRAE_LIBRARIES ${EXTRAE_LIBRARY}) + set(EXTRAE_INCLUDE_DIRS ${EXTRAE_INCLUDE_DIR}) +endif() + + + +if(NOT EXTRAE_FOUND) + message(FATAL_ERROR "Did not find required library EXTRAE") +else() + message(STATUS "Using EXTRAE in installation: ${EXTRAE_DIR}") +endif() + +mark_as_advanced(EXTRAE_DIR) diff --git a/cmake/FindExtrae.cmake b/cmake/FindExtrae.cmake deleted file mode 100644 index 8213ea9e3d9163b2acf7e87d166246df197ffd9d..0000000000000000000000000000000000000000 --- a/cmake/FindExtrae.cmake +++ /dev/null @@ -1,87 +0,0 @@ -#[=======================================================================[.rst: -FindExtrae -------- - -Finds the Extrae library. - -Imported Targets -^^^^^^^^^^^^^^^^ - -This module provides the following imported targets, if found: - The Extrae library - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables: - -``Extrae_FOUND`` - True if the system has the Extrae library. -``Extrae_DIR`` - The root directory of the Extrae library. -``Extrae_INCLUDE_DIRS`` - Include directories needed to use Extrae. -``Extrae_LIBRARIES`` - Libraries needed to link to Extrae. - -Cache Variables -^^^^^^^^^^^^^^^ - -The following cache variables may also be set: - -``Extrae_DIR`` - The Extrae installation directory (prefix). -#]=======================================================================] - - -if(NOT Extrae_DIR) - if(DEFINED ENV{Extrae_HOME}) - message(STATUS "Find Extrae: No Extrae_DIR provided: Falling back on $ENV{Extrae_HOME}") - set(Extrae_DIR $ENV{Extrae_HOME} ) - else() - message(STATUS "Find Extrae: Trying to find Extrae in the normal system paths as $Extrae_HOME is not specified") - endif() -endif() - - - -if(DEFINED Extrae_LIB) - find_library(Extrae_LIBRARY - NAMES ${Extrae_LIB} - HINTS ${Extrae_DIR} - PATH_SUFFIXES lib lib64) -else() - find_library(Extrae_LIBRARY - NAMES seqtrace - HINTS ${Extrae_DIR} - PATH_SUFFIXES lib lib64) -endif() - - -find_path(Extrae_INCLUDE_DIR - NAMES extrae.h - PATHS ${Extrae_DIR} - PATH_SUFFIXES include - ) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Extrae - REQUIRED_VARS - Extrae_LIBRARY - Extrae_INCLUDE_DIR - ) - -if(Extrae_FOUND) - set(Extrae_LIBRARIES ${Extrae_LIBRARY}) - set(Extrae_INCLUDE_DIRS ${Extrae_INCLUDE_DIR}) -endif() - - - -if(NOT Extrae_FOUND) - message(FATAL_ERROR "Did not find required library Extrae") -else() - message(STATUS "Using Extrae in installation: ${Extrae_DIR}") -endif() - -mark_as_advanced(Extrae_DIR)