2016-01-28 15:56:10 +00:00
|
|
|
# Locate CppUnit.
|
|
|
|
#
|
|
|
|
# This module defines
|
|
|
|
# CPPUNIT_FOUND
|
|
|
|
# CPPUNIT_LIBRARIES
|
|
|
|
# CPPUNIT_INCLUDE_DIR
|
2023-01-08 19:35:29 +00:00
|
|
|
#
|
|
|
|
# And defines the imported target CppUnitLib
|
2016-01-28 15:56:10 +00:00
|
|
|
|
|
|
|
# Find CppUnit.
|
|
|
|
if (NOT CPPUNIT_LIBRARIES AND NOT CPPUNIT_INCLUDE_DIR)
|
|
|
|
# Find the headers.
|
|
|
|
find_path(CPPUNIT_INCLUDE_DIR
|
|
|
|
NAMES
|
|
|
|
cppunit/Test.h
|
|
|
|
PATHS
|
|
|
|
/usr/include
|
|
|
|
/usr/local/include
|
|
|
|
/opt/include
|
|
|
|
/opt/local/include
|
|
|
|
/sw/include
|
|
|
|
)
|
|
|
|
|
|
|
|
# Find the library.
|
|
|
|
find_library(CPPUNIT_LIBRARIES
|
|
|
|
NAMES
|
|
|
|
cppunit
|
|
|
|
PATHS
|
|
|
|
/usr/lib
|
|
|
|
/usr/local/lib
|
|
|
|
/opt/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/sw/lib
|
|
|
|
)
|
|
|
|
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
# Pre-set or found.
|
|
|
|
if (CPPUNIT_LIBRARIES AND CPPUNIT_INCLUDE_DIR)
|
|
|
|
set(CPPUNIT_FOUND TRUE)
|
|
|
|
message(STATUS "CppUnit library found: ${CPPUNIT_LIBRARIES}")
|
|
|
|
message(STATUS "CppUnit include directory found: ${CPPUNIT_INCLUDE_DIR}")
|
2023-01-08 19:35:29 +00:00
|
|
|
|
|
|
|
if(NOT TARGET CppUnitLib)
|
|
|
|
add_library(CppUnitLib UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(CppUnitLib PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${CPPUNIT_INCLUDE_DIR}"
|
|
|
|
IMPORTED_LOCATION "${CPPUNIT_LIBRARIES}")
|
|
|
|
endif()
|
2016-01-28 15:56:10 +00:00
|
|
|
endif ()
|
2023-01-08 19:35:29 +00:00
|
|
|
|