Skip to content

Commit

Permalink
Merge pull request #334 from Phyks/master
Browse files Browse the repository at this point in the history
Fix CMakeLists for include as a thirdparty in projects
  • Loading branch information
miloyip committed May 12, 2015
2 parents 7eb117a + 89ad34c commit 7562d02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules)
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)

PROJECT(RapidJSON CXX)

Expand All @@ -17,7 +17,7 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON)
option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON)
option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON)
option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
"Use gtest installation in `thirdparty/gtest` by default if available" OFF)

option(RAPIDJSON_HAS_STDSTRING "" OFF)
Expand Down Expand Up @@ -45,7 +45,7 @@ ELSEIF(WIN32)
ENDIF()
SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake fiels are installed in")

include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

if(RAPIDJSON_BUILD_DOC)
add_subdirectory(doc)
Expand Down
5 changes: 3 additions & 2 deletions CMakeModules/FindGTestSrc.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

SET(GTEST_SEARCH_PATH
SET(GTEST_SEARCH_PATH
"${GTEST_SOURCE_DIR}"
"${CMAKE_SOURCE_DIR}/thirdparty/gtest")
"${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest")

IF(UNIX)
IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST)
Expand All @@ -15,6 +15,7 @@ FIND_PATH(GTEST_SOURCE_DIR
NAMES CMakeLists.txt src/gtest_main.cc
PATHS ${GTEST_SEARCH_PATH})


# Debian installs gtest include directory in /usr/include, thus need to look
# for include directory separately from source directory.
FIND_PATH(GTEST_INCLUDE_DIR
Expand Down

0 comments on commit 7562d02

Please sign in to comment.