mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
CMakeLists: Define an OProfile target and use it
Allows us to bring includes and relevant libraries into scope by explicitly declaring linkage against the target as opposed to using a variable. Also removes the dumping of OProfile includes into the top-level directory.
This commit is contained in:
@ -7,13 +7,25 @@
|
||||
find_path(OPROFILE_INCLUDE_DIR opagent.h)
|
||||
|
||||
find_library(OPROFILE_LIBRARY opagent
|
||||
PATH_SUFFIXES oprofile)
|
||||
PATH_SUFFIXES oprofile
|
||||
)
|
||||
|
||||
set(OPROFILE_INCLUDE_DIRS ${OPROFILE_INCLUDE_DIR})
|
||||
set(OPROFILE_LIBRARIES ${OPROFILE_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OProfile DEFAULT_MSG
|
||||
OPROFILE_LIBRARY OPROFILE_INCLUDE_DIR)
|
||||
OPROFILE_LIBRARY OPROFILE_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if (OPROFILE_FOUND)
|
||||
if (NOT TARGET OProfile::OProfile)
|
||||
add_library(OProfile::OProfile UNKNOWN IMPORTED)
|
||||
set_target_properties(OProfile::OProfile PROPERTIES
|
||||
IMPORTED_LOCATION ${OPROFILE_LIBRARIES}
|
||||
INTERFACE_INCLUDE_DIRECTORIES ${OPROFILE_INCLUDE_DIRS}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
mark_as_advanced(OPROFILE_INCLUDE_DIR OPROFILE_LIBRARY)
|
||||
|
Reference in New Issue
Block a user