mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-28 09:54:51 +00:00
Add style improvements to CMake scripts
This commit is contained in:
parent
8c48b80e8b
commit
ef45548e87
@ -44,20 +44,20 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# retrieve the compiler's version from it
|
||||
string(REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${_err})
|
||||
string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_OTHER_VERSION})
|
||||
else("${IS_APPLE}" STREQUAL "")
|
||||
else()
|
||||
set(MIN_VERSION ${GNSSSDR_APPLECLANG_MIN_VERSION})
|
||||
set(APPLE_STR "Apple ")
|
||||
# retrieve the compiler's version from it
|
||||
string(REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${_err})
|
||||
string(REGEX MATCH "[0-9.]+" CLANG_VERSION ${CLANG_APPLE_VERSION})
|
||||
endif("${IS_APPLE}" STREQUAL "")
|
||||
endif()
|
||||
if(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
|
||||
message(WARNING "\nThe compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
|
||||
endif(${CLANG_VERSION} VERSION_LESS "${MIN_VERSION}")
|
||||
else(${_res} STREQUAL "0")
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "\nCannot determine the version of the compiler selected to build VOLK-GNSSSDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent.")
|
||||
endif(${_res} STREQUAL "0")
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Enable C++17 support in GCC >= 8.0.0
|
||||
# Enable C++14 support in 8.0.0 > GCC >= 6.1.1
|
||||
@ -66,15 +66,15 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
||||
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
||||
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
||||
else()
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1")
|
||||
endif()
|
||||
endif()
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall -Wextra") #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
endif()
|
||||
|
||||
# Enable C++17 support in Clang >= 6.0.0
|
||||
# Enable C++14 support in 6.0.0 > Clang >= 3.5.0 or AppleClang >= 600
|
||||
@ -84,28 +84,28 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# See https://trac.macports.org/wiki/XcodeVersionInfo for Apple Clang version equivalences
|
||||
if(CLANG_VERSION VERSION_LESS "600")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
||||
else(CLANG_VERSION VERSION_LESS "600")
|
||||
else()
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
||||
endif(CLANG_VERSION VERSION_LESS "600")
|
||||
else(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11")
|
||||
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++14")
|
||||
else(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
|
||||
else()
|
||||
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++17")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
|
||||
endif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0")
|
||||
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
endif(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
|
||||
endif(NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS} -Wall")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
@ -113,9 +113,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||
if(CMAKE_VERSION VERSION_GREATER "3.0")
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
if(CMAKE_VERSION VERSION_GREATER "3.9")
|
||||
cmake_policy(SET CMP0068 NEW)
|
||||
endif(CMAKE_VERSION VERSION_GREATER "3.9")
|
||||
endif(CMAKE_VERSION VERSION_GREATER "3.0")
|
||||
cmake_policy(SET CMP0068 NEW)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF)
|
||||
|
||||
@ -129,7 +129,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
message(STATUS "Build type not specified: defaulting to release.")
|
||||
endif()
|
||||
VOLK_CHECK_BUILD_TYPE(${CMAKE_BUILD_TYPE})
|
||||
volk_check_build_type(${CMAKE_BUILD_TYPE})
|
||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
|
||||
message(STATUS "Build type set to ${CMAKE_BUILD_TYPE}.")
|
||||
|
||||
@ -144,14 +144,14 @@ include(VolkVersion) #setup version info
|
||||
########################################################################
|
||||
# Environment setup
|
||||
########################################################################
|
||||
IF(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT})
|
||||
SET(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
|
||||
ENDIF()
|
||||
if(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT})
|
||||
set(BOOST_ROOT ${CMAKE_INSTALL_PREFIX})
|
||||
endif()
|
||||
|
||||
IF(NOT DEFINED CROSSCOMPILE_MULTILIB)
|
||||
SET(CROSSCOMPILE_MULTILIB "")
|
||||
ENDIF()
|
||||
SET(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile")
|
||||
if(NOT DEFINED CROSSCOMPILE_MULTILIB)
|
||||
set(CROSSCOMPILE_MULTILIB "")
|
||||
endif()
|
||||
set(CROSSCOMPILE_MULTILIB ${CROSSCOMPILE_MULTILIB} CACHE STRING "Define \"true\" if you have and want to use multiple C development libs installed for cross compile")
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_USE_MATH_DEFINES) #enables math constants on all supported versions of MSVC
|
||||
@ -160,16 +160,16 @@ if(MSVC)
|
||||
add_compile_options(/wd4752)
|
||||
add_compile_options(/wo4273)
|
||||
add_compile_options(/wo4838)
|
||||
endif(MSVC)
|
||||
endif()
|
||||
|
||||
# allow 'large' files in 32 bit builds
|
||||
if(UNIX)
|
||||
add_definitions( -D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-D_LARGE_FILES
|
||||
-D_FORTIFY_SOURCE=2
|
||||
)
|
||||
endif(UNIX)
|
||||
add_definitions(-D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-D_LARGE_FILES
|
||||
-D_FORTIFY_SOURCE=2
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -178,9 +178,9 @@ endif(UNIX)
|
||||
|
||||
# Python
|
||||
include(VolkPython) #sets PYTHON_EXECUTABLE and PYTHON_DASH_B
|
||||
VOLK_PYTHON_CHECK_MODULE("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND)
|
||||
VOLK_PYTHON_CHECK_MODULE("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
|
||||
VOLK_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
|
||||
volk_python_check_module("python >= 2.7" sys "sys.version.split()[0] >= '2.7'" PYTHON_MIN_VER_FOUND)
|
||||
volk_python_check_module("mako >= 0.4.2" mako "mako.__version__ >= '0.4.2'" MAKO_FOUND)
|
||||
volk_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
|
||||
|
||||
|
||||
if(NOT PYTHON_MIN_VER_FOUND)
|
||||
@ -199,16 +199,16 @@ endif()
|
||||
|
||||
# Boost
|
||||
if(MSVC)
|
||||
if (NOT DEFINED BOOST_ALL_DYN_LINK)
|
||||
if(NOT DEFINED BOOST_ALL_DYN_LINK)
|
||||
set(BOOST_ALL_DYN_LINK TRUE)
|
||||
endif()
|
||||
set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
|
||||
if(BOOST_ALL_DYN_LINK)
|
||||
add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
|
||||
else(BOOST_ALL_DYN_LINK)
|
||||
else()
|
||||
unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link
|
||||
endif(BOOST_ALL_DYN_LINK)
|
||||
endif(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(VolkBoost)
|
||||
|
||||
@ -220,9 +220,9 @@ endif()
|
||||
option(ENABLE_ORC "Enable Orc" True)
|
||||
if(ENABLE_ORC)
|
||||
find_package(ORC)
|
||||
else(ENABLE_ORC)
|
||||
else()
|
||||
message(STATUS "Disabling use of ORC")
|
||||
endif(ENABLE_ORC)
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -240,7 +240,7 @@ if(DOXYGEN_FOUND)
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||
COMMENT "Generating documentation with Doxygen" VERBATIM
|
||||
)
|
||||
endif(DOXYGEN_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -255,7 +255,8 @@ set(includedir "\${prefix}/include")
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc
|
||||
@ONLY)
|
||||
@ONLY
|
||||
)
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr.pc
|
||||
@ -304,17 +305,17 @@ if(APPLE)
|
||||
set(CMAKE_INSTALL_NAME_DIR
|
||||
${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE
|
||||
PATH "Library Install Name Destination Directory" FORCE)
|
||||
endif(NOT CMAKE_INSTALL_NAME_DIR)
|
||||
endif()
|
||||
if(NOT CMAKE_INSTALL_RPATH)
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
${CMAKE_INSTALL_PREFIX}/${VOLK_LIBRARY_DIR} CACHE
|
||||
PATH "Library Install RPath" FORCE)
|
||||
endif(NOT CMAKE_INSTALL_RPATH)
|
||||
endif()
|
||||
if(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE
|
||||
BOOL "Do Build Using Library Install RPath" FORCE)
|
||||
endif(NOT CMAKE_BUILD_WITH_INSTALL_RPATH)
|
||||
endif(APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -358,7 +359,7 @@ configure_file(
|
||||
|
||||
if(NOT CMAKE_MODULES_DIR)
|
||||
set(CMAKE_MODULES_DIR lib${LIB_SUFFIX}/cmake)
|
||||
endif(NOT CMAKE_MODULES_DIR)
|
||||
endif()
|
||||
|
||||
install(
|
||||
FILES
|
||||
@ -371,7 +372,7 @@ install(
|
||||
########################################################################
|
||||
# Option to enable QA testing, on by default
|
||||
########################################################################
|
||||
OPTION(ENABLE_TESTING "Enable QA testing" ON)
|
||||
option(ENABLE_TESTING "Enable QA testing" ON)
|
||||
if(ENABLE_TESTING)
|
||||
message(STATUS "QA Testing is enabled.")
|
||||
else()
|
||||
@ -383,7 +384,7 @@ message(STATUS " Modify using: -DENABLE_TESTING=ON/OFF")
|
||||
########################################################################
|
||||
# Option to enable post-build profiling using volk_profile, off by default
|
||||
########################################################################
|
||||
OPTION(ENABLE_PROFILING "Launch system profiler after build" OFF)
|
||||
option(ENABLE_PROFILING "Launch system profiler after build" OFF)
|
||||
if(ENABLE_PROFILING)
|
||||
set(ENABLE_STATIC_LIBS ON)
|
||||
if(DEFINED VOLK_CONFIGPATH)
|
||||
|
@ -22,7 +22,7 @@
|
||||
########################################################################
|
||||
if(MSVC)
|
||||
include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
|
||||
endif(MSVC)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@ -37,26 +37,26 @@ include_directories(
|
||||
|
||||
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")
|
||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(Clang_required_link "c++")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(ORC_FOUND)
|
||||
set(orc_lib ${ORC_LIBRARIES})
|
||||
elseif(ORC_FOUND)
|
||||
else()
|
||||
set(orc_lib "")
|
||||
endif(ORC_FOUND)
|
||||
endif()
|
||||
|
||||
|
||||
# allow 'large' files in 32 bit builds
|
||||
if(UNIX)
|
||||
add_definitions( -D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-D_LARGE_FILES
|
||||
)
|
||||
endif(UNIX)
|
||||
add_definitions(-D_LARGEFILE_SOURCE
|
||||
-D_FILE_OFFSET_BITS=64
|
||||
-D_LARGE_FILES
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# MAKE volk_gnsssdr_profile
|
||||
@ -68,18 +68,18 @@ add_executable(volk_gnsssdr_profile
|
||||
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
target_link_libraries(volk_gnsssdr_profile volk_gnsssdr_static ${Boost_LIBRARIES} ${Clang_required_link} ${orc_lib})
|
||||
else(ENABLE_STATIC_LIBS)
|
||||
else()
|
||||
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)
|
||||
endif()
|
||||
|
||||
|
||||
if(ENABLE_STRIP)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
set_target_properties(volk_gnsssdr_profile
|
||||
PROPERTIES LINK_FLAGS "-s")
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
endif(ENABLE_STRIP)
|
||||
PROPERTIES LINK_FLAGS "-s")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
install(
|
||||
@ -92,18 +92,18 @@ install(
|
||||
# MAKE volk_gnsssdr-config-info
|
||||
add_executable(volk_gnsssdr-config-info volk_gnsssdr-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_option_helpers.cc)
|
||||
if(ENABLE_STATIC_LIBS)
|
||||
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib})
|
||||
else(ENABLE_STATIC_LIBS)
|
||||
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib})
|
||||
add_dependencies(volk_gnsssdr-config-info volk_gnsssdr)
|
||||
endif(ENABLE_STATIC_LIBS)
|
||||
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr_static ${Clang_required_link} ${orc_lib})
|
||||
else()
|
||||
target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${Clang_required_link} ${orc_lib})
|
||||
add_dependencies(volk_gnsssdr-config-info volk_gnsssdr)
|
||||
endif()
|
||||
|
||||
if(ENABLE_STRIP)
|
||||
if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
set_target_properties(volk_gnsssdr-config-info
|
||||
PROPERTIES LINK_FLAGS "-s")
|
||||
endif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32)
|
||||
endif(ENABLE_STRIP)
|
||||
PROPERTIES LINK_FLAGS "-s")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(
|
||||
TARGETS volk_gnsssdr-config-info
|
||||
@ -114,17 +114,14 @@ install(
|
||||
|
||||
# Launch volk_gnsssdr_profile if requested to do so
|
||||
if(ENABLE_PROFILING)
|
||||
if(DEFINED VOLK_CONFIGPATH)
|
||||
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}
|
||||
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()
|
||||
|
||||
|
||||
|
||||
|
@ -16,52 +16,56 @@
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
FIND_PACKAGE(PkgConfig)
|
||||
PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22")
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22")
|
||||
|
||||
FIND_PROGRAM(ORCC_EXECUTABLE orcc
|
||||
HINTS ${PC_ORC_TOOLSDIR}
|
||||
PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin)
|
||||
find_program(ORCC_EXECUTABLE orcc
|
||||
HINTS ${PC_ORC_TOOLSDIR}
|
||||
PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin
|
||||
)
|
||||
|
||||
FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h
|
||||
HINTS ${PC_ORC_INCLUDEDIR}
|
||||
PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4)
|
||||
|
||||
|
||||
FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
HINTS ${PC_ORC_LIBDIR}
|
||||
/usr/local/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/lib/i386-linux-gnu
|
||||
/usr/lib/arm-linux-gnueabihf
|
||||
/usr/lib/arm-linux-gnueabi
|
||||
/usr/lib/aarch64-linux-gnu
|
||||
/usr/lib/mipsel-linux-gnu
|
||||
/usr/lib/mips-linux-gnu
|
||||
/usr/lib/mips64el-linux-gnuabi64
|
||||
/usr/lib/powerpc-linux-gnu
|
||||
/usr/lib/powerpc64-linux-gnu
|
||||
/usr/lib/powerpc64le-linux-gnu
|
||||
/usr/lib/hppa-linux-gnu
|
||||
/usr/lib/s390x-linux-gnu
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
|
||||
|
||||
FIND_LIBRARY(ORC_LIB orc-0.4
|
||||
HINTS ${PC_ORC_LIBRARY_DIRS}
|
||||
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
|
||||
|
||||
LIST(APPEND ORC_LIBRARY
|
||||
${ORC_LIB}
|
||||
find_path(ORC_INCLUDE_DIR NAMES orc/orc.h
|
||||
HINTS ${PC_ORC_INCLUDEDIR}
|
||||
PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4
|
||||
)
|
||||
|
||||
|
||||
SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR})
|
||||
SET(ORC_LIBRARIES ${ORC_LIBRARY})
|
||||
SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR})
|
||||
find_path(ORC_LIBRARY_DIR
|
||||
NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||
HINTS ${PC_ORC_LIBDIR}
|
||||
/usr/local/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/lib/i386-linux-gnu
|
||||
/usr/lib/arm-linux-gnueabihf
|
||||
/usr/lib/arm-linux-gnueabi
|
||||
/usr/lib/aarch64-linux-gnu
|
||||
/usr/lib/mipsel-linux-gnu
|
||||
/usr/lib/mips-linux-gnu
|
||||
/usr/lib/mips64el-linux-gnuabi64
|
||||
/usr/lib/powerpc-linux-gnu
|
||||
/usr/lib/powerpc64-linux-gnu
|
||||
/usr/lib/powerpc64le-linux-gnu
|
||||
/usr/lib/hppa-linux-gnu
|
||||
/usr/lib/s390x-linux-gnu
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
|
||||
find_library(ORC_LIB orc-0.4
|
||||
HINTS ${PC_ORC_LIBRARY_DIRS}
|
||||
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
|
||||
|
||||
list(APPEND ORC_LIBRARY
|
||||
${ORC_LIB}
|
||||
)
|
||||
|
||||
|
||||
set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR})
|
||||
set(ORC_LIBRARIES ${ORC_LIBRARY})
|
||||
set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
|
||||
|
||||
mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE)
|
||||
|
@ -30,7 +30,7 @@ set(__INCLUDED_VOLK_ADD_TEST TRUE)
|
||||
|
||||
function(VOLK_GEN_TEST executable_name)
|
||||
include(CMakeParseArgumentsCopy)
|
||||
CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
cmake_parse_arguments(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
add_executable(${executable_name} ${VOLK_TEST_SOURCES})
|
||||
target_link_libraries(${executable_name} ${VOLK_TEST_TARGET_DEPS})
|
||||
endfunction()
|
||||
@ -53,7 +53,7 @@ function(VOLK_ADD_TEST test_name executable_name)
|
||||
|
||||
#parse the arguments for component names
|
||||
include(CMakeParseArgumentsCopy)
|
||||
CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
cmake_parse_arguments(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
|
||||
#set the initial environs to use
|
||||
set(environs ${VOLK_TEST_ENVIRONS})
|
||||
@ -146,7 +146,7 @@ function(VOLK_ADD_TEST test_name executable_name)
|
||||
#each line sets an environment variable
|
||||
foreach(environ ${environs})
|
||||
file(APPEND ${sh_file} "export ${environ}\n")
|
||||
endforeach(environ)
|
||||
endforeach()
|
||||
|
||||
set(VOLK_TEST_ARGS "${test_name}")
|
||||
|
||||
@ -166,7 +166,7 @@ function(VOLK_ADD_TEST test_name executable_name)
|
||||
COMMAND ${SHELL} ${sh_file} ${TARGET_DIR_LIST}
|
||||
)
|
||||
|
||||
endif(UNIX)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
#In the land of windows, all libraries must be in the PATH. Since
|
||||
@ -199,7 +199,7 @@ function(VOLK_ADD_TEST test_name executable_name)
|
||||
#each line sets an environment variable
|
||||
foreach(environ ${environs})
|
||||
file(APPEND ${bat_file} "SET ${environ}\n")
|
||||
endforeach(environ)
|
||||
endforeach()
|
||||
|
||||
set(VOLK_TEST_ARGS "${test_name}")
|
||||
|
||||
@ -213,7 +213,7 @@ function(VOLK_ADD_TEST test_name executable_name)
|
||||
add_test(NAME qa_${test_name}
|
||||
COMMAND ${bat_file} ${TARGET_DIR_LIST}
|
||||
)
|
||||
endif(WIN32)
|
||||
endif()
|
||||
|
||||
endfunction(VOLK_ADD_TEST)
|
||||
endfunction()
|
||||
|
||||
|
@ -31,21 +31,21 @@ set(BOOST_REQUIRED_COMPONENTS
|
||||
|
||||
if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
|
||||
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix
|
||||
endif(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS} chrono)
|
||||
|
||||
if (NOT DEFINED BOOST_ALL_DYN_LINK)
|
||||
if(NOT DEFINED BOOST_ALL_DYN_LINK)
|
||||
set(BOOST_ALL_DYN_LINK TRUE)
|
||||
endif()
|
||||
set(BOOST_ALL_DYN_LINK "${BOOST_ALL_DYN_LINK}" CACHE BOOL "boost enable dynamic linking")
|
||||
if(BOOST_ALL_DYN_LINK)
|
||||
add_definitions(-DBOOST_ALL_DYN_LINK) #setup boost auto-linking in msvc
|
||||
else(BOOST_ALL_DYN_LINK)
|
||||
else()
|
||||
unset(BOOST_REQUIRED_COMPONENTS) #empty components list for static link
|
||||
endif(BOOST_ALL_DYN_LINK)
|
||||
endif(MSVC)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Boost "1.35" COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
|
||||
|
||||
@ -68,10 +68,10 @@ set(Boost_ADDITIONAL_VERSIONS
|
||||
# Boost 1.52 disabled, see https://svn.boost.org/trac/boost/ticket/7669
|
||||
# Similar problems with Boost 1.46 and 1.47.
|
||||
|
||||
OPTION(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF)
|
||||
option(ENABLE_BAD_BOOST "Enable known bad versions of Boost" OFF)
|
||||
if(ENABLE_BAD_BOOST)
|
||||
MESSAGE(STATUS "Enabling use of known bad versions of Boost.")
|
||||
endif(ENABLE_BAD_BOOST)
|
||||
message(STATUS "Enabling use of known bad versions of Boost.")
|
||||
endif()
|
||||
|
||||
# For any unsuitable Boost version, add the version number below in
|
||||
# the following format: XXYYZZ
|
||||
@ -80,17 +80,17 @@ endif(ENABLE_BAD_BOOST)
|
||||
# YY is the minor version number ('46' for 1.46)
|
||||
# ZZ is the patcher version number (typically just '00')
|
||||
set(Boost_NOGO_VERSIONS
|
||||
104600 104601 104700 105200
|
||||
)
|
||||
104600 104601 104700 105200
|
||||
)
|
||||
|
||||
foreach(ver ${Boost_NOGO_VERSIONS})
|
||||
if("${Boost_VERSION}" STREQUAL "${ver}")
|
||||
if(NOT ENABLE_BAD_BOOST)
|
||||
MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.")
|
||||
set(Boost_FOUND FALSE)
|
||||
else(NOT ENABLE_BAD_BOOST)
|
||||
MESSAGE(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.")
|
||||
set(Boost_FOUND TRUE)
|
||||
endif(NOT ENABLE_BAD_BOOST)
|
||||
endif("${Boost_VERSION}" STREQUAL "${ver}")
|
||||
endforeach(ver)
|
||||
if("${Boost_VERSION}" STREQUAL "${ver}")
|
||||
if(NOT ENABLE_BAD_BOOST)
|
||||
message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Disabling.")
|
||||
set(Boost_FOUND FALSE)
|
||||
else()
|
||||
message(STATUS "WARNING: Found a known bad version of Boost (v${Boost_VERSION}). Continuing anyway.")
|
||||
set(Boost_FOUND TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
|
@ -53,16 +53,16 @@ list(APPEND AVAIL_BUILDTYPES
|
||||
# the avialable build types.
|
||||
########################################################################
|
||||
function(VOLK_CHECK_BUILD_TYPE settype)
|
||||
STRING(TOUPPER ${settype} _settype)
|
||||
string(TOUPPER ${settype} _settype)
|
||||
foreach(btype ${AVAIL_BUILDTYPES})
|
||||
STRING(TOUPPER ${btype} _btype)
|
||||
string(TOUPPER ${btype} _btype)
|
||||
if(${_settype} STREQUAL ${_btype})
|
||||
return() # found it; exit cleanly
|
||||
endif(${_settype} STREQUAL ${_btype})
|
||||
endforeach(btype)
|
||||
endif()
|
||||
endforeach()
|
||||
# Build type not found; error out
|
||||
message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}")
|
||||
endfunction(VOLK_CHECK_BUILD_TYPE)
|
||||
endfunction()
|
||||
|
||||
########################################################################
|
||||
# For GCC and Clang, we can set a build type:
|
||||
@ -74,23 +74,23 @@ endfunction(VOLK_CHECK_BUILD_TYPE)
|
||||
# NOTE: This is not defined on Windows systems.
|
||||
########################################################################
|
||||
if(NOT WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING
|
||||
set(CMAKE_CXX_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING
|
||||
"Flags used by the C++ compiler during DebugParanoid builds." FORCE)
|
||||
SET(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING
|
||||
set(CMAKE_C_FLAGS_DEBUGPARANOID "-Wall -Wextra -g -O0" CACHE STRING
|
||||
"Flags used by the C compiler during DebugParanoid builds." FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used for linking binaries during NoOptWithASM builds." FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUGPARANOID
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used by the shared lib linker during NoOptWithASM builds." FORCE)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_DEBUGPARANOID
|
||||
CMAKE_C_FLAGS_DEBUGPARANOID
|
||||
CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID
|
||||
CMAKE_SHARED_LINKER_DEBUGPARANOID)
|
||||
endif(NOT WIN32)
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -105,23 +105,23 @@ endif(NOT WIN32)
|
||||
# NOTE: This is not defined on Windows systems.
|
||||
########################################################################
|
||||
if(NOT WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING
|
||||
set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING
|
||||
"Flags used by the C++ compiler during NoOptWithASM builds." FORCE)
|
||||
SET(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING
|
||||
set(CMAKE_C_FLAGS_NOOPTWITHASM "-save-temps -g -O0" CACHE STRING
|
||||
"Flags used by the C compiler during NoOptWithASM builds." FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
|
||||
set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used for linking binaries during NoOptWithASM builds." FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used by the shared lib linker during NoOptWithASM builds." FORCE)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_NOOPTWITHASM
|
||||
CMAKE_C_FLAGS_NOOPTWITHASM
|
||||
CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
|
||||
CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM)
|
||||
endif(NOT WIN32)
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -137,23 +137,23 @@ endif(NOT WIN32)
|
||||
########################################################################
|
||||
|
||||
if(NOT WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING
|
||||
set(CMAKE_CXX_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING
|
||||
"Flags used by the C++ compiler during O2WithASM builds." FORCE)
|
||||
SET(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING
|
||||
set(CMAKE_C_FLAGS_O2WITHASM "-save-temps -g -O2" CACHE STRING
|
||||
"Flags used by the C compiler during O2WithASM builds." FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_O2WITHASM
|
||||
set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used for linking binaries during O2WithASM builds." FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used by the shared lib linker during O2WithASM builds." FORCE)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_O2WITHASM
|
||||
CMAKE_C_FLAGS_O2WITHASM
|
||||
CMAKE_EXE_LINKER_FLAGS_O2WITHASM
|
||||
CMAKE_SHARED_LINKER_FLAGS_O2WITHASM)
|
||||
endif(NOT WIN32)
|
||||
endif()
|
||||
|
||||
|
||||
########################################################################
|
||||
@ -169,23 +169,23 @@ endif(NOT WIN32)
|
||||
########################################################################
|
||||
|
||||
if(NOT WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING
|
||||
set(CMAKE_CXX_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING
|
||||
"Flags used by the C++ compiler during O3WithASM builds." FORCE)
|
||||
SET(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING
|
||||
set(CMAKE_C_FLAGS_O3WITHASM "-save-temps -g -O3" CACHE STRING
|
||||
"Flags used by the C compiler during O3WithASM builds." FORCE)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS_O3WITHASM
|
||||
set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used for linking binaries during O3WithASM builds." FORCE)
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM
|
||||
"-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
|
||||
"Flags used by the shared lib linker during O3WithASM builds." FORCE)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_O3WITHASM
|
||||
CMAKE_C_FLAGS_O3WITHASM
|
||||
CMAKE_EXE_LINKER_FLAGS_O3WITHASM
|
||||
CMAKE_SHARED_LINKER_FLAGS_O3WITHASM)
|
||||
endif(NOT WIN32)
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# For GCC and Clang, we can set a build type:
|
||||
@ -197,14 +197,14 @@ endif(NOT WIN32)
|
||||
# NOTE: This is not defined on Windows systems.
|
||||
########################################################################
|
||||
if(NOT WIN32)
|
||||
SET(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
|
||||
set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
|
||||
"Flags used by the C++ compiler during Address Sanitized builds." FORCE)
|
||||
SET(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
|
||||
set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
|
||||
"Flags used by the C compiler during Address Sanitized builds." FORCE)
|
||||
MARK_AS_ADVANCED(
|
||||
mark_as_advanced(
|
||||
CMAKE_CXX_FLAGS_ASAN
|
||||
CMAKE_C_FLAGS_ASAN
|
||||
CMAKE_EXE_LINKER_FLAGS_DEBUGPARANOID
|
||||
CMAKE_SHARED_LINKER_DEBUGPARANOID)
|
||||
endif(NOT WIN32)
|
||||
endif()
|
||||
|
||||
|
@ -15,33 +15,33 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr)
|
||||
|
||||
FIND_PATH(
|
||||
find_path(
|
||||
VOLK_GNSSSDR_INCLUDE_DIRS
|
||||
NAMES volk_gnsssdr/volk_gnsssdr.h
|
||||
HINTS $ENV{VOLK_DIR}/include
|
||||
${PC_VOLK_INCLUDEDIR}
|
||||
PATHS /usr/local/include
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
"@CMAKE_INSTALL_PREFIX@/include"
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
"@CMAKE_INSTALL_PREFIX@/include"
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
find_library(
|
||||
VOLK_GNSSSDR_LIBRARIES
|
||||
NAMES volk_gnsssdr
|
||||
HINTS $ENV{VOLK_DIR}/lib
|
||||
${PC_VOLK_LIBDIR}
|
||||
PATHS /usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
"@CMAKE_INSTALL_PREFIX@/lib"
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
"@CMAKE_INSTALL_PREFIX@/lib"
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
|
||||
mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
|
||||
|
@ -27,6 +27,6 @@ if(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION})
|
||||
if(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION})
|
||||
set(PACKAGE_VERSION_EXACT 1) # exact match for API version
|
||||
set(PACKAGE_VERSION_COMPATIBLE 1) # compat for minor/patch version
|
||||
endif(NOT ${PACKAGE_FIND_VERSION_PATCH} GREATER ${MAINT_VERSION})
|
||||
endif(${PACKAGE_FIND_VERSION_MINOR} EQUAL ${MINOR_VERSION})
|
||||
endif(${PACKAGE_FIND_VERSION_MAJOR} EQUAL ${MAJOR_VERSION})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@ -32,30 +32,30 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
if(PYTHON_EXECUTABLE)
|
||||
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
|
||||
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
|
||||
else(PYTHON_EXECUTABLE)
|
||||
else()
|
||||
message(STATUS "PYTHON_EXECUTABLE not set - using default python2")
|
||||
message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.")
|
||||
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION})
|
||||
if(NOT PYTHONINTERP_FOUND)
|
||||
message(STATUS "python2 not found - using python3")
|
||||
find_package(PythonInterp ${VOLK_PYTHON3_MIN_VERSION} REQUIRED)
|
||||
endif(NOT PYTHONINTERP_FOUND)
|
||||
endif(PYTHON_EXECUTABLE)
|
||||
endif()
|
||||
endif()
|
||||
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
|
||||
else(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
else()
|
||||
if(PYTHON_EXECUTABLE)
|
||||
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
|
||||
find_package(PythonInterp ${VOLK_PYTHON_MIN_VERSION} REQUIRED)
|
||||
else(PYTHON_EXECUTABLE)
|
||||
find_package (Python COMPONENTS Interpreter)
|
||||
else()
|
||||
find_package(Python COMPONENTS Interpreter)
|
||||
set(PYTHON_VERSION_MAJOR ${Python_VERSION_MAJOR})
|
||||
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
|
||||
endif(PYTHON_EXECUTABLE)
|
||||
endif(CMAKE_VERSION VERSION_LESS 3.12)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
|
||||
if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
|
||||
set(PYTHON3 TRUE)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ macro(VOLK_PYTHON_CHECK_MODULE_RAW desc python_code have)
|
||||
message(STATUS "Python checking for ${desc} - not found")
|
||||
set(${have} FALSE)
|
||||
endif()
|
||||
endmacro(VOLK_PYTHON_CHECK_MODULE_RAW)
|
||||
endmacro()
|
||||
|
||||
macro(VOLK_PYTHON_CHECK_MODULE desc mod cmd have)
|
||||
VOLK_PYTHON_CHECK_MODULE_RAW(
|
||||
@ -92,7 +92,7 @@ except (ImportError, AssertionError): exit(-1)
|
||||
except: pass
|
||||
#########################################"
|
||||
"${have}")
|
||||
endmacro(VOLK_PYTHON_CHECK_MODULE)
|
||||
endmacro()
|
||||
|
||||
########################################################################
|
||||
# Sets the python installation directory VOLK_PYTHON_DIR
|
||||
@ -121,14 +121,14 @@ unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5]
|
||||
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
|
||||
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
add_custom_target(${_target} ALL DEPENDS ${ARGN})
|
||||
endfunction(VOLK_UNIQUE_TARGET)
|
||||
endfunction()
|
||||
|
||||
########################################################################
|
||||
# Install python sources (also builds and installs byte-compiled python)
|
||||
########################################################################
|
||||
function(VOLK_PYTHON_INSTALL)
|
||||
include(CMakeParseArgumentsCopy)
|
||||
CMAKE_PARSE_ARGUMENTS(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN})
|
||||
cmake_parse_arguments(VOLK_PYTHON_INSTALL "" "DESTINATION;COMPONENT" "FILES;PROGRAMS" ${ARGN})
|
||||
|
||||
####################################################################
|
||||
if(VOLK_PYTHON_INSTALL_FILES)
|
||||
@ -162,7 +162,7 @@ function(VOLK_PYTHON_INSTALL)
|
||||
get_filename_component(pygen_path ${pygenfile} PATH)
|
||||
file(MAKE_DIRECTORY ${pygen_path})
|
||||
|
||||
endforeach(pyfile)
|
||||
endforeach()
|
||||
|
||||
#the command to generate the pyc files
|
||||
add_custom_command(
|
||||
@ -189,8 +189,8 @@ function(VOLK_PYTHON_INSTALL)
|
||||
####################################################################
|
||||
file(TO_NATIVE_PATH ${PYTHON_EXECUTABLE} pyexe_native)
|
||||
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
set(pyexe_native "/usr/bin/env python")
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set(pyexe_native "/usr/bin/env python")
|
||||
endif()
|
||||
|
||||
foreach(pyfile ${VOLK_PYTHON_INSTALL_PROGRAMS})
|
||||
@ -220,13 +220,13 @@ function(VOLK_PYTHON_INSTALL)
|
||||
DESTINATION ${VOLK_PYTHON_INSTALL_DESTINATION}
|
||||
COMPONENT ${VOLK_PYTHON_INSTALL_COMPONENT}
|
||||
)
|
||||
endforeach(pyfile)
|
||||
endforeach()
|
||||
|
||||
endif()
|
||||
|
||||
VOLK_UNIQUE_TARGET("pygen" ${python_install_gen_targets})
|
||||
volk_unique_target("pygen" ${python_install_gen_targets})
|
||||
|
||||
endfunction(VOLK_PYTHON_INSTALL)
|
||||
endfunction()
|
||||
|
||||
########################################################################
|
||||
# Write the python helper script that generates byte code files
|
||||
|
@ -22,22 +22,22 @@
|
||||
# header file detection
|
||||
########################################################################
|
||||
include(CheckIncludeFile)
|
||||
CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H)
|
||||
check_include_file(cpuid.h HAVE_CPUID_H)
|
||||
if(HAVE_CPUID_H)
|
||||
add_definitions(-DHAVE_CPUID_H)
|
||||
endif()
|
||||
|
||||
CHECK_INCLUDE_FILE(intrin.h HAVE_INTRIN_H)
|
||||
check_include_file(intrin.h HAVE_INTRIN_H)
|
||||
if(HAVE_INTRIN_H)
|
||||
add_definitions(-DHAVE_INTRIN_H)
|
||||
endif()
|
||||
|
||||
CHECK_INCLUDE_FILE(fenv.h HAVE_FENV_H)
|
||||
check_include_file(fenv.h HAVE_FENV_H)
|
||||
if(HAVE_FENV_H)
|
||||
add_definitions(-DHAVE_FENV_H)
|
||||
endif()
|
||||
|
||||
CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
|
||||
check_include_file(dlfcn.h HAVE_DLFCN_H)
|
||||
if(HAVE_DLFCN_H)
|
||||
add_definitions(-DHAVE_DLFCN_H)
|
||||
list(APPEND volk_gnsssdr_libraries ${CMAKE_DL_LIBS})
|
||||
@ -62,7 +62,7 @@ endif()
|
||||
########################################################################
|
||||
if(COMPILER_NAME MATCHES "GNU")
|
||||
include(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG)
|
||||
check_cxx_compiler_flag("-Werror=unused-command-line-argument" HAVE_WERROR_UNUSED_CMD_LINE_ARG)
|
||||
if(HAVE_WERROR_UNUSED_CMD_LINE_ARG)
|
||||
set(VOLK_FLAG_CHECK_FLAGS "-Werror=unused-command-line-argument")
|
||||
endif()
|
||||
@ -74,20 +74,20 @@ endif()
|
||||
########################################################################
|
||||
|
||||
include(CheckSymbolExists)
|
||||
CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN)
|
||||
|
||||
check_symbol_exists(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN)
|
||||
|
||||
if(HAVE_POSIX_MEMALIGN)
|
||||
add_definitions(-DHAVE_POSIX_MEMALIGN)
|
||||
endif(HAVE_POSIX_MEMALIGN)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED _XOPEN_SOURCE)
|
||||
add_definitions(-D_XOPEN_SOURCE=700)
|
||||
endif(NOT DEFINED _XOPEN_SOURCE)
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# detect x86 flavor of CPU
|
||||
########################################################################
|
||||
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64|AMD64)$")
|
||||
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(i.86|x86|x86_64|amd64|AMD64)$")
|
||||
message(STATUS "x86* CPU detected")
|
||||
set(CPU_IS_x86 TRUE)
|
||||
endif()
|
||||
@ -106,7 +106,7 @@ macro(check_arch arch_name)
|
||||
set(flags ${ARGN})
|
||||
set(have_${arch_name} TRUE)
|
||||
foreach(flag ${flags})
|
||||
if (MSVC AND (${flag} STREQUAL "/arch:SSE2" OR ${flag} STREQUAL "/arch:SSE" ))
|
||||
if(MSVC AND (${flag} STREQUAL "/arch:SSE2" OR ${flag} STREQUAL "/arch:SSE"))
|
||||
# SSE/SSE2 is supported in MSVC since VS 2005 but flag not available when compiling 64-bit so do not check
|
||||
else()
|
||||
include(CheckCXXCompilerFlag)
|
||||
@ -119,27 +119,27 @@ macro(check_arch arch_name)
|
||||
if(VOLK_FLAG_CHECK_FLAGS)
|
||||
set(CMAKE_REQUIRED_FLAGS ${VOLK_FLAG_CHECK_FLAGS})
|
||||
endif()
|
||||
CHECK_CXX_COMPILER_FLAG(${flag} ${have_flag})
|
||||
check_cxx_compiler_flag(${flag} ${have_flag})
|
||||
unset(CMAKE_REQUIRED_FLAGS)
|
||||
if (NOT ${have_flag})
|
||||
if(NOT ${have_flag})
|
||||
set(have_${arch_name} FALSE)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
if (have_${arch_name})
|
||||
if(have_${arch_name})
|
||||
list(APPEND available_archs ${arch_name})
|
||||
endif()
|
||||
endmacro(check_arch)
|
||||
endmacro()
|
||||
|
||||
foreach(line ${arch_flag_lines})
|
||||
string(REGEX REPLACE "," ";" arch_flags ${line})
|
||||
check_arch(${arch_flags})
|
||||
endforeach(line)
|
||||
endforeach()
|
||||
|
||||
macro(OVERRULE_ARCH arch reason)
|
||||
message(STATUS "${reason}, Overruled arch ${arch}")
|
||||
list(REMOVE_ITEM available_archs ${arch})
|
||||
endmacro(OVERRULE_ARCH)
|
||||
endmacro()
|
||||
|
||||
########################################################################
|
||||
# eliminate AVX on if not on x86, or if the compiler does not accept
|
||||
@ -150,25 +150,25 @@ set(HAVE_XGETBV 0)
|
||||
set(HAVE_AVX_CVTPI32_PS 0)
|
||||
if(CPU_IS_x86)
|
||||
# check to see if the compiler/linker works with xgetb instruction
|
||||
if (NOT MSVC)
|
||||
if(NOT MSVC)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "unsigned long long _xgetbv(unsigned int index) { unsigned int eax, edx; __asm__ __volatile__(\"xgetbv\" : \"=a\"(eax), \"=d\"(edx) : \"c\"(index)); return ((unsigned long long)edx << 32) | eax; } int main (void) { (void) _xgetbv(0); return (0); }")
|
||||
else (NOT MSVC)
|
||||
else()
|
||||
#MSVC defines an intrinsic
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c "#include <stdio.h> \n #include <intrin.h> \n int main() { int avxSupported = 0; \n#if (_MSC_FULL_VER >= 160040219) \nint cpuInfo[4]; __cpuid(cpuInfo, 1);\nif ((cpuInfo[2] & (1 << 27) || 0) && (cpuInfo[2] & (1 << 28) || 0)) \n{\nunsigned long long xcrFeatureMask = _xgetbv(_XCR_XFEATURE_ENABLED_MASK);\n avxSupported = (xcrFeatureMask & 0x6) == 6;}\n#endif \n return 1- avxSupported; }")
|
||||
endif(NOT MSVC)
|
||||
endif()
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv.c
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
RESULT_VARIABLE avx_compile_result)
|
||||
if(NOT ${avx_compile_result} EQUAL 0)
|
||||
OVERRULE_ARCH(avx "Compiler or linker missing xgetbv instruction")
|
||||
overrule_arch(avx "Compiler or linker missing xgetbv instruction")
|
||||
elseif(NOT CROSSCOMPILE_MULTILIB)
|
||||
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_xgetbv
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
RESULT_VARIABLE avx_exe_result)
|
||||
if(NOT ${avx_exe_result} EQUAL 0)
|
||||
OVERRULE_ARCH(avx "CPU missing xgetbv")
|
||||
overrule_arch(avx "CPU missing xgetbv")
|
||||
else()
|
||||
set(HAVE_XGETBV 1)
|
||||
endif()
|
||||
@ -184,7 +184,7 @@ if(CPU_IS_x86)
|
||||
#########################################################################
|
||||
|
||||
# check to see if the compiler/linker works with cvtpi32_ps instrinsic when using AVX
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c "#include <immintrin.h>\nint main (void) {__m128 __a; __m64 __b; __m128 foo = _mm_cvtpi32_ps(__a, __b); return (0); }")
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -mavx -o
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps
|
||||
@ -192,13 +192,13 @@ if(CPU_IS_x86)
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
RESULT_VARIABLE avx_compile_result)
|
||||
if(NOT ${avx_compile_result} EQUAL 0)
|
||||
OVERRULE_ARCH(avx "Compiler missing cvtpi32_ps instrinsic")
|
||||
overrule_arch(avx "Compiler missing cvtpi32_ps instrinsic")
|
||||
elseif(NOT CROSSCOMPILE_MULTILIB)
|
||||
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
RESULT_VARIABLE avx_exe_result)
|
||||
if(NOT ${avx_exe_result} EQUAL 0)
|
||||
OVERRULE_ARCH(avx "CPU missing cvtpi32_ps")
|
||||
overrule_arch(avx "CPU missing cvtpi32_ps")
|
||||
else()
|
||||
set(HAVE_AVX_CVTPI32_PS 1)
|
||||
endif()
|
||||
@ -207,10 +207,10 @@ if(CPU_IS_x86)
|
||||
endif()
|
||||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps
|
||||
${CMAKE_CURRENT_BINARY_DIR}/test_cvtpi32_ps.c)
|
||||
else(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
# 64-bit compilations won't need this command so don't overrule AVX
|
||||
set(HAVE_AVX_CVTPI32_PS 0)
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
else()
|
||||
# 64-bit compilations won't need this command so don't overrule AVX
|
||||
set(HAVE_AVX_CVTPI32_PS 0)
|
||||
endif()
|
||||
|
||||
# Disable SSE4a if Clang is less than version 3.2
|
||||
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||
@ -222,14 +222,14 @@ if(CPU_IS_x86)
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
|
||||
OUTPUT_VARIABLE clang_version)
|
||||
string(REGEX MATCH "[0-9].[0-9]" CMAKE_C_COMPILER_VERSION ${clang_version})
|
||||
endif(CMAKE_VERSION VERSION_LESS "2.8.10")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2")
|
||||
OVERRULE_ARCH(sse4_a "Clang >= 3.2 required for SSE4a")
|
||||
endif(CMAKE_C_COMPILER_VERSION VERSION_LESS "3.2")
|
||||
endif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
||||
overrule_arch(sse4_a "Clang >= 3.2 required for SSE4a")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif(CPU_IS_x86)
|
||||
endif()
|
||||
|
||||
if(${HAVE_XGETBV})
|
||||
add_definitions(-DHAVE_XGETBV)
|
||||
@ -244,17 +244,17 @@ endif()
|
||||
########################################################################
|
||||
|
||||
if(NOT CPU_IS_x86)
|
||||
OVERRULE_ARCH(3dnow "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(mmx "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(sse "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(sse2 "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(sse3 "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(ssse3 "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(sse4_a "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(sse4_1 "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(sse4_2 "Architecture is not x86 or x86_64")
|
||||
OVERRULE_ARCH(avx "Architecture is not x86 or x86_64")
|
||||
endif(NOT CPU_IS_x86)
|
||||
overrule_arch(3dnow "Architecture is not x86 or x86_64")
|
||||
overrule_arch(mmx "Architecture is not x86 or x86_64")
|
||||
overrule_arch(sse "Architecture is not x86 or x86_64")
|
||||
overrule_arch(sse2 "Architecture is not x86 or x86_64")
|
||||
overrule_arch(sse3 "Architecture is not x86 or x86_64")
|
||||
overrule_arch(ssse3 "Architecture is not x86 or x86_64")
|
||||
overrule_arch(sse4_a "Architecture is not x86 or x86_64")
|
||||
overrule_arch(sse4_1 "Architecture is not x86 or x86_64")
|
||||
overrule_arch(sse4_2 "Architecture is not x86 or x86_64")
|
||||
overrule_arch(avx "Architecture is not x86 or x86_64")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Select neon based on ARM ISA version
|
||||
@ -265,33 +265,33 @@ endif(NOT CPU_IS_x86)
|
||||
include(CheckCSourceCompiles)
|
||||
|
||||
check_c_source_compiles("#include <arm_neon.h>\nint main(){ uint8_t *dest; uint8x8_t res; vst1_u8(dest, res); }"
|
||||
neon_compile_result)
|
||||
neon_compile_result)
|
||||
|
||||
if(neon_compile_result)
|
||||
check_c_source_compiles("int main(){asm volatile(\"vrev32.8 q0, q0\");}"
|
||||
have_neonv7_result )
|
||||
have_neonv7_result)
|
||||
check_c_source_compiles("int main(){asm volatile(\"sub v1.4s,v1.4s,v1.4s\");}"
|
||||
have_neonv8_result )
|
||||
have_neonv8_result)
|
||||
|
||||
if (have_neonv7_result)
|
||||
OVERRULE_ARCH(neonv8 "CPU is armv7")
|
||||
if(have_neonv7_result)
|
||||
overrule_arch(neonv8 "CPU is armv7")
|
||||
endif()
|
||||
|
||||
if (have_neonv8_result)
|
||||
OVERRULE_ARCH(neonv7 "CPU is armv8")
|
||||
if(have_neonv8_result)
|
||||
overrule_arch(neonv7 "CPU is armv8")
|
||||
endif()
|
||||
else(neon_compile_result)
|
||||
OVERRULE_ARCH(neon "Compiler doesn't support NEON")
|
||||
OVERRULE_ARCH(neonv7 "Compiler doesn't support NEON")
|
||||
OVERRULE_ARCH(neonv8 "Compiler doesn't support NEON")
|
||||
endif(neon_compile_result)
|
||||
else()
|
||||
overrule_arch(neon "Compiler doesn't support NEON")
|
||||
overrule_arch(neonv7 "Compiler doesn't support NEON")
|
||||
overrule_arch(neonv8 "Compiler doesn't support NEON")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# implement overruling in the ORC case,
|
||||
# since ORC always passes flag detection
|
||||
########################################################################
|
||||
if(NOT ORC_FOUND)
|
||||
OVERRULE_ARCH(orc "ORC support not found")
|
||||
overrule_arch(orc "ORC support not found")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
@ -301,16 +301,16 @@ endif()
|
||||
if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86)
|
||||
include(CheckTypeSize)
|
||||
check_type_size("void*[8]" SIZEOF_CPU BUILTIN_TYPES_ONLY)
|
||||
if (${SIZEOF_CPU} EQUAL 64)
|
||||
OVERRULE_ARCH(32 "CPU width is 64 bits")
|
||||
if(${SIZEOF_CPU} EQUAL 64)
|
||||
overrule_arch(32 "CPU width is 64 bits")
|
||||
endif()
|
||||
if (${SIZEOF_CPU} EQUAL 32)
|
||||
OVERRULE_ARCH(64 "CPU width is 32 bits")
|
||||
if(${SIZEOF_CPU} EQUAL 32)
|
||||
overrule_arch(64 "CPU width is 32 bits")
|
||||
endif()
|
||||
|
||||
#MSVC 64 bit does not have MMX, overrule it
|
||||
if (${SIZEOF_CPU} EQUAL 64 AND MSVC)
|
||||
OVERRULE_ARCH(mmx "No MMX for Win64")
|
||||
if(${SIZEOF_CPU} EQUAL 64 AND MSVC)
|
||||
overrule_arch(mmx "No MMX for Win64")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
@ -340,12 +340,12 @@ execute_process(
|
||||
foreach(arch mmx orc 64 32)
|
||||
foreach(machine_name ${available_machines})
|
||||
string(REPLACE "_${arch}" "" machine_name_no_arch ${machine_name})
|
||||
if (${machine_name} STREQUAL ${machine_name_no_arch})
|
||||
if(${machine_name} STREQUAL ${machine_name_no_arch})
|
||||
else()
|
||||
list(REMOVE_ITEM available_machines ${machine_name_no_arch})
|
||||
endif()
|
||||
endforeach(machine_name)
|
||||
endforeach(arch)
|
||||
endforeach()
|
||||
endforeach()
|
||||
|
||||
########################################################################
|
||||
# done overrules! print the result
|
||||
@ -373,7 +373,7 @@ macro(gen_template tmpl output)
|
||||
${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py
|
||||
--input ${tmpl} --output ${output} ${ARGN}
|
||||
)
|
||||
endmacro(gen_template)
|
||||
endmacro()
|
||||
|
||||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/volk_gnsssdr)
|
||||
|
||||
@ -399,13 +399,13 @@ if(MSVC)
|
||||
elseif(MSVC11) #Visual Studio 11
|
||||
set(cmake_c_compiler_version "Microsoft Visual Studio 11.0")
|
||||
elseif(MSVC12) #Visual Studio 12
|
||||
SET(cmake_c_compiler_version "Microsoft Visual Studio 12.0")
|
||||
set(cmake_c_compiler_version "Microsoft Visual Studio 12.0")
|
||||
endif()
|
||||
else()
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
|
||||
OUTPUT_VARIABLE cmake_c_compiler_version)
|
||||
endif(MSVC)
|
||||
set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n" )
|
||||
endif()
|
||||
set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FLAGS}\n${CMAKE_CXX_COMPILER}:::${CMAKE_CXX_FLAGS_${GRCBTU}} ${CMAKE_CXX_FLAGS}\n")
|
||||
|
||||
foreach(machine_name ${available_machines})
|
||||
#generate machine source
|
||||
@ -419,8 +419,8 @@ foreach(machine_name ${available_machines})
|
||||
--mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}"
|
||||
OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
MESSAGE(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}")
|
||||
set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n" )
|
||||
message(STATUS "BUILD INFO ::: ${machine_name} ::: ${COMPILER_NAME} ::: ${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}")
|
||||
set(COMPILER_INFO "${COMPILER_INFO}${machine_name}:::${COMPILER_NAME}:::${CMAKE_C_FLAGS_${CBTU}} ${CMAKE_C_FLAGS} ${${machine_name}_flags}\n")
|
||||
if(${machine_name}_flags AND NOT MSVC)
|
||||
set_source_files_properties(${machine_source} PROPERTIES COMPILE_FLAGS "${${machine_name}_flags}")
|
||||
endif()
|
||||
@ -428,12 +428,12 @@ foreach(machine_name ${available_machines})
|
||||
#add to available machine defs
|
||||
string(TOUPPER LV_MACHINE_${machine_name} machine_def)
|
||||
list(APPEND machine_defs ${machine_def})
|
||||
endforeach(machine_name)
|
||||
endforeach()
|
||||
|
||||
# Convert to a C string to compile and display properly
|
||||
string(STRIP "${cmake_c_compiler_version}" cmake_c_compiler_version)
|
||||
string(STRIP ${COMPILER_INFO} COMPILER_INFO)
|
||||
MESSAGE(STATUS "Compiler Version: ${cmake_c_compiler_version}")
|
||||
message(STATUS "Compiler Version: ${cmake_c_compiler_version}")
|
||||
string(REPLACE "\n" " \\n" cmake_c_compiler_version ${cmake_c_compiler_version})
|
||||
string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO})
|
||||
|
||||
@ -462,7 +462,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
|
||||
# set up the assembler flags and include the source files
|
||||
foreach(ARCH ${ASM_ARCHS_AVAILABLE})
|
||||
string(REGEX MATCH "${ARCH}" ASM_ARCH "${available_archs}")
|
||||
if( ASM_ARCH STREQUAL "neonv7" )
|
||||
if(ASM_ARCH STREQUAL "neonv7")
|
||||
message(STATUS "---- Adding ASM files") # we always use ATT syntax
|
||||
message(STATUS "-- Detected neon architecture; enabling ASM")
|
||||
# setup architecture specific assembler flags
|
||||
@ -474,23 +474,23 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
|
||||
foreach(asm_file ${asm_files})
|
||||
list(APPEND volk_gnsssdr_sources ${asm_file})
|
||||
message(STATUS "Adding source file: ${asm_file}")
|
||||
endforeach(asm_file)
|
||||
endforeach()
|
||||
endif()
|
||||
enable_language(ASM)
|
||||
set(CMAKE_ASM_FLAGS ${ARCH_ASM_FLAGS})
|
||||
message(STATUS "c flags: ${FULL_C_FLAGS}")
|
||||
message(STATUS "asm flags: ${CMAKE_ASM_FLAGS}")
|
||||
endforeach(ARCH)
|
||||
endforeach()
|
||||
|
||||
else(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
|
||||
else()
|
||||
message(STATUS "Not enabling ASM support. CMake >= 2.8.10 required.")
|
||||
foreach(machine_name ${available_machines})
|
||||
string(REGEX MATCH "neon" NEON_MACHINE ${machine_name})
|
||||
if( NEON_MACHINE STREQUAL "neon")
|
||||
if(NEON_MACHINE STREQUAL "neon")
|
||||
message(FATAL_ERROR "CMake >= 2.8.10 is required for ARM NEON support")
|
||||
endif()
|
||||
endforeach()
|
||||
endif(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Handle orc support
|
||||
@ -517,7 +517,7 @@ if(ORC_FOUND)
|
||||
)
|
||||
list(APPEND volk_gnsssdr_sources ${orcc_gen})
|
||||
|
||||
endforeach(orc_file)
|
||||
endforeach()
|
||||
else()
|
||||
message(STATUS "Did not find liborc and orcc, disabling orc support...")
|
||||
endif()
|
||||
@ -571,7 +571,7 @@ endif()
|
||||
if(CMAKE_VERSION VERSION_GREATER "2.8.7")
|
||||
#Create a volk_gnsssdr object library (requires cmake >= 2.8.8)
|
||||
add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources})
|
||||
|
||||
|
||||
#Add dynamic library
|
||||
add_library(volk_gnsssdr SHARED $<TARGET_OBJECTS:volk_gnsssdr_obj>)
|
||||
target_link_libraries(volk_gnsssdr ${volk_gnsssdr_libraries} ${Boost_LIBRARIES})
|
||||
@ -597,7 +597,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7")
|
||||
install(TARGETS volk_gnsssdr_static
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel"
|
||||
)
|
||||
endif(ENABLE_STATIC_LIBS)
|
||||
endif()
|
||||
|
||||
#Older cmake versions (slower to build when building dynamic/static libs)
|
||||
else()
|
||||
@ -619,14 +619,14 @@ else()
|
||||
if(NOT WIN32)
|
||||
set_target_properties(volk_gnsssdr_static
|
||||
PROPERTIES OUTPUT_NAME volk_gnsssdr)
|
||||
endif(NOT WIN32)
|
||||
endif()
|
||||
|
||||
install(TARGETS volk_gnsssdr_static
|
||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_gnsssdr_devel" # .lib file
|
||||
)
|
||||
endif(ENABLE_STATIC_LIBS)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif(CMAKE_VERSION VERSION_GREATER "2.8.7")
|
||||
########################################################################
|
||||
# Build the QA test application
|
||||
########################################################################
|
||||
@ -641,7 +641,7 @@ if(ENABLE_TESTING)
|
||||
)
|
||||
|
||||
include(VolkAddTest)
|
||||
VOLK_GEN_TEST("volk_gnsssdr_test_all"
|
||||
volk_gen_test("volk_gnsssdr_test_all"
|
||||
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc
|
||||
TARGET_DEPS volk_gnsssdr
|
||||
@ -649,7 +649,7 @@ if(ENABLE_TESTING)
|
||||
foreach(kernel ${h_files})
|
||||
get_filename_component(kernel ${kernel} NAME)
|
||||
string(REPLACE ".h" "" kernel ${kernel})
|
||||
VOLK_ADD_TEST(${kernel} "volk_gnsssdr_test_all")
|
||||
volk_add_test(${kernel} "volk_gnsssdr_test_all")
|
||||
endforeach()
|
||||
|
||||
endif(ENABLE_TESTING)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user