Skip to content

Commit

Permalink
Don't search default path when JsonCpp_DIR is provided
Browse files Browse the repository at this point in the history
If a JsonCpp is present in a default path on the computer,
find_package(JsonCpp) was selecting this one instead of the path
pointed by JsonCpp_DIR.
  • Loading branch information
finetjul committed Jun 18, 2014
1 parent 46f3d89 commit 39c0f66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMake/FindJsonCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ if( JsonCpp_DIR )
${JsonCpp_DIR}/lib/MinSizeRel
${JsonCpp_DIR}/lib/RelWithDebInfo
${JsonCpp_DIR}/lib/Debug )
set( _jsoncpp_options NO_DEFAULT_PATH )
endif( JsonCpp_DIR )

find_path( JsonCpp_INCLUDE_DIR NAMES json/json.h
HINTS ${_jsoncpp_include_dir}
PATH_SUFFIXES jsoncpp )
PATH_SUFFIXES jsoncpp
${_jsoncpp_options} )

find_library( JsonCpp_LIBRARY NAMES jsoncpp libjsoncpp
HINTS ${_jsoncpp_library} )
HINTS ${_jsoncpp_library}
${_jsoncpp_options} )

set( JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR} )
set( JsonCpp_LIBRARIES ${JsonCpp_LIBRARY} )
Expand Down

0 comments on commit 39c0f66

Please sign in to comment.