cmake: improve build paths for nested builds

If Hyperscan is built as a subproject of another cmake project, it helps to
refer to PROJECT_xx_DIR instead of CMAKE_xx_DIR, etc.
This commit is contained in:
Matthew Barr
2015-11-05 14:49:04 +11:00
parent b9d3b73ab8
commit f65170da5b
3 changed files with 25 additions and 14 deletions

View File

@@ -7,7 +7,8 @@ if(NOT XCODE)
else()
set(CMAKE_CXX_FLAGS "-isystem ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CXX_FLAGS}")
endif()
include_directories(${CMAKE_SOURCE_DIR}/util)
include_directories(${PROJECT_SOURCE_DIR})
# remove some warnings
# cmake's scope means these only apply here
@@ -26,7 +27,7 @@ endif()
add_library(gtest ${gtest_SOURCES})
add_definitions(-DGTEST_HAS_PTHREAD=0 -DSRCDIR=${CMAKE_SOURCE_DIR})
add_definitions(-DGTEST_HAS_PTHREAD=0 -DSRCDIR=${PROJECT_SOURCE_DIR})
if (NOT RELEASE_BUILD)
set(unit_internal_SOURCES