CMAKE_SOURCE_DIR -> CMAKE_CURRENT_SOURCE_DIR

This tells CMake to refer to the currently executed `CMakeLists.txt`'s directory instead of the root project directory. This allows protobuf-c to be included as a subdirectory (via `include_subdirectory`) while being innocuous for those that build protobuf-c by itself.
This commit is contained in:
Josh 2016-12-04 18:48:47 -08:00 committed by GitHub
parent 006d69bd84
commit cfbe34f6f4

View File

@ -21,7 +21,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244")
ENDIF()
get_filename_component(MAIN_DIR ${CMAKE_SOURCE_DIR} PATH)
get_filename_component(MAIN_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
SET(TEST_DIR ${MAIN_DIR}/t)
MESSAGE(${MAIN_DIR})