6293e13142
CMake Warning (dev) at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message): The package name passed to `find_package_handle_standard_args` (CJSON) does not match the name of the calling package (cJSON). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): cmake/FindcJSON.cmake:23 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:125 (FIND_PACKAGE) This warning is for project developers. Use -Wno-dev to suppress it. Signed-off-by: Pierre Hallot <hallotpierre@gmail.com>
41 lines
767 B
CMake
41 lines
767 B
CMake
INCLUDE( FindPackageHandleStandardArgs )
|
|
|
|
# Checks an environment variable; note that the first check
|
|
# does not require the usual CMake $-sign.
|
|
IF( DEFINED ENV{CJSON_DIR} )
|
|
SET( CJSON_DIR "$ENV{CJSON_DIR}" )
|
|
ENDIF()
|
|
|
|
FIND_PATH(
|
|
CJSON_INCLUDE_DIR
|
|
cJSON.h
|
|
HINTS
|
|
CJSON_DIR
|
|
/usr/include/cjson
|
|
/usr/local/include/cjson
|
|
)
|
|
|
|
FIND_LIBRARY( CJSON_LIBRARY
|
|
NAMES cjson
|
|
HINTS ${CJSON_DIR}
|
|
)
|
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS( cJSON DEFAULT_MSG
|
|
CJSON_INCLUDE_DIR CJSON_LIBRARY
|
|
)
|
|
|
|
IF( CJSON_FOUND )
|
|
SET( CJSON_INCLUDE_DIRS ${CJSON_INCLUDE_DIR} )
|
|
SET( CJSON_LIBRARIES ${CJSON_LIBRARY} )
|
|
|
|
MARK_AS_ADVANCED(
|
|
CJSON_LIBRARY
|
|
CJSON_INCLUDE_DIR
|
|
CJSON_DIR
|
|
)
|
|
ELSE()
|
|
SET( CJSON_DIR "" CACHE STRING
|
|
"An optional hint to a directory for finding `cJSON`"
|
|
)
|
|
ENDIF()
|