In CMake most third party libraries don't require me to specify their include directory at all...they seem to take care of that for me behind the scenes. However, some third party libraries seem to put that work on my plate.
Are the differences I'm finding across third party libraries indicative of me doing something wrong? Or is CMake just a less structured environment where some third party libraries are going to hold your hand more than others? What is going on here? Best practices?
I'll give a couple examples. OpenCV makes things super easy, no need for me to mention their include directory:
set(OpenCV_DIR ${THIRD_PARTY_DIR}/OpenCV)
find_package(OpenCV REQUIRED)
...
add_executable(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
However, Google's Protocol Buffer requires me to use the include_directories command in order to use their header files:
set(CMAKE_PREFIX_PATH ${THIRD_PARTY_PROTOBUF_DIR})
find_package(Protobuf ${THIRD_PARTY_DIR}/protobuf-2.6.1)
...
include_directories(${PROTOBUF_INCLUDE_DIRS})
add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${PROTOBUF_LIBRARIES})