2014-09-07 23:56:09 +00:00
|
|
|
#
|
2015-01-08 18:49:59 +00:00
|
|
|
# Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
2014-09-07 23:56:09 +00:00
|
|
|
#
|
2014-11-07 17:02:52 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
|
|
|
# GNSS-SDR is free software: you can redistribute it and/or modify
|
2014-09-07 23:56:09 +00:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
2014-11-07 17:02:52 +00:00
|
|
|
# GNSS-SDR is distributed in the hope that it will be useful,
|
2014-09-07 23:56:09 +00:00
|
|
|
# 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
|
2014-11-07 17:02:52 +00:00
|
|
|
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
2014-09-07 23:56:09 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
########################################################################
|
|
|
|
# Setup profiler
|
|
|
|
########################################################################
|
|
|
|
if(MSVC)
|
2016-02-25 14:26:32 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
|
2014-09-07 23:56:09 +00:00
|
|
|
endif(MSVC)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2016-02-25 14:26:32 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/include
|
|
|
|
${PROJECT_BINARY_DIR}/include
|
|
|
|
${PROJECT_SOURCE_DIR}/lib
|
|
|
|
${PROJECT_BINARY_DIR}/lib
|
2014-09-07 23:56:09 +00:00
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
|
2017-08-07 09:08:05 +00:00
|
|
|
|
|
|
|
set(Clang_required_link "")
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
set(Clang_required_link "c++")
|
|
|
|
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
|
2014-11-09 14:31:35 +00:00
|
|
|
|
2016-01-13 09:22:06 +00:00
|
|
|
if(ORC_FOUND)
|
|
|
|
set(orc_lib ${ORC_LIBRARIES})
|
|
|
|
elseif(ORC_FOUND)
|
|
|
|
set(orc_lib "")
|
|
|
|
endif(ORC_FOUND)
|
|
|
|
|
2016-01-12 19:15:16 +00:00
|
|
|
|
2017-11-04 09:59:03 +00:00
|
|
|
# allow 'large' files in 32 bit builds
|
|
|
|
if(UNIX)
|
|
|
|
add_definitions( -D_LARGEFILE_SOURCE
|
|
|
|
-D_FILE_OFFSET_BITS=64
|
|
|
|
-D_LARGE_FILES
|
|
|
|
)
|
|
|
|
endif(UNIX)
|
|
|
|
|
|
|
|
|
2014-09-07 23:56:09 +00:00
|
|
|
# MAKE volk_gnsssdr_profile
|
|
|
|
add_executable(volk_gnsssdr_profile
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_profile.cc
|
2016-02-25 14:26:32 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/lib/qa_utils.cc
|
2014-09-07 23:56:09 +00:00
|
|
|
)
|
|
|
|
|
2016-01-13 10:04:32 +00:00
|
|
|
if(ENABLE_STATIC_LIBS)
|
|
|
|
target_link_libraries(volk_gnsssdr_profile volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
|
|
|
|
else(ENABLE_STATIC_LIBS)
|
|
|
|
target_link_libraries(volk_gnsssdr_profile volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
|
|
|
|
add_dependencies(volk_gnsssdr_profile volk_gnsssdr)
|
|
|
|
endif(ENABLE_STATIC_LIBS)
|
2016-01-13 09:22:06 +00:00
|
|
|
|
2014-09-07 23:56:09 +00:00
|
|
|
|
2014-11-14 00:40:43 +00:00
|
|
|
if(ENABLE_STRIP)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
|
|
|
set_target_properties(volk_gnsssdr_profile
|
|
|
|
PROPERTIES LINK_FLAGS "-s")
|
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
|
|
|
endif(ENABLE_STRIP)
|
|
|
|
|
2016-01-12 19:15:16 +00:00
|
|
|
|
2014-09-07 23:56:09 +00:00
|
|
|
install(
|
|
|
|
TARGETS volk_gnsssdr_profile
|
|
|
|
DESTINATION bin
|
|
|
|
COMPONENT "volk_gnsssdr"
|
|
|
|
)
|
|
|
|
|
2016-07-02 11:34:00 +00:00
|
|
|
# Launch volk_gnsssdr_profile if requested to do so
|
|
|
|
if(ENABLE_PROFILING)
|
|
|
|
if(DEFINED VOLK_CONFIGPATH)
|
|
|
|
set( VOLK_CONFIG_ARG "-p${VOLK_CONFIGPATH}" )
|
|
|
|
set( VOLK_CONFIG "${VOLK_CONFIGPATH}/volk_gnsssdr_config" )
|
|
|
|
endif()
|
|
|
|
add_custom_command(OUTPUT ${VOLK_CONFIG}
|
|
|
|
COMMAND volk_gnsssdr_profile "${VOLK_CONFIG_ARG}"
|
|
|
|
DEPENDS volk_gnsssdr_profile
|
|
|
|
COMMENT "Launching profiler, this may take a few minutes..."
|
|
|
|
)
|
|
|
|
add_custom_target(volk-gnsssdr-profile-run ALL DEPENDS ${VOLK_CONFIG})
|
|
|
|
endif()
|
|
|
|
|
2014-09-07 23:56:09 +00:00
|
|
|
# MAKE volk_gnsssdr-config-info
|
|
|
|
add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc)
|
2016-12-26 13:05:25 +00:00
|
|
|
if(ENABLE_STATIC_LIBS)
|
|
|
|
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
|
|
|
|
else(ENABLE_STATIC_LIBS)
|
|
|
|
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
|
|
|
|
add_dependencies(volk_gnsssdr-config-info volk_gnsssdr)
|
|
|
|
endif(ENABLE_STATIC_LIBS)
|
2016-07-02 16:54:39 +00:00
|
|
|
|
2016-12-26 12:31:12 +00:00
|
|
|
if(ENABLE_STRIP)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
|
|
|
set_target_properties(volk_gnsssdr-config-info
|
|
|
|
PROPERTIES LINK_FLAGS "-s")
|
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
|
|
|
endif(ENABLE_STRIP)
|
|
|
|
|
2016-07-06 18:25:39 +00:00
|
|
|
install(
|
|
|
|
TARGETS volk_gnsssdr-config-info
|
|
|
|
DESTINATION bin
|
|
|
|
COMPONENT "volk_gnsssdr"
|
|
|
|
)
|
2014-09-07 23:56:09 +00:00
|
|
|
|