mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 02:10:34 +00:00
Glog is now downloaded, configured, built and linked automatically if it is not found in the host system.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@304 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
a3f6928601
commit
74668e14dd
@ -51,7 +51,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2")
|
||||
########################################################################
|
||||
# Environment setup
|
||||
########################################################################
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
################################################################################
|
||||
# Googletest - http://code.google.com/p/googletest/
|
||||
@ -101,12 +101,36 @@ find_package(Boost COMPONENTS date_time filesystem system thread REQUIRED)
|
||||
# glog - http://code.google.com/p/google-glog/
|
||||
################################################################################
|
||||
|
||||
find_package(GLOG REQUIRED)
|
||||
find_package(GLOG)
|
||||
if ( NOT GLOG_FOUND )
|
||||
message(FATAL_ERROR "google-glog library not found! Please check http://code.google.com/p/google-glog/")
|
||||
else( NOT GLOG_FOUND )
|
||||
message ( "google-glog library found." )
|
||||
endif( NOT GLOG_FOUND )
|
||||
message (" glog library has not been found.")
|
||||
message (" glog will be downloaded and built automatically ")
|
||||
message (" when doing 'make'. ")
|
||||
set(glog_RELEASE 0.3.2)
|
||||
set(glog_MD5 "897fbff90d91ea2b6d6e78c8cea641cc")
|
||||
ExternalProject_Add(
|
||||
glog-${glog_RELEASE}
|
||||
URL http://google-glog.googlecode.com/files/glog-${glog_RELEASE}.tar.gz
|
||||
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/glog-${glog_RELEASE}
|
||||
URL_MD5 ${glog_MD5}
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR>
|
||||
BUILD_COMMAND make
|
||||
UPDATE_COMMAND ""
|
||||
PATCH_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
# Set up variables
|
||||
set(GLOG_INCLUDE_DIRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/src/
|
||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/src
|
||||
)
|
||||
set(GLOG_LIBRARIES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.so
|
||||
)
|
||||
set(glog ${GLOG_LIBRARIES})
|
||||
endif( NOT GLOG_FOUND)
|
||||
include_directories(${GLOG_INCLUDE_DIRS})
|
||||
|
||||
################################################################################
|
||||
|
@ -17,8 +17,6 @@
|
||||
#
|
||||
|
||||
|
||||
# message(" We see ${Boost_LIBRARIES}")
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
@ -32,7 +30,7 @@ include_directories(
|
||||
|
||||
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
|
||||
target_link_libraries(gnss-sdr ${Boost_LIBRARIES} glog gflags gnss_sp_libs gnss_rx)
|
||||
target_link_libraries(gnss-sdr ${Boost_LIBRARIES} ${GLOG_LIBRARIES} gflags gnss_sp_libs gnss_rx)
|
||||
|
||||
install(TARGETS gnss-sdr
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/install
|
||||
|
@ -21,7 +21,6 @@ set(GTEST_DIR_LOCAL $ENV{GTEST_DIR})
|
||||
|
||||
if(NOT GTEST_DIR_LOCAL)
|
||||
# if GTEST_DIR is not defined, we download and build it
|
||||
include(ExternalProject)
|
||||
set(gtest_RELEASE 1.6.0)
|
||||
ExternalProject_Add(
|
||||
gtest-${gtest_RELEASE}
|
||||
@ -82,7 +81,7 @@ include_directories(
|
||||
)
|
||||
|
||||
add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc)
|
||||
target_link_libraries(run_tests ${Boost_LIBRARIES} glog gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
target_link_libraries(run_tests ${Boost_LIBRARIES} ${GLOG_LIBRARIES} gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install)
|
||||
|
||||
#########################################################
|
||||
@ -90,14 +89,14 @@ install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install)
|
||||
#########################################################
|
||||
|
||||
|
||||
set(CMAKE_CTEST_COMMAND ctest -V)
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
|
||||
#set(CMAKE_CTEST_COMMAND ctest -V)
|
||||
#add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
|
||||
|
||||
add_executable(control_thread_test EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/control_thread/control_message_factory_test.cc
|
||||
)
|
||||
target_link_libraries(control_thread_test ${Boost_LIBRARIES} glog gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
target_link_libraries(control_thread_test ${Boost_LIBRARIES} ${GLOG_LIBRARIES} gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
add_test(control_thread_test control_thread_test)
|
||||
|
||||
add_executable(gnss_block_test EXCLUDE_FROM_ALL
|
||||
@ -111,7 +110,7 @@ add_executable(gnss_block_test EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/file_output_filter_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gnss_block_factory_test.cc
|
||||
)
|
||||
target_link_libraries(gnss_block_test ${Boost_LIBRARIES} gflags glog ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
target_link_libraries(gnss_block_test ${Boost_LIBRARIES} ${GLOG_LIBRARIES} gflags ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
add_test(gnss_block_test gnss_block_test)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user