mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 18:30:34 +00:00
Fixing Gtest detection
This commit is contained in:
parent
98d2fd31a0
commit
3e5332ff57
@ -276,14 +276,16 @@ if(EXISTS $ENV{GTEST_DIR})
|
|||||||
endif(EXISTS $ENV{GTEST_DIR})
|
endif(EXISTS $ENV{GTEST_DIR})
|
||||||
if(GTEST_DIR)
|
if(GTEST_DIR)
|
||||||
message(STATUS "Googletest root folder set at ${GTEST_DIR}")
|
message(STATUS "Googletest root folder set at ${GTEST_DIR}")
|
||||||
find_path(LIBGTEST_DEV_DIR NAMES gtest-all.cc PATHS ${GTEST_DIR}/src)
|
find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${GTEST_DIR})
|
||||||
if(LIBGTEST_DEV_DIR)
|
if(LIBGTEST_DEV_DIR)
|
||||||
message (STATUS "Googletest has been found.")
|
message (STATUS "Googletest has been found.")
|
||||||
else(LIBGTEST_DEV_DIR)
|
else(LIBGTEST_DEV_DIR)
|
||||||
message (FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.")
|
message (FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}.")
|
||||||
endif(LIBGTEST_DEV_DIR)
|
endif(LIBGTEST_DEV_DIR)
|
||||||
|
find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${GTEST_DIR}/include)
|
||||||
else(GTEST_DIR)
|
else(GTEST_DIR)
|
||||||
find_path(LIBGTEST_DEV_DIR NAMES gtest-all.cc PATHS /usr/src/gtest/src /opt/local/src/gtest/src)
|
find_path(LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/gtest /opt/local/src/gtest)
|
||||||
|
find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/include)
|
||||||
if(LIBGTEST_DEV_DIR)
|
if(LIBGTEST_DEV_DIR)
|
||||||
message (STATUS "Googletest (libgtest-dev package) has been found.")
|
message (STATUS "Googletest (libgtest-dev package) has been found.")
|
||||||
else(LIBGTEST_DEV_DIR)
|
else(LIBGTEST_DEV_DIR)
|
||||||
|
@ -28,8 +28,7 @@ if(NOT GTEST_DIR_LOCAL)
|
|||||||
else()
|
else()
|
||||||
set(GTEST_DIR_LOCAL true)
|
set(GTEST_DIR_LOCAL true)
|
||||||
endif(NOT GTEST_DIR_LOCAL)
|
endif(NOT GTEST_DIR_LOCAL)
|
||||||
find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h
|
|
||||||
PATHS /usr/include)
|
|
||||||
if(GTEST_INCLUDE_DIRS)
|
if(GTEST_INCLUDE_DIRS)
|
||||||
set(GTEST_DIR_LOCAL true)
|
set(GTEST_DIR_LOCAL true)
|
||||||
endif(GTEST_INCLUDE_DIRS)
|
endif(GTEST_INCLUDE_DIRS)
|
||||||
@ -86,10 +85,12 @@ if(NOT ${GTEST_DIR_LOCAL})
|
|||||||
set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}")
|
set(GTEST_LIB_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../gtest-${gtest_RELEASE}")
|
||||||
else(NOT ${GTEST_DIR_LOCAL})
|
else(NOT ${GTEST_DIR_LOCAL})
|
||||||
if(GTEST_INCLUDE_DIRS)
|
if(GTEST_INCLUDE_DIRS)
|
||||||
find_path(GTEST_SOURCE_DIR NAMES gtest-all.cc PATHS /usr/src/gtest/src)
|
#find_path(GTEST_SOURCE_DIR NAMES gtest-all.cc PATHS /usr/src/gtest/src)
|
||||||
find_path(GTEST_SOURCE_INCLUDE NAMES src/gtest-all.cc PATHS /usr/src/gtest)
|
#find_path(GTEST_SOURCE_INCLUDE NAMES src/gtest-all.cc PATHS /usr/src/gtest)
|
||||||
set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${GTEST_SOURCE_INCLUDE} ${GTEST_SOURCE_DIR})
|
#set(GTEST_SOURCE_INCLUDE ${GTEST_INCLUDE_DIRS})
|
||||||
add_library(gtest ${GTEST_SOURCE_DIR}/gtest-all.cc ${GTEST_SOURCE_DIR}/gtest_main.cc)
|
set(GTEST_INCLUDE_DIRECTORIES ${GTEST_INCLUDE_DIRS} ${LIBGTEST_DEV_DIR})
|
||||||
|
message("++++ ${LIBGTEST_DEV_DIR}")
|
||||||
|
add_library(gtest ${LIBGTEST_DEV_DIR}/src/gtest-all.cc ${LIBGTEST_DEV_DIR}/src/gtest_main.cc)
|
||||||
set(GTEST_LIBRARIES gtest)
|
set(GTEST_LIBRARIES gtest)
|
||||||
else(GTEST_INCLUDE_DIRS)
|
else(GTEST_INCLUDE_DIRS)
|
||||||
# If the variable GTEST_DIR is defined, we use the existing Googletest
|
# If the variable GTEST_DIR is defined, we use the existing Googletest
|
||||||
@ -153,6 +154,7 @@ include_directories(
|
|||||||
${VOLK_INCLUDE_DIRS}
|
${VOLK_INCLUDE_DIRS}
|
||||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||||
${GNSS_SDR_TEST_OPTIONAL_HEADERS}
|
${GNSS_SDR_TEST_OPTIONAL_HEADERS}
|
||||||
|
${GNSS_SDR_TEST_OPTIONAL_HEADERS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user