Skip to content

Instantly share code, notes, and snippets.

@adobkin
Created July 9, 2011 05:28
Show Gist options
  • Save adobkin/1073354 to your computer and use it in GitHub Desktop.
Save adobkin/1073354 to your computer and use it in GitHub Desktop.
Module for CMake to search the CUnit headers and libraries
# Find the CUnit headers and libraries
#
# CUNIT_INCLUDE_DIRS - The CUnit include directory (directory where CUnit/CUnit.h was found)
# CUNIT_LIBRARIES - The libraries needed to use CUnit
# CUNIT_FOUND - True if CUnit found in system
FIND_PATH(CUNIT_INCLUDE_DIR NAMES CUnit/CUnit.h)
MARK_AS_ADVANCED(CUNIT_INCLUDE_DIR)
FIND_LIBRARY(CUNIT_LIBRARY NAMES
cunit
libcunit
cunitlib
)
MARK_AS_ADVANCED(CUNIT_LIBRARY)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CUnit DEFAULT_MSG CUNIT_LIBRARY CUNIT_INCLUDE_DIR)
IF(CUNIT_FOUND)
SET(CUNIT_LIBRARIES ${CUNIT_LIBRARY})
SET(CUNIT_INCLUDE_DIRS ${CUNIT_INCLUDE_DIR})
ENDIF(CUNIT_FOUND)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment