2015-01-08 18:49:59 +00:00
|
|
|
# Copyright (C) 2012-2015 (see AUTHORS file for a list of contributors)
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
|
|
|
# GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
# (at your option) any later version.
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
|
|
|
# GNSS-SDR is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
set(GNSS_SDR_OPTIONAL_LIBS "")
|
|
|
|
set(GNSS_SDR_OPTIONAL_HEADERS "")
|
|
|
|
|
|
|
|
if(ENABLE_GPERFTOOLS)
|
|
|
|
if(GPERFTOOLS_FOUND)
|
2014-08-10 18:00:10 +00:00
|
|
|
#set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_LIBRARIES}")
|
|
|
|
set(GNSS_SDR_OPTIONAL_LIBS "${GNSS_SDR_OPTIONAL_LIBS};${GPERFTOOLS_PROFILER};${GPERFTOOLS_TCMALLOC}")
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
set(GNSS_SDR_OPTIONAL_HEADERS "${GNSS_SDR_OPTIONAL_HEADERS};${GPERFTOOLS_INCLUDE_DIR}")
|
|
|
|
endif(GPERFTOOLS_FOUND)
|
|
|
|
endif(ENABLE_GPERFTOOLS)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2014-11-14 20:42:22 +00:00
|
|
|
if(ENABLE_UHD)
|
|
|
|
set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES})
|
|
|
|
set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS})
|
|
|
|
endif(ENABLE_UHD)
|
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
include_directories(
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/receiver
|
2013-03-15 18:05:37 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/core/libs
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/libs/supl
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
|
2013-12-14 10:23:33 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
|
2012-12-24 02:33:50 +00:00
|
|
|
${GLOG_INCLUDE_DIRS}
|
|
|
|
${GFlags_INCLUDE_DIRS}
|
2013-01-03 01:48:34 +00:00
|
|
|
${ARMADILLO_INCLUDE_DIRS}
|
2013-07-04 13:47:40 +00:00
|
|
|
${Boost_INCLUDE_DIRS}
|
2013-12-14 10:23:33 +00:00
|
|
|
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
${GNSS_SDR_OPTIONAL_HEADERS}
|
2014-11-07 17:23:59 +00:00
|
|
|
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
2012-12-24 02:33:50 +00:00
|
|
|
)
|
|
|
|
|
2013-01-24 20:04:39 +00:00
|
|
|
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
|
|
|
|
|
2013-07-04 13:47:40 +00:00
|
|
|
if(OS_IS_MACOSX)
|
2014-10-18 10:39:58 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2014-11-09 14:31:35 +00:00
|
|
|
set(MAC_LIBRARIES "-stdlib=libc++ -std=c++11 -framework Accelerate -lc++")
|
2014-10-18 10:39:58 +00:00
|
|
|
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2013-07-04 13:47:40 +00:00
|
|
|
endif(OS_IS_MACOSX)
|
|
|
|
|
2014-11-04 20:28:01 +00:00
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
2013-11-13 21:07:33 +00:00
|
|
|
|
2014-11-04 20:28:01 +00:00
|
|
|
add_custom_command(TARGET gnss-sdr POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gnss-sdr>
|
2014-11-07 17:23:59 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:gnss-sdr>
|
|
|
|
)
|
2014-11-04 20:28:01 +00:00
|
|
|
|
2013-11-13 21:07:33 +00:00
|
|
|
target_link_libraries(gnss-sdr ${MAC_LIBRARIES}
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${GNURADIO_RUNTIME_LIBRARIES}
|
|
|
|
${GNURADIO_BLOCKS_LIBRARIES}
|
|
|
|
${GNURADIO_FFT_LIBRARIES}
|
|
|
|
${GNURADIO_FILTER_LIBRARIES}
|
|
|
|
${GFlags_LIBS}
|
|
|
|
${GLOG_LIBRARIES}
|
|
|
|
${ARMADILLO_LIBRARIES}
|
2014-11-07 17:23:59 +00:00
|
|
|
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
${GNSS_SDR_OPTIONAL_LIBS}
|
2014-11-14 20:42:22 +00:00
|
|
|
gnss_sp_libs
|
|
|
|
gnss_rx
|
2013-11-13 21:07:33 +00:00
|
|
|
)
|
2013-07-04 13:47:40 +00:00
|
|
|
|
2013-01-03 01:48:34 +00:00
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
install(TARGETS gnss-sdr
|
2014-11-04 20:28:01 +00:00
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
COMPONENT "gnss-sdr"
|
2012-12-24 02:33:50 +00:00
|
|
|
)
|
|
|
|
|
2014-11-12 22:05:53 +00:00
|
|
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr
|
2014-11-04 20:28:01 +00:00
|
|
|
FILES_MATCHING PATTERN "*.conf"
|
|
|
|
)
|
2014-11-07 17:23:59 +00:00
|
|
|
|
2014-11-12 22:05:53 +00:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf
|
2014-11-05 22:26:31 +00:00
|
|
|
RENAME default.conf)
|
|
|
|
|
2014-11-07 20:44:16 +00:00
|
|
|
if(NOT VOLK_GNSSSDR_FOUND)
|
|
|
|
install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile DESTINATION bin)
|
2014-11-14 20:03:45 +00:00
|
|
|
endif(NOT VOLK_GNSSSDR_FOUND)
|
|
|
|
|
|
|
|
|
|
|
|
find_program(GZIP
|
|
|
|
gzip
|
|
|
|
/bin
|
|
|
|
/usr/bin
|
|
|
|
/usr/local/bin
|
|
|
|
/opt/local/bin
|
|
|
|
/sbin
|
|
|
|
)
|
|
|
|
if(NOT GZIP_NOTFOUND)
|
2014-11-14 20:42:22 +00:00
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage
|
2014-11-14 20:03:45 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz")
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz DESTINATION share/man/man1)
|
|
|
|
if(NOT VOLK_GNSSSDR_FOUND)
|
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz")
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1)
|
|
|
|
endif(NOT VOLK_GNSSSDR_FOUND)
|
|
|
|
endif(NOT GZIP_NOTFOUND)
|