diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fef66693..ef72511df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,10 @@ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "") cmake_minimum_required(VERSION 2.8.12...3.23) project(gnss-sdr CXX C) -list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) - +set(GNSSSDR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # Allows to be a sub-project +set(GNSSSDR_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +list(APPEND CMAKE_MODULE_PATH ${GNSSSDR_SOURCE_DIR}/cmake/Modules) ################################################################################ # Determine optional blocks/libraries to be built (default: not built) @@ -116,6 +117,8 @@ option(ENABLE_OWN_GNSSTK "Force to download, build and link gnsstk for system te if(NOT ENABLE_OWN_GNSSTK) option(ENABLE_OWN_GPSTK "Force to download, build and link gnsstk for system tests, even if it is already installed" OFF) if(ENABLE_OWN_GPSTK) + unset(Gnsstk:gnsstk CACHE) + unset(GNSSTK_FOUND CACHE) message(STATUS "WARNING: Option ENABLE_OWN_GPSTK is deprecated, please use ENABLE_OWN_GNSSTK") set(ENABLE_OWN_GNSSTK ON) endif() @@ -153,7 +156,7 @@ if(NOT ${THIS_IS_A_RELEASE}) # no: try to find it execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${GNSSSDR_SOURCE_DIR} OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -163,7 +166,7 @@ if(NOT ${THIS_IS_A_RELEASE}) # Get the latest abbreviated commit hash of the working branch execute_process( COMMAND ${GIT_EXECUTABLE} log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${GNSSSDR_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -273,10 +276,10 @@ if(UNIX) endif() # If this is an out-of-tree build, do not pollute the original source directory -if(${CMAKE_BINARY_DIR} MATCHES ${CMAKE_SOURCE_DIR}) - set(LOCAL_INSTALL_BASE_DIR ${CMAKE_SOURCE_DIR}) +if(${GNSSSDR_BINARY_DIR} MATCHES ${GNSSSDR_SOURCE_DIR}) + set(LOCAL_INSTALL_BASE_DIR ${GNSSSDR_SOURCE_DIR}) else() - set(LOCAL_INSTALL_BASE_DIR ${CMAKE_BINARY_DIR}) + set(LOCAL_INSTALL_BASE_DIR ${GNSSSDR_BINARY_DIR}) endif() # Determine if CMake scripts make use of target_sources() @@ -664,6 +667,10 @@ endif() set(FILESYSTEM_FOUND FALSE) if(NOT ENABLE_OWN_GNSSTK) unset(Gnsstk::gnsstk CACHE) + unset(GNSSTK_FOUND CACHE) + unset(GNSSTK_OLDER_THAN_8 CACHE) + unset(GNSSTK_OLDER_THAN_9 CACHE) + unset(GNSSTK_OLDER_THAN_13 CACHE) find_package(GNSSTK) set_package_properties(GNSSTK PROPERTIES PURPOSE "Used in some Extra Tests." @@ -1174,7 +1181,7 @@ if(NOT VOLKGNSSSDR_FOUND) endif() set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_COMPILER} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install + -DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install -DENABLE_STATIC_LIBS=ON -DENABLE_PROFILING=${ENABLE_PROFILING} -DENABLE_ORC=${ORC_ENABLED} @@ -1193,7 +1200,7 @@ if(NOT VOLKGNSSSDR_FOUND) ) if(NOT CMAKE_TOOLCHAIN_FILE) set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake + -DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake ) else() set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} @@ -1221,9 +1228,9 @@ if(NOT VOLKGNSSSDR_FOUND) endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build + PREFIX ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=$<$:None>$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:NoOptWithASM>$<$:Coverage>$<$:O2WithASM>$<$:O3WithASM>$<$:ASAN> -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} @@ -1231,13 +1238,13 @@ if(NOT VOLKGNSSSDR_FOUND) UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install + INSTALL_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install ) else() if(SUPPORTED_CPU_FEATURES_ARCH) set(VOLK_GNSSSDR_BUILD_BYPRODUCTS - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile ) if(ENABLE_CPUFEATURES) find_package(CPUFEATURES) @@ -1264,7 +1271,7 @@ if(NOT VOLKGNSSSDR_FOUND) ) set(VOLK_GNSSSDR_BUILD_BYPRODUCTS ${VOLK_GNSSSDR_BUILD_BYPRODUCTS} - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -1272,9 +1279,9 @@ if(NOT VOLKGNSSSDR_FOUND) -DVOLK_CPU_FEATURES=${ENABLE_CPUFEATURES} ) ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build + PREFIX ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=$<$:None>$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:NoOptWithASM>$<$:Coverage>$<$:O2WithASM>$<$:O3WithASM>$<$:ASAN> -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} @@ -1283,7 +1290,7 @@ if(NOT VOLKGNSSSDR_FOUND) PATCH_COMMAND "" BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile BUILD_BYPRODUCTS ${VOLK_GNSSSDR_BUILD_BYPRODUCTS} - INSTALL_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install + INSTALL_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install ) else() set(ENABLE_CPUFEATURES OFF) @@ -1291,9 +1298,9 @@ if(NOT VOLKGNSSSDR_FOUND) -DVOLK_CPU_FEATURES=${ENABLE_CPUFEATURES} ) ExternalProject_Add(volk_gnsssdr_module - PREFIX ${CMAKE_BINARY_DIR}/volk_gnsssdr_module - SOURCE_DIR ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr - BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build + PREFIX ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module + SOURCE_DIR ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr + BINARY_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=$<$:None>$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:NoOptWithASM>$<$:Coverage>$<$:O2WithASM>$<$:O3WithASM>$<$:ASAN> -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} @@ -1301,9 +1308,9 @@ if(NOT VOLKGNSSSDR_FOUND) UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND ${VOLK_GNSSSDR_BUILD_COMMAND} volk_gnsssdr_profile - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile - INSTALL_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/${CMAKE_FIND_LIBRARY_PREFIXES}volk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + INSTALL_DIR ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install ) endif() endif() @@ -1314,20 +1321,20 @@ if(NOT VOLKGNSSSDR_FOUND) endif() add_library(volk_gnsssdr UNKNOWN IMPORTED) - set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") + set_property(TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(VOLK_GNSSSDR_INCLUDE_DIRS "${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build/include/;${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}") set(VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ORC_LIBRARIES_STATIC}) if(CPUFEATURES_FOUND) set(VOLK_GNSSSDR_LIBRARIES ${VOLK_GNSSSDR_LIBRARIES} CpuFeature::cpu_features) endif() if(NOT TARGET Volkgnsssdr::volkgnsssdr) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build/include) add_library(Volkgnsssdr::volkgnsssdr STATIC IMPORTED) add_dependencies(Volkgnsssdr::volkgnsssdr volk_gnsssdr_module) set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/lib${VOLK_GNSSSDR_LIB_SUFFIX}/libvolk_gnsssdr${CMAKE_STATIC_LIBRARY_SUFFIX}" INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" INTERFACE_INCLUDE_DIRECTORIES "${VOLK_GNSSSDR_INCLUDE_DIRS}" INTERFACE_LINK_LIBRARIES "${VOLK_GNSSSDR_LIBRARIES}" @@ -1335,7 +1342,7 @@ if(NOT VOLKGNSSSDR_FOUND) if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH) if(NOT CPUFEATURES_FOUND AND ENABLE_CPUFEATURES) set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -1343,19 +1350,19 @@ if(NOT VOLKGNSSSDR_FOUND) if(CMAKE_VERSION VERSION_LESS 3.2) add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + COMMAND ${CMAKE_COMMAND} -E copy ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile ) else() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile + COMMAND ${CMAKE_COMMAND} -E copy ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr_profile ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile BYPRODUCTS ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr_profile ) endif() add_custom_command(TARGET volk_gnsssdr_module POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info + COMMAND ${CMAKE_COMMAND} -E copy ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info ${LOCAL_INSTALL_BASE_DIR}/install/volk_gnsssdr-config-info ) @@ -1372,9 +1379,18 @@ endif() # gflags - https://github.com/gflags/gflags ################################################################################ set(LOCAL_GFLAGS FALSE) -if(NOT ENABLE_OWN_GLOG) +if(ENABLE_OWN_GLOG) + unset(Glog::glog CACHE) + unset(GLOG_FOUND CACHE) + unset(Gflags::gflags CACHE) + unset(GLAGS_FOUND CACHE) + set(GFLAGS_GREATER_20 TRUE) +else() + unset(Glog::glog CACHE) + unset(GLOG_FOUND CACHE) find_package(GLOG) if(GLOG_FOUND) + unset(GFLAGS_GREATER_20 CACHE) find_package(GFLAGS) endif() endif() @@ -1392,7 +1408,7 @@ if(NOT GFLAGS_FOUND) message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded, built, and statically linked automatically") message(STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") set(GFLAGS_BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}" + "--build" "${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_GENERATOR STREQUAL Xcode) @@ -1404,11 +1420,11 @@ if(NOT GFLAGS_FOUND) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/gflags/gflags.git GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON @@ -1423,20 +1439,20 @@ if(NOT GFLAGS_FOUND) INSTALL_COMMAND "" ) else() - set(GFLAGS_BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GFLAGS_BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX}) if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR (CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator - set(GFLAGS_BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GFLAGS_BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX}) endif() if((CMAKE_VERSION VERSION_GREATER 3.12.0) AND NOT (CMAKE_GENERATOR STREQUAL Xcode)) set(PARALLEL_BUILD "--parallel 2") endif() ExternalProject_Add(gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/gflags/gflags.git GIT_TAG v${GNSSSDR_GFLAGS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gflags/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_gflags_LIB=ON @@ -1454,12 +1470,12 @@ if(NOT GFLAGS_FOUND) # Note: -DBUILD_gflags_nothreads_LIB=ON is required as a workaround to a bug in gflags 2.2.2. This is fixed in gflags master branch set(GFlags_INCLUDE_DIRS - ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" + ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/include CACHE PATH "Local Gflags headers" ) if(CMAKE_VERSION VERSION_LESS "3.0.2") set(GFlags_LIBS - ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() @@ -1475,24 +1491,24 @@ if(NOT GFLAGS_FOUND) MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_ASAN Debug - IMPORTED_LOCATION_NONE ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_NONE ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags_debug${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_INCLUDE_DIRECTORIES ${GFlags_INCLUDE_DIRS} - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) if(MSVC) set(MSVC_POSTFIX _static) endif() set_target_properties(Gflags::gflags PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}_debug${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}_debug${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/Release/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}gflags${MSVC_POSTFIX}$<$:_debug>${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -1540,11 +1556,11 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) set_property(TARGET gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION} PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}") string(REPLACE /include "" GFLAGS_PREFIX_PATH ${GFlags_INCLUDE_DIRS}) else() - set(GFLAGS_PREFIX_PATH ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) + set(GFLAGS_PREFIX_PATH ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) endif() set(TARGET_GFLAGS gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}) set(GLOG_MAKE_PROGRAM ${CMAKE_COMMAND} - "--build" "${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}" + "--build" "${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_GENERATOR STREQUAL Xcode) @@ -1561,7 +1577,7 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) set(GLOG_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}) set(GFLAGS_LIBRARIES_TO_LINK ${GFlags_LIBS}) if(${LOCAL_GFLAGS}) - set(GFLAGS_LIBRARY_DIR_TO_LINK ${CMAKE_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) + set(GFLAGS_LIBRARY_DIR_TO_LINK ${GNSSSDR_BINARY_DIR}/gflags-${GNSSSDR_GFLAGS_LOCAL_VERSION}/lib) else() set(GFLAGS_LIBRARY_DIR_TO_LINK ${GFlags_LIBRARY_DIRS}) endif() @@ -1577,7 +1593,7 @@ if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) set(GLOG_EXPORT_C_COMPILER "export CC=gcc") set(GLOG_EXPORT_CXX_COMPILER "export CXX=g++") endif() - file(WRITE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + file(WRITE ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags "#!/bin/sh export CPPFLAGS=-I${GFlags_INCLUDE_DIRS} export LDFLAGS=-L${GFLAGS_LIBRARY_DIR_TO_LINK} @@ -1585,21 +1601,21 @@ export LIBS=\"${GFLAGS_LIBRARIES_TO_LINK}\" ${GLOG_EXPORT_CXX_LIBRARIES} ${GLOG_EXPORT_C_COMPILER} ${GLOG_EXPORT_CXX_COMPILER} -cd ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/ +cd ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/ aclocal automake --add-missing autoreconf -vfi -cd ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} -${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure --enable-shared=no" +cd ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} +${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure --enable-shared=no" ) - file(COPY ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags - DESTINATION ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + file(COPY ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/tmp/configure_with_gflags + DESTINATION ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) - set(GLOG_CONFIGURE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) + set(GLOG_CONFIGURE ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure_with_gflags) # Ensure that aclocal and libtool are present if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") @@ -1651,11 +1667,11 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure endif() ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix= BUILD_COMMAND "${GLOG_MAKE_PROGRAM}" UPDATE_COMMAND "" @@ -1663,20 +1679,20 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure INSTALL_COMMAND "" ) set(GLOG_LIBRARIES - ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) set(GLOG_INCLUDE_DIRS - ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src ) else() # CMake > 3.0 but < 3.3 ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_PREFIX_PATH=${GFLAGS_PREFIX_PATH} @@ -1688,19 +1704,19 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure INSTALL_COMMAND "" ) set(GLOG_INCLUDE_DIRS - ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${GFlags_INCLUDE_DIRS} ) endif() else() # CMake > 3.3 set(GLOG_BUILD_BYPRODUCTS - ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR (CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator set(GLOG_BUILD_BYPRODUCTS - ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() if((CMAKE_VERSION VERSION_GREATER 3.12.0) AND NOT (CMAKE_GENERATOR STREQUAL Xcode) AND NOT CMAKE_CROSSCOMPILING) @@ -1711,11 +1727,11 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure endif() ExternalProject_Add(glog-${GNSSSDR_GLOG_LOCAL_VERSION} DEPENDS ${TARGET_GFLAGS} - PREFIX ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/glog/ GIT_TAG v${GNSSSDR_GLOG_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_PREFIX_PATH=${GFLAGS_PREFIX_PATH} ${GLOG_TOOLCHAIN_FILE} @@ -1730,8 +1746,8 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure INSTALL_COMMAND "" ) set(GLOG_INCLUDE_DIRS - ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src - ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} + ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src + ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION} ${GFlags_INCLUDE_DIRS} ) endif() @@ -1740,8 +1756,8 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure # Create Glog::glog target if(NOT TARGET Glog::glog) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/src) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}) add_library(Glog::glog STATIC IMPORTED) add_dependencies(Glog::glog glog-${GNSSSDR_GLOG_LOCAL_VERSION}) if(CMAKE_VERSION VERSION_LESS 3.0) @@ -1761,21 +1777,21 @@ ${CMAKE_BINARY_DIR}/thirdparty/glog/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/configure MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_ASAN Debug - IMPORTED_LOCATION_NONE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_NONE ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) set_target_properties(Glog::glog PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}glogd${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}glog${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${GNSSSDR_BINARY_DIR}/glog-${GNSSSDR_GLOG_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}glog$<$:d>${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -1886,7 +1902,15 @@ endif() ################################################################################ # Armadillo - http://arma.sourceforge.net/ ################################################################################ -find_package(Armadillo) +if(ENABLE_OWN_ARMADILLO) + unset(Armadillo::armadillo CACHE) + unset(ARMADILLO_FOUND CACHE) +else() + unset(Armadillo::armadillo CACHE) + unset(ARMADILLO_FOUND CACHE) + find_package(Armadillo) +endif() + set_package_properties(Armadillo PROPERTIES URL "http://arma.sourceforge.net/" PURPOSE "Used for matrix computations." @@ -1897,7 +1921,8 @@ if(ARMADILLO_FOUND) DESCRIPTION "C++ library for linear algebra and scientific computing (found: v${ARMADILLO_VERSION_STRING})" ) if(${ARMADILLO_VERSION_STRING} VERSION_LESS ${GNSSSDR_ARMADILLO_MIN_VERSION}) - set(ARMADILLO_FOUND FALSE) + unset(Armadillo::armadillo CACHE) + unset(ARMADILLO_FOUND CACHE) set(ENABLE_OWN_ARMADILLO ON) message(STATUS " Armadillo >= v${GNSSSDR_ARMADILLO_MIN_VERSION} has not been found.") else() @@ -1948,7 +1973,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) # Download and build Armadillo ############################################# set(ARMADILLO_BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE}" + "--build" "${GNSSSDR_BINARY_DIR}/armadillo-${armadillo_RELEASE}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_TOOLCHAIN_FILE) @@ -1967,13 +1992,15 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(armadillo-${armadillo_RELEASE} - PREFIX ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} + PREFIX ${GNSSSDR_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} - BINARY_DIR ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/armadillo-${armadillo_RELEASE} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF + -DBUILD_SMOKE_TEST=OFF + -DALLOW_BLAS_LAPACK_MACOS=ON ${ARMADILLO_CXX_VERSION} ${DARWIN_DISABLE_HDF5} ${ARMADILLO_TOOLCHAIN_FILE} @@ -1987,19 +2014,21 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) set(PARALLEL_BUILD "--parallel 2") endif() ExternalProject_Add(armadillo-${armadillo_RELEASE} - PREFIX ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} + PREFIX ${GNSSSDR_BINARY_DIR}/armadillo-${armadillo_RELEASE} GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG ${armadillo_BRANCH} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} - BINARY_DIR ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/armadillo-${armadillo_RELEASE} CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF + -DBUILD_SMOKE_TEST=OFF + -DALLOW_BLAS_LAPACK_MACOS=ON ${ARMADILLO_CXX_VERSION} ${DARWIN_DISABLE_HDF5} ${ARMADILLO_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> BUILD_COMMAND "${ARMADILLO_BUILD_COMMAND} ${PARALLEL_BUILD}" - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/armadillo-${armadillo_RELEASE}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX} UPDATE_COMMAND "" INSTALL_COMMAND "" ) @@ -2013,7 +2042,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) set(ARMADILLO_STATIC_LIBRARY ${binary_dir}/${CMAKE_FIND_LIBRARY_PREFIXES}armadillo${CMAKE_STATIC_LIBRARY_SUFFIX}) set(LOCAL_ARMADILLO TRUE CACHE STRING "Armadillo downloaded, built, and statically linked automatically" FORCE) set(ARMADILLO_VERSION_STRING ${armadillo_RELEASE}) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include) add_library(Armadillo::armadillo STATIC IMPORTED) add_dependencies(Armadillo::armadillo armadillo-${armadillo_RELEASE}) set_target_properties(Armadillo::armadillo PROPERTIES @@ -2029,7 +2058,7 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) IMPORTED_LOCATION_RELEASE ${ARMADILLO_STATIC_LIBRARY} IMPORTED_LOCATION_RELWITHDEBINFO ${ARMADILLO_STATIC_LIBRARY} IMPORTED_LOCATION_MINSIZEREL ${ARMADILLO_STATIC_LIBRARY} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include + INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/thirdparty/armadillo/armadillo-${armadillo_RELEASE}/include INTERFACE_LINK_LIBRARIES ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${GFORTRAN} ${ARMADILLO_STATIC_LIBRARY} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -2045,6 +2074,14 @@ if(NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO) DESCRIPTION "C++ library for linear algebra and scientific computing" PURPOSE "Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded, built, and statically linked when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." ) + # Fix for macOS + find_library(ARPACK_LIBRARY + NAMES arpack + PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} /opt/local/lib /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/local/lib64 + ) + if(ARPACK_LIBRARY) + target_link_libraries(Armadillo::armadillo INTERFACE ${ARPACK_LIBRARY}) + endif() endif() @@ -2300,30 +2337,30 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS endif() set(MATIO_MAKE_PROGRAM ${MATIO_MAKE_EXECUTABLE}) endif() - set(MATIO_STATIC_LIB ${CMAKE_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(MATIO_STATIC_LIB ${GNSSSDR_BINARY_DIR}/matio/lib/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX}) ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/matio + PREFIX ${GNSSSDR_BINARY_DIR}/matio GIT_REPOSITORY https://github.com/tbeu/matio GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + UPDATE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION}/configure --with-hdf5=${HDF5_BASE_DIR} --with-zlib=${ZLIB_BASE_DIR} --with-default-file-ver=7.3 --enable-mat73=yes --prefix= BUILD_COMMAND ${MATIO_MAKE_PROGRAM} ) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/matio/lib) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/matio/lib) else() # CMake >= 3.7 include(GNUInstallDirs) - set(MATIO_STATIC_LIB ${CMAKE_BINARY_DIR}/matio/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(MATIO_STATIC_LIB ${GNSSSDR_BINARY_DIR}/matio/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}matio${CMAKE_STATIC_LIBRARY_SUFFIX}) if("${HDF5_VERSION}" VERSION_GREATER "1.8.18" AND "${HDF5_VERSION}" VERSION_LESS "1.10.4") # weird workaround, but it works in all tested distros (Ubuntu, Debian, Fedora, CentOS, OpenSUSE) set(EXTRA_MATIO_BUILD_FLAGS -DMATIO_WITH_ZLIB=OFF -DHAVE_ZLIB=1) endif() ExternalProject_Add(matio-${GNSSSDR_MATIO_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/matio + PREFIX ${GNSSSDR_BINARY_DIR}/matio GIT_REPOSITORY https://github.com/tbeu/matio GIT_TAG v${GNSSSDR_MATIO_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/matio + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/matio/matio-${GNSSSDR_MATIO_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/matio CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> @@ -2332,23 +2369,23 @@ if(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_VERS -DHDF5_USE_STATIC_LIBRARIES=OFF -DMATIO_DEFAULT_FILE_VERSION:STRING=7.3 -DMATIO_MAT73=ON - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/matio + -DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/matio BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_BINARY_DIR}/matio" + "--build" "${GNSSSDR_BINARY_DIR}/matio" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> BUILD_BYPRODUCTS ${MATIO_STATIC_LIB} ) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/matio/${CMAKE_INSTALL_LIBDIR}) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/matio/${CMAKE_INSTALL_LIBDIR}) endif() if(NOT TARGET Matio::matio) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/matio/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/matio/include) add_library(Matio::matio STATIC IMPORTED) add_dependencies(Matio::matio matio-${GNSSSDR_MATIO_LOCAL_VERSION}) set_target_properties(Matio::matio PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_LOCATION ${MATIO_STATIC_LIB} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/matio/include + INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/matio/include INTERFACE_LINK_LIBRARIES "${MATIO_STATIC_LIB};${HDF5_LIBRARIES};${ZLIB_LIBRARIES}" ) endif() @@ -2371,7 +2408,7 @@ if(NOT PUGIXML_FOUND) if(DEFINED ENV{OECORE_TARGET_SYSROOT}) set(PUGIXML_COMPILER "") if(NOT CMAKE_TOOLCHAIN_FILE) - set(PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") + set(PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") else() set(PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") endif() @@ -2381,16 +2418,16 @@ if(NOT PUGIXML_FOUND) endif() endif() set(PUGIXML_BUILD_COMMAND ${CMAKE_COMMAND} - "--build" "${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}" + "--build" "${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} CMAKE_ARGS ${PUGIXML_COMPILER} ${PUGIXML_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> @@ -2404,26 +2441,26 @@ if(NOT PUGIXML_FOUND) set(PARALLEL_BUILD "--parallel 2") endif() ExternalProject_Add(pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} GIT_REPOSITORY https://github.com/zeux/pugixml GIT_TAG v${GNSSSDR_PUGIXML_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION} CMAKE_ARGS ${PUGIXML_COMPILER} ${PUGIXML_CMAKE_FLAGS} -DCMAKE_BUILD_TYPE=$<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> UPDATE_COMMAND "" PATCH_COMMAND "" BUILD_COMMAND "${PUGIXML_BUILD_COMMAND} ${PARALLEL_BUILD}" - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} INSTALL_COMMAND "" ) endif() - set(PUGIXML_LIBRARIES ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(PUGIXML_LIBRARIES ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) if(NOT TARGET Pugixml::pugixml) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) add_library(Pugixml::pugixml STATIC IMPORTED) add_dependencies(Pugixml::pugixml pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}) set_target_properties(Pugixml::pugixml PROPERTIES @@ -2439,16 +2476,16 @@ if(NOT PUGIXML_FOUND) IMPORTED_LOCATION_RELEASE ${PUGIXML_LIBRARIES} IMPORTED_LOCATION_RELWITHDEBINFO ${PUGIXML_LIBRARIES} IMPORTED_LOCATION_MINSIZEREL ${PUGIXML_LIBRARIES} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src + INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src INTERFACE_LINK_LIBRARIES ${PUGIXML_LIBRARIES} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) set_target_properties(Pugixml::pugixml PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/Release/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES ${GNSSSDR_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() endif() @@ -2554,19 +2591,19 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI if(CMAKE_CROSSCOMPILING) if(NOT Protobuf_FOUND) ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND "${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} --host=$ENV{OECORE_TARGET_ARCH} --with-protoc=${PROTOC_EXECUTABLE}" + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + UPDATE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND "${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} --host=$ENV{OECORE_TARGET_ARCH} --with-protoc=${PROTOC_EXECUTABLE}" BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} DESTDIR= install - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc ) - set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") + set(PROTOBUF_PROTOC_EXECUTABLE "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") endif() else() if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") @@ -2641,13 +2678,13 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + UPDATE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} DESTDIR= install ) @@ -2660,17 +2697,17 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI endif() endif() ExternalProject_Add(protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - PREFIX ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + PREFIX ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} GIT_REPOSITORY https://github.com/protocolbuffers/protobuf GIT_TAG v${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} - UPDATE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh - CONFIGURE_COMMAND ${CMAKE_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} + UPDATE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/autogen.sh + CONFIGURE_COMMAND ${GNSSSDR_BINARY_DIR}/thirdparty/protobuf/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/configure --prefix=${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION} BUILD_COMMAND ${PROTOBUF_MAKE_PROGRAM} ${PROTOBUF_PARALLEL_BUILD} INSTALL_COMMAND ${PROTOBUF_MAKE_PROGRAM} DESTDIR= install - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc ) endif() @@ -2679,23 +2716,23 @@ if((NOT Protobuf_FOUND) OR (NOT Protobuf_PROTOC_EXECUTABLE) OR (${Protobuf_VERSI add_dependencies(protobuf::protoc protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}) endif() unset(Protobuf_PROTOC_EXECUTABLE) - set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") + set(PROTOBUF_PROTOC_EXECUTABLE "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc") set_target_properties(protobuf::protoc PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" - INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protoc${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" + INTERFACE_LINK_LIBRARIES "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protoc${CMAKE_STATIC_LIBRARY_SUFFIX}" ) endif() - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include) if(NOT TARGET protobuf::libprotobuf) add_library(protobuf::libprotobuf STATIC IMPORTED) add_dependencies(protobuf::libprotobuf protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}) endif() set_target_properties(protobuf::libprotobuf PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" - INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include" - INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" + INTERFACE_INCLUDE_DIRECTORIES "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/include" + INTERFACE_LINK_LIBRARIES "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}" ) if(CMAKE_VERSION VERSION_LESS 3.10) set(Protobuf_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE}) @@ -2768,7 +2805,7 @@ set_package_properties(MATHJAX2 PROPERTIES if(DOXYGEN_FOUND) message(STATUS "Doxygen found.") message(STATUS " You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'.") - message(STATUS " When done, point your browser to ${CMAKE_BINARY_DIR}/docs/html/index.html") + message(STATUS " When done, point your browser to ${GNSSSDR_BINARY_DIR}/docs/html/index.html") if(CMAKE_VERSION VERSION_LESS 3.9.6) if(DOXYGEN_DOT_FOUND) set(HAVE_DOT "YES") @@ -2786,8 +2823,8 @@ if(DOXYGEN_FOUND) set(HAVE_DOT "NO") endif() endif() - file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} top_srcdir) - file(TO_NATIVE_PATH ${CMAKE_BINARY_DIR} top_builddir) + file(TO_NATIVE_PATH ${GNSSSDR_SOURCE_DIR} top_srcdir) + file(TO_NATIVE_PATH ${GNSSSDR_BINARY_DIR} top_builddir) set(PDFMANUAL_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM}) if(PDFMANUAL_MAKE_PROGRAM MATCHES "ninja") find_program(PDFMANUAL_MAKE_EXECUTABLE make @@ -2813,39 +2850,39 @@ if(DOXYGEN_FOUND) else() set(GNSSSDR_USE_MATHJAX "NO") endif() - configure_file(${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile.in - ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile + configure_file(${GNSSSDR_SOURCE_DIR}/docs/doxygen/Doxyfile.in + ${GNSSSDR_BINARY_DIR}/docs/doxygen/Doxyfile @ONLY ) add_custom_target(doc - Doxygen::doxygen ${CMAKE_BINARY_DIR}/docs/doxygen/Doxyfile - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + Doxygen::doxygen ${GNSSSDR_BINARY_DIR}/docs/doxygen/Doxyfile + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR} COMMENT "Generating HTML documentation from source code with Doxygen..." VERBATIM ) if(PDFLATEX_COMPILER) - message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") + message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${GNSSSDR_BINARY_DIR}/docs/GNSS-SDR_manual.pdf") add_custom_target(pdfmanual COMMAND ${PDFMANUAL_MAKE_PROGRAM} - COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf + COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${GNSSSDR_BINARY_DIR}/docs/GNSS-SDR_manual.pdf COMMAND ${PDFMANUAL_MAKE_PROGRAM} clean DEPENDS doc - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/docs/latex + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR}/docs/latex COMMENT "Generating PDF manual with LaTeX and pdflatex..." VERBATIM ) endif() message(STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation.") if(CMAKE_VERSION VERSION_LESS 3.17) add_custom_target(doc-clean - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/html - COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/docs/latex - COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf + COMMAND ${CMAKE_COMMAND} -E remove_directory ${GNSSSDR_BINARY_DIR}/docs/html + COMMAND ${CMAKE_COMMAND} -E remove_directory ${GNSSSDR_BINARY_DIR}/docs/latex + COMMAND ${CMAKE_COMMAND} -E remove ${GNSSSDR_BINARY_DIR}/docs/GNSS-SDR_manual.pdf COMMENT "Cleaning documentation." VERBATIM ) else() add_custom_target(doc-clean - COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/docs/html - COMMAND ${CMAKE_COMMAND} -E rm -rf ${CMAKE_BINARY_DIR}/docs/latex - COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf + COMMAND ${CMAKE_COMMAND} -E rm -rf ${GNSSSDR_BINARY_DIR}/docs/html + COMMAND ${CMAKE_COMMAND} -E rm -rf ${GNSSSDR_BINARY_DIR}/docs/latex + COMMAND ${CMAKE_COMMAND} -E rm -f ${GNSSSDR_BINARY_DIR}/docs/GNSS-SDR_manual.pdf COMMENT "Cleaning documentation." VERBATIM ) endif() @@ -3334,13 +3371,13 @@ endif() # Create uninstall target ################################################################################ configure_file( - ${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in - ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake + ${GNSSSDR_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in + ${GNSSSDR_BINARY_DIR}/cmake_uninstall.cmake @ONLY ) add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cmake_uninstall.cmake + COMMAND ${CMAKE_COMMAND} -P ${GNSSSDR_BINARY_DIR}/cmake_uninstall.cmake ) @@ -3414,27 +3451,27 @@ if(CUDA_FOUND) message(STATUS "The CUDA compiler identification is ${CMAKE_CUDA_COMPILER_ID} ${CMAKE_CUDA_COMPILER_VERSION}. Standard: C++${CMAKE_CUDA_STANDARD}.") endif() message(STATUS "") -file(REMOVE ${CMAKE_BINARY_DIR}/features.log) -file(WRITE ${CMAKE_BINARY_DIR}/features.log "**********************************\n") -file(APPEND ${CMAKE_BINARY_DIR}/features.log "* BUILDING CONFIGURATION SUMMARY *\n") -file(APPEND ${CMAKE_BINARY_DIR}/features.log "**********************************\n\n") -file(APPEND ${CMAKE_BINARY_DIR}/features.log "GNSS-SDR version: ${VERSION}\n") +file(REMOVE ${GNSSSDR_BINARY_DIR}/features.log) +file(WRITE ${GNSSSDR_BINARY_DIR}/features.log "**********************************\n") +file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "* BUILDING CONFIGURATION SUMMARY *\n") +file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "**********************************\n\n") +file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "GNSS-SDR version: ${VERSION}\n") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|kFreeBSD|GNU") if(CMAKE_CROSSCOMPILING) - file(APPEND ${CMAKE_BINARY_DIR}/features.log "Cross-compiling on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}\n") + file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "Cross-compiling on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}\n") else() - file(APPEND ${CMAKE_BINARY_DIR}/features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}\n") + file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}\n") endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - file(APPEND ${CMAKE_BINARY_DIR}/features.log "Building on ${MACOS_DISTRIBUTION}\n") + file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "Building on ${MACOS_DISTRIBUTION}\n") endif() -file(APPEND ${CMAKE_BINARY_DIR}/features.log "CMake version: ${CMAKE_VERSION}\n") -file(APPEND ${CMAKE_BINARY_DIR}/features.log "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.\n") -file(APPEND ${CMAKE_BINARY_DIR}/features.log "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.\n\n") +file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "CMake version: ${CMAKE_VERSION}\n") +file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.\n") +file(APPEND ${GNSSSDR_BINARY_DIR}/features.log "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.\n\n") if(CMAKE_VERSION VERSION_LESS 3.4) feature_summary(WHAT ALL) - feature_summary(FILENAME ${CMAKE_BINARY_DIR}/features.log APPEND WHAT ALL) + feature_summary(FILENAME ${GNSSSDR_BINARY_DIR}/features.log APPEND WHAT ALL) else() feature_summary(WHAT REQUIRED_PACKAGES_FOUND @@ -3444,7 +3481,7 @@ else() ENABLED_FEATURES DISABLED_FEATURES ) - feature_summary(FILENAME ${CMAKE_BINARY_DIR}/features.log APPEND WHAT + feature_summary(FILENAME ${GNSSSDR_BINARY_DIR}/features.log APPEND WHAT REQUIRED_PACKAGES_FOUND REQUIRED_PACKAGES_NOT_FOUND OPTIONAL_PACKAGES_FOUND diff --git a/cmake/Modules/FindGNURADIO.cmake b/cmake/Modules/FindGNURADIO.cmake index 93e6082cd..3df296cc5 100644 --- a/cmake/Modules/FindGNURADIO.cmake +++ b/cmake/Modules/FindGNURADIO.cmake @@ -346,6 +346,8 @@ if(GNURADIO_VERSION VERSION_GREATER 3.8.99) if(GNURADIO_IIO_LIBRARIES) message(STATUS " * INCLUDES=${GNURADIO_IIO_INCLUDE_DIRS}") message(STATUS " * LIBS=${GNURADIO_IIO_LIBRARIES}") + else() + message(STATUS " * IIO GNU Radio Module not found.") endif() if(GNURADIO_IIO_LIBRARIES AND GNURADIO_IIO_INCLUDE_DIRS) set(GNURADIO_IIO_FOUND TRUE) diff --git a/cmake/Modules/FindLIBUNWIND.cmake b/cmake/Modules/FindLIBUNWIND.cmake index 610c54f34..f2c88b569 100644 --- a/cmake/Modules/FindLIBUNWIND.cmake +++ b/cmake/Modules/FindLIBUNWIND.cmake @@ -31,7 +31,7 @@ find_path(LIBUNWIND_INCLUDE_DIR find_library(LIBUNWIND_GENERIC_LIBRARY NAMES - libunwind.a + libunwind unwind HINTS /usr @@ -68,7 +68,7 @@ if(LIBUNWIND_INCLUDE_DIR) if(LIBUNWIND_ARCH) find_library(LIBUNWIND_SPECIFIC_LIBRARY NAMES - libunwind-${LIBUNWIND_ARCH}.a + libunwind-${LIBUNWIND_ARCH} "unwind-${LIBUNWIND_ARCH}" HINTS /usr @@ -113,13 +113,20 @@ if(LIBUNWIND_FOUND) endif() if(LIBUNWIND_FOUND AND NOT TARGET Libunwind::libunwind) - add_library(Libunwind::libunwind INTERFACE IMPORTED) - set_target_properties(Libunwind::libunwind PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" - IMPORTED_LOCATION "${LIBUNWIND_LIBRARIES}" - INTERFACE_INCLUDE_DIRECTORIES "${LIBUNWIND_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${LIBUNWIND_LIBRARIES}" - ) + if(LIBUNWIND_GENERIC_LIBRARY) + add_library(Libunwind::libunwind SHARED IMPORTED) + set_target_properties(Libunwind::libunwind PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" + IMPORTED_LOCATION "${LIBUNWIND_GENERIC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LIBUNWIND_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${LIBUNWIND_LIBRARIES}" + ) + else() + add_library(Libunwind::libunwind INTERFACE IMPORTED) + set_target_properties(Libunwind::libunwind PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LIBUNWIND_INCLUDE_DIR}" + ) + endif() endif() set_package_properties(LIBUNWIND PROPERTIES diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index d6ba51fc6..a06529e00 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -57,6 +57,9 @@ All notable changes to GNSS-SDR will be documented in this file. `-Wp,-D_GLIBCXX_ASSERTIONS` compiler option. This is added by default in some GNU/Linux distributions. - Fixed linking against libunwind when the glog library is built locally. +- The configuration options at building time `-DENABLE_OWN_GLOG`, + `-DENABLE_OWN_ARMADILLO`, and `-DENABLE_OWN_GNSSTK` can now be switched `ON` + and `OFF` without the need to start from an empty buiding folder. ### Improvements in Usability: @@ -74,6 +77,7 @@ All notable changes to GNSS-SDR will be documented in this file. manually set the bandwidth of the bandpass filter on the radio frontend. - The new configuration parameter `Channels_XX.RF_channel_ID` allows to specify the signal source per channel group. +- Allowed the CMake project to be a sub-project. See the definitions of concepts and metrics at https://gnss-sdr.org/design-forces/ diff --git a/src/algorithms/PVT/adapters/CMakeLists.txt b/src/algorithms/PVT/adapters/CMakeLists.txt index 57ab83031..3cf70fe95 100644 --- a/src/algorithms/PVT/adapters/CMakeLists.txt +++ b/src/algorithms/PVT/adapters/CMakeLists.txt @@ -29,7 +29,7 @@ target_link_libraries(pvt_adapters target_include_directories(pvt_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(USE_OLD_BOOST_MATH_COMMON_FACTOR) diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt index e59a38c7e..3cfae32f6 100644 --- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt @@ -40,7 +40,7 @@ endif() target_include_directories(pvt_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(USE_GENERIC_LAMBDAS) diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt index 9af6b61c2..8e2785144 100644 --- a/src/algorithms/PVT/libs/CMakeLists.txt +++ b/src/algorithms/PVT/libs/CMakeLists.txt @@ -4,9 +4,9 @@ # SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: BSD-3-Clause -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/docs/protobuf/monitor_pvt.proto) -protobuf_generate_cpp(PROTO_SRCS2 PROTO_HDRS2 ${CMAKE_SOURCE_DIR}/docs/protobuf/gps_ephemeris.proto) -protobuf_generate_cpp(PROTO_SRCS3 PROTO_HDRS3 ${CMAKE_SOURCE_DIR}/docs/protobuf/galileo_ephemeris.proto) +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${GNSSSDR_SOURCE_DIR}/docs/protobuf/monitor_pvt.proto) +protobuf_generate_cpp(PROTO_SRCS2 PROTO_HDRS2 ${GNSSSDR_SOURCE_DIR}/docs/protobuf/gps_ephemeris.proto) +protobuf_generate_cpp(PROTO_SRCS3 PROTO_HDRS3 ${GNSSSDR_SOURCE_DIR}/docs/protobuf/galileo_ephemeris.proto) set(PVT_LIB_SOURCES an_packet_printer.cc @@ -98,7 +98,7 @@ get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY) # for concurrent_queue.h target_include_directories(pvt_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/receiver ) # Do not apply clang-tidy fixes to protobuf generated headers diff --git a/src/algorithms/acquisition/adapters/CMakeLists.txt b/src/algorithms/acquisition/adapters/CMakeLists.txt index d0251383e..41cfe8a8a 100644 --- a/src/algorithms/acquisition/adapters/CMakeLists.txt +++ b/src/algorithms/acquisition/adapters/CMakeLists.txt @@ -129,7 +129,7 @@ endif() target_include_directories(acquisition_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt index 81429538f..9ecdf6cdb 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/acquisition/gnuradio_blocks/CMakeLists.txt @@ -72,7 +72,7 @@ target_link_libraries(acquisition_gr_blocks target_include_directories(acquisition_gr_blocks PRIVATE - ${CMAKE_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/receiver ) if(GNURADIO_USES_STD_POINTERS) @@ -97,7 +97,7 @@ if(ENABLE_OPENCL) target_link_libraries(acquisition_gr_blocks PUBLIC OpenCL::OpenCL) target_include_directories(acquisition_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/opencl + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/opencl ) endif() @@ -113,5 +113,5 @@ endif() set_property(TARGET acquisition_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ - $ + $ ) diff --git a/src/algorithms/channel/adapters/CMakeLists.txt b/src/algorithms/channel/adapters/CMakeLists.txt index d5bbea2af..7d9ddcf83 100644 --- a/src/algorithms/channel/adapters/CMakeLists.txt +++ b/src/algorithms/channel/adapters/CMakeLists.txt @@ -31,8 +31,8 @@ target_link_libraries(channel_adapters target_include_directories(channel_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/receiver ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/channel/libs/CMakeLists.txt b/src/algorithms/channel/libs/CMakeLists.txt index 1454d9d7c..90607d700 100644 --- a/src/algorithms/channel/libs/CMakeLists.txt +++ b/src/algorithms/channel/libs/CMakeLists.txt @@ -45,7 +45,7 @@ target_link_libraries(channel_libs target_include_directories(channel_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/receiver ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/conditioner/adapters/CMakeLists.txt b/src/algorithms/conditioner/adapters/CMakeLists.txt index cb4db5424..265965e67 100644 --- a/src/algorithms/conditioner/adapters/CMakeLists.txt +++ b/src/algorithms/conditioner/adapters/CMakeLists.txt @@ -52,7 +52,7 @@ endif() target_include_directories(conditioner_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt index aa736ab64..f3829b5ab 100644 --- a/src/algorithms/data_type_adapter/adapters/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/adapters/CMakeLists.txt @@ -44,7 +44,7 @@ endif() target_include_directories(data_type_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) target_link_libraries(data_type_adapters diff --git a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt index 56c821b01..a0e1f2ddc 100644 --- a/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/data_type_adapter/gnuradio_blocks/CMakeLists.txt @@ -46,7 +46,7 @@ target_link_libraries(data_type_gr_blocks target_include_directories(data_type_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt index a6a22a351..c652131ea 100644 --- a/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/input_filter/gnuradio_blocks/CMakeLists.txt @@ -65,7 +65,7 @@ endif() target_include_directories(input_filter_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/libs/CMakeLists.txt b/src/algorithms/libs/CMakeLists.txt index 693d17c43..e8f0d6366 100644 --- a/src/algorithms/libs/CMakeLists.txt +++ b/src/algorithms/libs/CMakeLists.txt @@ -94,7 +94,7 @@ endif() if(NOT has_span) target_include_directories(algorithms_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/gsl/include ) endif() @@ -164,7 +164,7 @@ endif() target_include_directories(algorithms_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) target_compile_definitions(algorithms_libs @@ -221,7 +221,7 @@ target_link_libraries(gnss_sdr_flags Gflags::gflags ) -if(${GFLAGS_GREATER_20}) +if(GFLAGS_GREATER_20 OR ${LOCAL_GFLAGS}) target_compile_definitions(gnss_sdr_flags PRIVATE -DGFLAGS_GREATER_2_0=1) endif() diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt index ea21b15d8..de55de80e 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/CMakeLists.txt @@ -491,8 +491,8 @@ endif() ######################################################################## configure_file( - ${CMAKE_SOURCE_DIR}/cmake/Modules/VolkGnsssdrConfig.cmake.in - ${CMAKE_BINARY_DIR}/cmake/Modules/VolkGnsssdrConfig.cmake + ${PROJECT_SOURCE_DIR}/cmake/Modules/VolkGnsssdrConfig.cmake.in + ${PROJECT_BINARY_DIR}/cmake/Modules/VolkGnsssdrConfig.cmake @ONLY ) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_aarch64_test.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_aarch64_test.cc index 42e672e9e..8d88e49d3 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_aarch64_test.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_aarch64_test.cc @@ -135,6 +135,20 @@ void DisableHardwareCapabilities() SetHardwareCapabilities(0, 0); } +TEST(CpuinfoAarch64Test, Aarch64FeaturesEnum) +{ + const char *last_name = GetAarch64FeaturesEnumName(AARCH64_LAST_); + EXPECT_STREQ(last_name, "unknown_feature"); + for (int i = static_cast(AARCH64_FP); i != static_cast(AARCH64_LAST_); ++i) + { + const auto feature = static_cast(i); + const char *name = GetAarch64FeaturesEnumName(feature); + ASSERT_FALSE(name == nullptr); + EXPECT_STRNE(name, ""); + EXPECT_STRNE(name, last_name); + } +} + TEST(CpuinfoAarch64Test, FromHardwareCap) { ResetHwcaps(); @@ -208,7 +222,7 @@ TEST(CpuinfoAarch64Test, FromHardwareCap2) TEST(CpuinfoAarch64Test, ARMCortexA53) { ResetHwcaps(); - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/proc/cpuinfo", R"(Processor : AArch64 Processor rev 3 (aarch64) processor : 0 diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_arm_test.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_arm_test.cc index 735f8e123..714def32a 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_arm_test.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_arm_test.cc @@ -10,6 +10,21 @@ namespace cpu_features { namespace { + +TEST(CpuinfoArmTest, ArmFeaturesEnum) +{ + const char* last_name = GetArmFeaturesEnumName(ARM_LAST_); + EXPECT_STREQ(last_name, "unknown_feature"); + for (int i = static_cast(ARM_SWP); i != static_cast(ARM_LAST_); ++i) + { + const auto feature = static_cast(i); + const char* name = GetArmFeaturesEnumName(feature); + ASSERT_FALSE(name == nullptr); + EXPECT_STRNE(name, ""); + EXPECT_STRNE(name, last_name); + } +} + TEST(CpuinfoArmTest, FromHardwareCap) { ResetHwcaps(); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_mips_test.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_mips_test.cc index 97ab41fda..bcad73616 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_mips_test.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_mips_test.cc @@ -12,6 +12,20 @@ namespace cpu_features { namespace { +TEST(CpuinfoMipsTest, MipsFeaturesEnum) +{ + const char* last_name = GetMipsFeaturesEnumName(MIPS_LAST_); + EXPECT_STREQ(last_name, "unknown_feature"); + for (int i = static_cast(MIPS_MSA); i != static_cast(MIPS_LAST_); ++i) + { + const auto feature = static_cast(i); + const char* name = GetMipsFeaturesEnumName(feature); + ASSERT_FALSE(name == nullptr); + EXPECT_STRNE(name, ""); + EXPECT_STRNE(name, last_name); + } +} + TEST(CpuinfoMipsTest, FromHardwareCapBoth) { ResetHwcaps(); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_ppc_test.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_ppc_test.cc index 78e556734..ac5615344 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_ppc_test.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_ppc_test.cc @@ -11,6 +11,20 @@ namespace cpu_features { namespace { +TEST(CpustringsPPCTest, PPCFeaturesEnum) +{ + const char* last_name = GetPPCFeaturesEnumName(PPC_LAST_); + EXPECT_STREQ(last_name, "unknown_feature"); + for (int i = static_cast(PPC_32); i != static_cast(PPC_LAST_); ++i) + { + const auto feature = static_cast(i); + const char* name = GetPPCFeaturesEnumName(feature); + ASSERT_FALSE(name == nullptr); + EXPECT_STRNE(name, ""); + EXPECT_STRNE(name, last_name); + } +} + TEST(CpustringsPPCTest, FromHardwareCap) { ResetHwcaps(); diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc index f12b2af2c..15f2e3217 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cpu_features/test/cpuinfo_x86_test.cc @@ -77,9 +77,9 @@ private: uint32_t xcr0_eax_; }; -static FakeCpu* g_fake_cpu_instance = nullptr; +static FakeCpu *g_fake_cpu_instance = nullptr; -static FakeCpu& cpu() +static FakeCpu &cpu() { assert(g_fake_cpu_instance != nullptr); return *g_fake_cpu_instance; @@ -93,7 +93,7 @@ extern "C" Leaf GetCpuidLeaf(uint32_t leaf_id, int ecx) extern "C" uint32_t GetXCR0Eax(void) { return cpu().GetXCR0Eax(); } #if defined(CPU_FEATURES_OS_MACOS) -extern "C" bool GetDarwinSysCtlByName(const char* name) +extern "C" bool GetDarwinSysCtlByName(const char *name) { return cpu().GetDarwinSysCtlByName(name); } @@ -124,6 +124,34 @@ protected: } }; +TEST_F(CpuidX86Test, X86MicroarchitectureEnum) +{ + const char *last_name = GetX86MicroarchitectureName(X86_MICROARCHITECTURE_LAST_); + EXPECT_STREQ(last_name, "unknown microarchitecture"); + for (int i = static_cast(X86_UNKNOWN); i != static_cast(X86_MICROARCHITECTURE_LAST_); ++i) + { + const auto micro = static_cast(i); + const char *name = GetX86MicroarchitectureName(micro); + ASSERT_FALSE(name == nullptr); + EXPECT_STRNE(name, ""); + EXPECT_STRNE(name, last_name); + } +} + +TEST_F(CpuidX86Test, X86FeaturesEnum) +{ + const char *last_name = GetX86FeaturesEnumName(X86_LAST_); + EXPECT_STREQ(last_name, "unknown_feature"); + for (int i = static_cast(X86_FPU); i != static_cast(X86_LAST_); ++i) + { + const auto feature = static_cast(i); + const char *name = GetX86FeaturesEnumName(feature); + ASSERT_FALSE(name == nullptr); + EXPECT_STRNE(name, ""); + EXPECT_STRNE(name, last_name); + } +} + TEST_F(CpuidX86Test, SandyBridge) { cpu().SetOsBackupsExtendedRegisters(true); @@ -835,7 +863,7 @@ TEST_F(CpuidX86Test, Nehalem) cpu().SetDarwinSysCtlByName("hw.optional.sse4_1"); cpu().SetDarwinSysCtlByName("hw.optional.sse4_2"); #elif defined(CPU_FEATURES_OS_FREEBSD) - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/var/run/dmesg.boot", R"( ---<>--- Copyright (c) 1992-2020 The FreeBSD Project. @@ -845,7 +873,7 @@ FreeBSD is a registered trademark of The FreeBSD Foundation. real memory = 2147418112 (2047 MB) )"); #elif defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/proc/cpuinfo", R"(processor : flags : fpu mmx sse sse2 pni ssse3 sse4_1 sse4_2 )"); @@ -915,7 +943,7 @@ TEST_F(CpuidX86Test, Atom) cpu().SetDarwinSysCtlByName("hw.optional.sse4_1"); cpu().SetDarwinSysCtlByName("hw.optional.sse4_2"); #elif defined(CPU_FEATURES_OS_FREEBSD) - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/var/run/dmesg.boot", R"( ---<>--- Copyright (c) 1992-2020 The FreeBSD Project. @@ -925,7 +953,7 @@ FreeBSD is a registered trademark of The FreeBSD Foundation. real memory = 2147418112 (2047 MB) )"); #elif defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/proc/cpuinfo", R"( flags : fpu mmx sse sse2 pni ssse3 sse4_1 sse4_2 )"); @@ -1038,7 +1066,7 @@ TEST_F(CpuidX86Test, P3) #elif defined(CPU_FEATURES_OS_MACOS) cpu().SetDarwinSysCtlByName("hw.optional.sse"); #elif defined(CPU_FEATURES_OS_FREEBSD) - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/var/run/dmesg.boot", R"( ---<>--- Copyright (c) 1992-2020 The FreeBSD Project. @@ -1047,7 +1075,7 @@ FreeBSD is a registered trademark of The FreeBSD Foundation. real memory = 2147418112 (2047 MB) )"); #elif defined(CPU_FEATURES_OS_LINUX) || defined(CPU_FEATURES_OS_ANDROID) - auto& fs = GetEmptyFilesystem(); + auto &fs = GetEmptyFilesystem(); fs.CreateFile("/proc/cpuinfo", R"( flags : fpu mmx sse )"); diff --git a/src/algorithms/observables/adapters/CMakeLists.txt b/src/algorithms/observables/adapters/CMakeLists.txt index e2b0ce826..a4097a4dd 100644 --- a/src/algorithms/observables/adapters/CMakeLists.txt +++ b/src/algorithms/observables/adapters/CMakeLists.txt @@ -20,7 +20,7 @@ endif() target_include_directories(obs_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) target_link_libraries(obs_adapters diff --git a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt index 3a27a58d4..7f6537ccf 100644 --- a/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/observables/gnuradio_blocks/CMakeLists.txt @@ -20,7 +20,7 @@ endif() target_include_directories(obs_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs ) target_link_libraries(obs_gr_blocks @@ -47,7 +47,7 @@ endif() target_include_directories(obs_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/resampler/adapters/CMakeLists.txt b/src/algorithms/resampler/adapters/CMakeLists.txt index 1a0cc1e24..ac4eca082 100644 --- a/src/algorithms/resampler/adapters/CMakeLists.txt +++ b/src/algorithms/resampler/adapters/CMakeLists.txt @@ -45,7 +45,7 @@ target_link_libraries(resampler_adapters target_include_directories(resampler_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(GNURADIO_IS_38_OR_GREATER) diff --git a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt index 0a27cf6d8..ae521eeb9 100644 --- a/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/resampler/gnuradio_blocks/CMakeLists.txt @@ -60,7 +60,7 @@ endif() target_include_directories(resampler_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/signal_generator/adapters/CMakeLists.txt b/src/algorithms/signal_generator/adapters/CMakeLists.txt index aa3d3d9fc..e8486b326 100644 --- a/src/algorithms/signal_generator/adapters/CMakeLists.txt +++ b/src/algorithms/signal_generator/adapters/CMakeLists.txt @@ -34,8 +34,8 @@ target_link_libraries(signal_generator_adapters target_include_directories(signal_generator_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/receiver ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt index 1551b9eeb..d62f34cbd 100644 --- a/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_generator/gnuradio_blocks/CMakeLists.txt @@ -38,7 +38,7 @@ endif() target_include_directories(signal_generator_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) # Workaround for CentOS 7 diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 7a4c6e065..227b11dcd 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -146,7 +146,7 @@ endif() target_include_directories(signal_source_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_FPGA OR ENABLE_AD9361) diff --git a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt index 96fa168c2..7b550b2d6 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt @@ -72,7 +72,7 @@ target_link_libraries(signal_source_gr_blocks target_include_directories(signal_source_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/receiver ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 9d57575e6..34cb13e88 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -69,9 +69,9 @@ target_link_libraries(signal_source_libs target_include_directories(signal_source_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/receiver - ${CMAKE_SOURCE_DIR}/src/core/interfaces - ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GNSSSDR_SOURCE_DIR}/src/core/receiver + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs ) if(GNURADIO_USES_STD_POINTERS) diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index a374f25d0..9c0ae28ee 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -66,7 +66,7 @@ target_link_libraries(telemetry_decoder_adapters target_include_directories(telemetry_decoder_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt index 7506f1fb8..d6bed4f97 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/CMakeLists.txt @@ -79,12 +79,12 @@ endif() target_include_directories(telemetry_decoder_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) target_include_directories(telemetry_decoder_gr_blocks PRIVATE - ${CMAKE_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique.h + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique.h ) if(has_rotl) diff --git a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt index 4bf84f6d7..befb48ddf 100644 --- a/src/algorithms/telemetry_decoder/libs/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/libs/CMakeLists.txt @@ -54,7 +54,7 @@ target_link_libraries(telemetry_decoder_libs target_include_directories(telemetry_decoder_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CLANG_TIDY) diff --git a/src/algorithms/tracking/adapters/CMakeLists.txt b/src/algorithms/tracking/adapters/CMakeLists.txt index b4110e1c0..863fcba8e 100644 --- a/src/algorithms/tracking/adapters/CMakeLists.txt +++ b/src/algorithms/tracking/adapters/CMakeLists.txt @@ -105,7 +105,7 @@ target_link_libraries(tracking_adapters target_include_directories(tracking_adapters PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_FPGA) diff --git a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt index e397f6c40..eae1f6c8d 100644 --- a/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt +++ b/src/algorithms/tracking/gnuradio_blocks/CMakeLists.txt @@ -96,7 +96,7 @@ endif() target_include_directories(tracking_gr_blocks PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CUDA) diff --git a/src/algorithms/tracking/libs/CMakeLists.txt b/src/algorithms/tracking/libs/CMakeLists.txt index b8e80cd37..5b9520c0a 100644 --- a/src/algorithms/tracking/libs/CMakeLists.txt +++ b/src/algorithms/tracking/libs/CMakeLists.txt @@ -144,7 +144,7 @@ endif() target_include_directories(tracking_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(ENABLE_CLANG_TIDY) diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt index 7b4a271cb..994501ecf 100644 --- a/src/core/libs/CMakeLists.txt +++ b/src/core/libs/CMakeLists.txt @@ -4,7 +4,7 @@ # SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: BSD-3-Clause -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/docs/protobuf/nav_message.proto) +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${GNSSSDR_SOURCE_DIR}/docs/protobuf/nav_message.proto) add_subdirectory(supl) @@ -114,7 +114,7 @@ endif() target_include_directories(core_libs PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces ) if(USE_GENERIC_LAMBDAS) @@ -172,5 +172,5 @@ endif() set_property(TARGET core_libs APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $ - $ + $ ) diff --git a/src/core/monitor/CMakeLists.txt b/src/core/monitor/CMakeLists.txt index fe8743c05..4f6211a40 100644 --- a/src/core/monitor/CMakeLists.txt +++ b/src/core/monitor/CMakeLists.txt @@ -5,7 +5,7 @@ # SPDX-License-Identifier: BSD-3-Clause -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/docs/protobuf/gnss_synchro.proto) +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${GNSSSDR_SOURCE_DIR}/docs/protobuf/gnss_synchro.proto) set(CORE_MONITOR_LIBS_SOURCES gnss_synchro_monitor.cc @@ -56,9 +56,9 @@ get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY) target_include_directories(core_monitor PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces PRIVATE - ${CMAKE_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique ) # Do not apply clang-tidy fixes to protobuf generated headers diff --git a/src/core/receiver/CMakeLists.txt b/src/core/receiver/CMakeLists.txt index b2eacfcfd..65b1a2072 100644 --- a/src/core/receiver/CMakeLists.txt +++ b/src/core/receiver/CMakeLists.txt @@ -29,14 +29,14 @@ list(SORT GNSS_RECEIVER_HEADERS) list(SORT GNSS_RECEIVER_SOURCES) set(GNSS_RECEIVER_INTERFACE_HEADERS - ${CMAKE_SOURCE_DIR}/src/core/interfaces/acquisition_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/channel_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/configuration_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/gnss_block_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/observables_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/pvt_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/telemetry_decoder_interface.h - ${CMAKE_SOURCE_DIR}/src/core/interfaces/tracking_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/acquisition_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/channel_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/configuration_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/gnss_block_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/observables_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/pvt_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/telemetry_decoder_interface.h + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces/tracking_interface.h ) list(SORT GNSS_RECEIVER_INTERFACE_HEADERS) @@ -252,6 +252,6 @@ if(ENABLE_CLANG_TIDY) endif() set_property(TARGET core_receiver APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $ - $ + $ + $ ) diff --git a/src/core/system_parameters/CMakeLists.txt b/src/core/system_parameters/CMakeLists.txt index 49d8fdb80..3e25387ed 100644 --- a/src/core/system_parameters/CMakeLists.txt +++ b/src/core/system_parameters/CMakeLists.txt @@ -122,7 +122,7 @@ target_link_libraries(core_system_parameters # for gnss_sdr_make_unique.h target_include_directories(core_system_parameters PUBLIC - ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs ) if(ENABLE_CLANG_TIDY) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 67520f45b..2895d5973 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -84,23 +84,23 @@ install(TARGETS gnss-sdr COMPONENT "gnss-sdr" ) -install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf +install(DIRECTORY ${GNSSSDR_SOURCE_DIR}/conf DESTINATION share/gnss-sdr FILES_MATCHING PATTERN "*.conf" ) -install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf +install(FILES ${GNSSSDR_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf RENAME default.conf ) if(NOT VOLKGNSSSDR_FOUND) - install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile + install(PROGRAMS ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile DESTINATION bin COMPONENT "volk_gnsssdr" ) - install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info + install(PROGRAMS ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info DESTINATION bin COMPONENT "volk_gnsssdr" ) @@ -116,40 +116,40 @@ find_program(GZIP ) if(NOT GZIP_NOTFOUND) - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz" + execute_process(COMMAND gzip -9 -c ${GNSSSDR_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR} + OUTPUT_FILE "${GNSSSDR_BINARY_DIR}/gnss-sdr.1.gz" ) - install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz + install(FILES ${GNSSSDR_BINARY_DIR}/gnss-sdr.1.gz DESTINATION share/man/man1 ) - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/CHANGELOG.md - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz" + execute_process(COMMAND gzip -9 -c ${GNSSSDR_SOURCE_DIR}/docs/CHANGELOG.md + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR} + OUTPUT_FILE "${GNSSSDR_BINARY_DIR}/changelog.gz" ) - install(FILES ${CMAKE_BINARY_DIR}/changelog.gz + install(FILES ${GNSSSDR_BINARY_DIR}/changelog.gz DESTINATION share/doc/gnss-sdr ) if(NOT VOLKGNSSSDR_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" + execute_process(COMMAND gzip -9 -c ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR} + OUTPUT_FILE "${GNSSSDR_BINARY_DIR}/volk_gnsssdr_profile.1.gz" ) - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz" + execute_process(COMMAND gzip -9 -c ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR} + OUTPUT_FILE "${GNSSSDR_BINARY_DIR}/volk_gnsssdr-config-info.1.gz" ) - install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz + install(FILES ${GNSSSDR_BINARY_DIR}/volk_gnsssdr_profile.1.gz DESTINATION share/man/man1 ) - install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz + install(FILES ${GNSSSDR_BINARY_DIR}/volk_gnsssdr-config-info.1.gz DESTINATION share/man/man1 ) endif() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 1ec9e49a6..098f41cd2 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -15,7 +15,7 @@ set(GTEST_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER set(TOOLCHAIN_ARG "") if(DEFINED ENV{OECORE_TARGET_SYSROOT}) set(GTEST_COMPILER "") - set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") + set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") else() if(CMAKE_TOOLCHAIN_FILE) set(TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") @@ -27,7 +27,7 @@ endif() if(NOT GOOGLETEST_FOUND) set(GTEST_BUILD_COMMAND "${CMAKE_COMMAND}" - "--build" "${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}" + "--build" "${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) if(CMAKE_VERSION VERSION_GREATER 3.12 AND NOT CMAKE_CROSSCOMPILING) @@ -52,8 +52,8 @@ if(NOT GOOGLETEST_FOUND) ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest GIT_TAG ${GOOGLETEST_GIT_TAG} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF @@ -67,22 +67,22 @@ if(NOT GOOGLETEST_FOUND) ) else() set(GOOGLETEST_BUILD_BYPRODUCTS - ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL NoOptWithASM) OR (CMAKE_BUILD_TYPE STREQUAL Coverage) OR (CMAKE_BUILD_TYPE STREQUAL ASAN)) # Workaround for Ninja generator set(GOOGLETEST_BUILD_BYPRODUCTS - ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX} - ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX} + ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${DEBUG_DECORATION}${CMAKE_STATIC_LIBRARY_SUFFIX} ) endif() ExternalProject_Add(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/googletest GIT_TAG ${GOOGLETEST_GIT_TAG} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gtest-${GNSSSDR_GTEST_LOCAL_VERSION} CMAKE_ARGS ${GTEST_COMPILER} -DINSTALL_GTEST=OFF -DBUILD_GMOCK=OFF @@ -99,7 +99,7 @@ if(NOT GOOGLETEST_FOUND) ExternalProject_Get_Property(gtest-${GNSSSDR_GTEST_LOCAL_VERSION} binary_dir) if(NOT TARGET GTest::GTest) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include) add_library(GTest::GTest STATIC IMPORTED) add_dependencies(GTest::GTest gtest-${GNSSSDR_GTEST_LOCAL_VERSION}) set_target_properties(GTest::GTest PROPERTIES @@ -115,7 +115,7 @@ if(NOT GOOGLETEST_FOUND) IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include + INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/gtest$<$:${DEBUG_DECORATION}>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -147,7 +147,7 @@ if(NOT GOOGLETEST_FOUND) IMPORTED_LOCATION_RELEASE ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_RELWITHDEBINFO ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} IMPORTED_LOCATION_MINSIZEREL ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include + INTERFACE_INCLUDE_DIRECTORIES ${GNSSSDR_BINARY_DIR}/thirdparty/gtest/gtest-${GNSSSDR_GTEST_LOCAL_VERSION}/googletest/include INTERFACE_LINK_LIBRARIES ${binary_dir}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gtest_main$<$:${DEBUG_DECORATION}>${CMAKE_STATIC_LIBRARY_SUFFIX} ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) @@ -315,8 +315,8 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ExternalProject_Add(gnss-sim GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator GIT_TAG ${GNSSSDR_GNSS_SIM_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim - BINARY_DIR ${CMAKE_BINARY_DIR}/gnss-sim + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnss-sim CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} ${CROSS_INSTALL_DIR} ${TOOLCHAIN_ARG_GNSS_SIM} BUILD_COMMAND ${GNSS_SIM_BUILD_COMMAND} UPDATE_COMMAND "" @@ -324,21 +324,21 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) INSTALL_COMMAND "" ) if(ENABLE_INSTALL_TESTS) - install(PROGRAMS ${CMAKE_BINARY_DIR}/gnss-sim/gnss_sim DESTINATION bin) - install(FILES ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) - install(FILES ${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) + install(PROGRAMS ${GNSSSDR_BINARY_DIR}/gnss-sim/gnss_sim DESTINATION bin) + install(FILES ${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n DESTINATION share/gnss-sim) + install(FILES ${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim/circle.csv DESTINATION share/gnss-sim) set(SW_GENERATOR_BIN ${CMAKE_INSTALL_PREFIX}/bin/gnss_sim) add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") else() - set(SW_GENERATOR_BIN ${CMAKE_BINARY_DIR}/gnss-sim/gnss_sim) + set(SW_GENERATOR_BIN ${GNSSSDR_BINARY_DIR}/gnss-sim/gnss_sim) if(CMAKE_GENERATOR STREQUAL Xcode) - set(SW_GENERATOR_BIN ${CMAKE_BINARY_DIR}/gnss-sim/${CMAKE_BUILD_TYPE}/gnss_sim) + set(SW_GENERATOR_BIN ${GNSSSDR_BINARY_DIR}/gnss-sim/${CMAKE_BUILD_TYPE}/gnss_sim) endif() add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") - add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n") - add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_BINARY_DIR}/thirdparty/gnss-sim/circle.csv") + add_definitions(-DDEFAULT_RINEX_NAV="${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim/brdc3540.14n") + add_definitions(-DDEFAULT_POSITION_FILE="${GNSSSDR_BINARY_DIR}/thirdparty/gnss-sim/circle.csv") endif() endif() @@ -363,22 +363,22 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) message(FATAL_ERROR "The patch command is not found. It is required to build GNSSTk. Please check your OS documentation and install the patch command.") endif() set(GNSSTK_PATCH_COMMAND - cd ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} && - ${Patch_EXECUTABLE} ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${CMAKE_SOURCE_DIR}/src/tests/data/gnsstk_static13.patch + cd ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} && + ${Patch_EXECUTABLE} ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt < ${GNSSSDR_SOURCE_DIR}/src/tests/data/gnsstk_static13.patch ) # Patch only once - if(EXISTS ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt) + if(EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/CMakeLists.txt) set(GNSSTK_PATCH_COMMAND "") endif() if(CMAKE_VERSION VERSION_LESS 3.2) ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/gnsstk GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} PATCH_COMMAND ${GNSSTK_PATCH_COMMAND} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install + -DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install -DBUILD_EXT=ON -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} @@ -401,11 +401,11 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) ExternalProject_Add(gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/SGL-UT/gnsstk GIT_TAG v${GNSSSDR_GNSSTK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} - BINARY_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} + BINARY_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION} PATCH_COMMAND ${GNSSTK_PATCH_COMMAND} CMAKE_ARGS ${GTEST_COMPILER} ${TOOLCHAIN_ARG} - -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install + -DCMAKE_INSTALL_PREFIX=${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install -DBUILD_EXT=ON -DBUILD_PYTHON=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} @@ -414,13 +414,13 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA) -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=ON BUILD_COMMAND ${GNSSTK_BUILD_COMMAND} ${GNSSTK_PARALLEL_BUILD} - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX} UPDATE_COMMAND "" ) endif() - set(GNSSTK_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GNSSTK headers") - set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(GNSSTK_BINDIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/bin/) + set(GNSSTK_INCLUDE_DIRS ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include CACHE PATH "Local GNSSTK headers") + set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GNSSTK_BINDIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/bin/) add_definitions(-DGNSSTK_BINDIR="${GNSSTK_BINDIR}") add_library(Gnsstk::gnsstk STATIC IMPORTED) add_dependencies(Gnsstk::gnsstk gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}) @@ -442,59 +442,59 @@ endif() if(ENABLE_UNIT_TESTING_EXTRA) add_definitions(-DEXTRA_TESTS) message(STATUS "Downloading some data files for testing...") - if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) + if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat) message(STATUS "Downloading file: gps_l2c_m_prn7_5msps.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/gps_l2c_m_prn7_5msps.dat ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat SHOW_PROGRESS EXPECTED_HASH MD5=a6fcbefe155137945d3c33c5ef7bd0f9 ) endif() - if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) + if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat) message(STATUS "Downloading file: Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=ffb72fc63c116be58d5e5ccb1daaed3a ) endif() - if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat) + if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat) message(STATUS "Downloading file: BdsB1IStr01_fs25e6_if0_4ms.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB1IStr01_fs25e6_if0_4ms.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB1IStr01_fs25e6_if0_4ms.dat ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=5a4336dad9d80f3313a16dec4fff9233 ) endif() - if(NOT EXISTS ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat) + if(NOT EXISTS ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat) message(STATUS "Downloading file: BdsB3IStr01_fs50e6_if0_4ms.dat") - file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB3IStr01_fs50e6_if0_4ms.dat ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat + file(DOWNLOAD https://sourceforge.net/projects/gnss-sdr/files/data/BdsB3IStr01_fs50e6_if0_4ms.dat ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB3IStr01_fs50e6_if0_4ms.dat SHOW_PROGRESS EXPECTED_HASH MD5=066d0d8434a8bc81e161778b7c34cc07 ) endif() message(STATUS "Done.") if(ENABLE_INSTALL_TESTS) - install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/gps_l2c_m_prn7_5msps.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/Glonass_L1_CA_SIM_Fs_62Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples/BdsB1IStr01_fs25e6_if0_4ms.dat DESTINATION share/gnss-sdr/signal_samples) endif() endif() if(ENABLE_INSTALL_TESTS) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION share/gnss-sdr/signal_samples) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) - install(FILES ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) + install(FILES ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION share/gnss-sdr/signal_samples) + install(FILES ${GNSSSDR_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) + install(FILES ${GNSSSDR_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION share/gnss-sdr/data/rtklib_test) add_definitions(-DTEST_PATH="${CMAKE_INSTALL_PREFIX}/share/gnss-sdr/") else() - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/signal_samples) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/data/rtklib_test) - file(COPY ${CMAKE_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${CMAKE_BINARY_DIR}/thirdparty/data/rtklib_test) - add_definitions(-DTEST_PATH="${CMAKE_BINARY_DIR}/thirdparty/") + file(COPY ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/GSoC_CTTC_capture_2012_07_26_4Msps_4ms.dat DESTINATION ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/Galileo_E1_ID_1_Fs_4Msps_8ms.dat DESTINATION ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/GPS_L1_CA_ID_1_Fs_4Msps_2ms.dat DESTINATION ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${GNSSSDR_SOURCE_DIR}/src/tests/signal_samples/NT1065_GLONASS_L1_20160831_fs6625e6_if0e3_4ms.bin DESTINATION ${GNSSSDR_BINARY_DIR}/thirdparty/signal_samples) + file(COPY ${GNSSSDR_SOURCE_DIR}/src/tests/data/rtklib_test/obs_test1.xml DESTINATION ${GNSSSDR_BINARY_DIR}/thirdparty/data/rtklib_test) + file(COPY ${GNSSSDR_SOURCE_DIR}/src/tests/data/rtklib_test/eph_GPS_L1CA_test1.xml DESTINATION ${GNSSSDR_BINARY_DIR}/thirdparty/data/rtklib_test) + add_definitions(-DTEST_PATH="${GNSSSDR_BINARY_DIR}/thirdparty/") endif() @@ -546,7 +546,7 @@ if(ENABLE_UNIT_TESTING) ) target_include_directories(run_tests INTERFACE - ${CMAKE_SOURCE_DIR}/src/tests/common-files + ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) if(GNURADIO_USES_STD_POINTERS) target_compile_definitions(run_tests @@ -690,7 +690,7 @@ if(ENABLE_FPGA) core_receiver ) target_include_directories(gps_l1_ca_dll_pll_tracking_test_fpga - INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files + INTERFACE ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) install(TARGETS gps_l1_ca_dll_pll_tracking_test_fpga RUNTIME DESTINATION bin @@ -724,7 +724,7 @@ function(add_system_test executable) endif() target_include_directories(${executable} PRIVATE ${OPT_INCLUDES_} - INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files + INTERFACE ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) target_link_libraries(${executable} PRIVATE ${OPT_LIBS_} algorithms_libs) if(GNURADIO_USES_STD_POINTERS) @@ -858,7 +858,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) target_include_directories(flowgraph_test PRIVATE - ${CMAKE_SOURCE_DIR}/src/algorithms/libs + ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs ) add_test(flowgraph_test flowgraph_test) @@ -908,8 +908,8 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ) target_include_directories(gnss_block_test - PRIVATE ${CMAKE_SOURCE_DIR}/src/algorithms/libs - INTERFACE ${CMAKE_SOURCE_DIR}/src/tests/common-files + PRIVATE ${GNSSSDR_SOURCE_DIR}/src/algorithms/libs + INTERFACE ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) if(ENABLE_FPGA) @@ -984,7 +984,7 @@ target_link_libraries(matio_test target_include_directories(matio_test INTERFACE - ${CMAKE_SOURCE_DIR}/src/tests/common-files + ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) add_test(matio_test matio_test) @@ -1027,7 +1027,7 @@ if(NOT ENABLE_PACKAGING AND NOT ENABLE_FPGA) ) target_include_directories(acq_test INTERFACE - ${CMAKE_SOURCE_DIR}/src/tests/common-files + ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) if(PMT_USES_BOOST_ANY) target_compile_definitions(acq_test diff --git a/src/tests/benchmarks/CMakeLists.txt b/src/tests/benchmarks/CMakeLists.txt index 0ac1456c4..3ef8a4eb3 100644 --- a/src/tests/benchmarks/CMakeLists.txt +++ b/src/tests/benchmarks/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT benchmark_FOUND) set(BENCHMARK_TOOLCHAIN_ARG "") if(DEFINED ENV{OECORE_TARGET_SYSROOT}) set(BENCHMARK_COMPILER "") - set(BENCHMARK_TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") + set(BENCHMARK_TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake") else() if(CMAKE_TOOLCHAIN_FILE) set(BENCHMARK_TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") @@ -22,7 +22,7 @@ if(NOT benchmark_FOUND) endif() endif() set(BENCHMARK_BUILD_COMMAND "${CMAKE_COMMAND}" - "--build" "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}" + "--build" "${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}" "--config" $<$:Debug>$<$:Release>$<$:RelWithDebInfo>$<$:MinSizeRel>$<$:Debug>$<$:Debug>$<$:RelWithDebInfo>$<$:RelWithDebInfo>$<$:Debug> ) @@ -33,8 +33,8 @@ if(NOT benchmark_FOUND) ExternalProject_Add(google-benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION} GIT_REPOSITORY https://github.com/google/benchmark GIT_TAG v${GNSSSDR_BENCHMARK_LOCAL_VERSION} - SOURCE_DIR ${CMAKE_BINARY_DIR}/thirdparty/benchmark - BINARY_DIR ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION} + SOURCE_DIR ${GNSSSDR_BINARY_DIR}/thirdparty/benchmark + BINARY_DIR ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION} CMAKE_ARGS ${BENCHMARK_COMPILER} -DBENCHMARK_ENABLE_TESTING=OFF -DBENCHMARK_USE_BUNDLED_GTEST=OFF @@ -43,13 +43,14 @@ if(NOT benchmark_FOUND) BUILD_COMMAND "${BENCHMARK_BUILD_COMMAND} ${BENCHMARK_PARALLEL_BUILD}" UPDATE_COMMAND "" PATCH_COMMAND "" - BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + BUILD_BYPRODUCTS ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} INSTALL_COMMAND "" ) add_library(benchmark::benchmark STATIC IMPORTED) add_dependencies(benchmark::benchmark google-benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/thirdparty/benchmark/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/thirdparty/benchmark/include) + file(MAKE_DIRECTORY ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/include) set_target_properties(benchmark::benchmark PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" IMPORTED_CONFIGURATIONS "None;Debug;Release;RelWithDebInfo;MinSizeRel" @@ -58,22 +59,22 @@ if(NOT benchmark_FOUND) MAP_IMPORTED_CONFIG_O2WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_O3WITHASM RelWithDebInfo MAP_IMPORTED_CONFIG_ASAN Debug - IMPORTED_LOCATION_NONE ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/thirdparty/benchmark/include" - INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX};${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION_NONE ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_INCLUDE_DIRECTORIES "${GNSSSDR_BINARY_DIR}/thirdparty/benchmark/include" + INTERFACE_LINK_LIBRARIES "${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX};${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}" ) if((CMAKE_GENERATOR STREQUAL Xcode) OR MSVC) set_target_properties(benchmark::benchmark PROPERTIES - IMPORTED_LOCATION_DEBUG ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELEASE ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/Release/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - IMPORTED_LOCATION_MINSIZEREL ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} - INTERFACE_LINK_LIBRARIES "${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}; - ${CMAKE_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION_DEBUG ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/Debug/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELEASE ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/Release/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_RELWITHDEBINFO ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/RelWithDebInfo/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + IMPORTED_LOCATION_MINSIZEREL ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/MinSizeRel/${CMAKE_FIND_LIBRARY_PREFIXES}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX} + INTERFACE_LINK_LIBRARIES "${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>benchmark${CMAKE_STATIC_LIBRARY_SUFFIX}; + ${GNSSSDR_BINARY_DIR}/benchmark-${GNSSSDR_BENCHMARK_LOCAL_VERSION}/src/$<$:Debug/>$<$:Release/>$<$:RelWithDebInfo/>$<$:MinSizeRel/>benchmark_main${CMAKE_STATIC_LIBRARY_SUFFIX}" ) endif() set_target_properties(benchmark::benchmark PROPERTIES diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt index f5da39a39..6740932fb 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt +++ b/src/tests/unit-tests/signal-processing-blocks/libs/CMakeLists.txt @@ -48,9 +48,9 @@ target_link_libraries(signal_processing_testing_lib target_include_directories(signal_processing_testing_lib PUBLIC - ${CMAKE_SOURCE_DIR}/src/core/interfaces + ${GNSSSDR_SOURCE_DIR}/src/core/interfaces INTERFACE - ${CMAKE_SOURCE_DIR}/src/tests/common-files + ${GNSSSDR_SOURCE_DIR}/src/tests/common-files ) if(GNURADIO_USES_SPDLOG) diff --git a/src/utils/front-end-cal/CMakeLists.txt b/src/utils/front-end-cal/CMakeLists.txt index 2fc93dad4..14e55ca99 100644 --- a/src/utils/front-end-cal/CMakeLists.txt +++ b/src/utils/front-end-cal/CMakeLists.txt @@ -134,8 +134,8 @@ find_program(GZIP gzip ) if(NOT GZIP_NOTFOUND) - execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz" + execute_process(COMMAND gzip -9 -c ${GNSSSDR_SOURCE_DIR}/docs/manpage/front-end-cal-manpage + WORKING_DIRECTORY ${GNSSSDR_BINARY_DIR} OUTPUT_FILE "${GNSSSDR_BINARY_DIR}/front-end-cal.1.gz" ) - install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1) + install(FILES ${GNSSSDR_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1) endif() diff --git a/src/utils/nav-listener/CMakeLists.txt b/src/utils/nav-listener/CMakeLists.txt index cedb4707e..048a862f4 100644 --- a/src/utils/nav-listener/CMakeLists.txt +++ b/src/utils/nav-listener/CMakeLists.txt @@ -4,11 +4,14 @@ # SPDX-FileCopyrightText: 2021 C. Fernandez-Prades cfernandez(at)cttc.es # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.9...3.21) +cmake_minimum_required(VERSION 3.9...3.23) project(nav-msg-listener CXX) set(CMAKE_CXX_STANDARD 11) +set(NAVLISTENER_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # allows this to be a sub-project +set(NAVLISTENER_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) + set(Boost_USE_STATIC_LIBS OFF) find_package(Boost COMPONENTS system REQUIRED) @@ -17,9 +20,9 @@ if(${Protobuf_VERSION} VERSION_LESS "3.0.0") message(FATAL_ERROR "Fatal error: Protocol Buffers >= v3.0.0 required.") endif() -protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${CMAKE_SOURCE_DIR}/nav_message.proto) +protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${NAVLISTENER_SOURCE_DIR}/nav_message.proto) -add_library(navmsg_lib ${CMAKE_SOURCE_DIR}/nav_msg_udp_listener.cc ${PROTO_SRCS}) +add_library(navmsg_lib ${NAVLISTENER_SOURCE_DIR}/nav_msg_udp_listener.cc ${PROTO_SRCS}) target_link_libraries(navmsg_lib PUBLIC @@ -30,9 +33,9 @@ target_link_libraries(navmsg_lib target_include_directories(navmsg_lib PUBLIC - ${CMAKE_BINARY_DIR} + ${NAVLISTENER_BINARY_DIR} ) -add_executable(nav_msg_listener ${CMAKE_SOURCE_DIR}/main.cc) +add_executable(nav_msg_listener ${NAVLISTENER_SOURCE_DIR}/main.cc) target_link_libraries(nav_msg_listener PUBLIC navmsg_lib) diff --git a/src/utils/rinex-tools/CMakeLists.txt b/src/utils/rinex-tools/CMakeLists.txt index 86a7fb078..7a3bdb598 100644 --- a/src/utils/rinex-tools/CMakeLists.txt +++ b/src/utils/rinex-tools/CMakeLists.txt @@ -13,11 +13,11 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK) include(GNUInstallDirs) if(GNSSTK_USES_GPSTK_NAMESPACE) - set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) + set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GNSSTK_INCLUDE_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) else() - set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) + set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GNSSTK_INCLUDE_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) endif() endif() @@ -33,7 +33,7 @@ if("${ARMADILLO_VERSION_STRING}" VERSION_GREATER "9.800" OR (NOT ARMADILLO_FOUND add_executable(obsdiff ${CMAKE_CURRENT_SOURCE_DIR}/obsdiff.cc obsdiff_flags.h) endif() - target_include_directories(obsdiff PUBLIC ${CMAKE_SOURCE_DIR}/src/tests/common-files) + target_include_directories(obsdiff PUBLIC ${GNSSSDR_SOURCE_DIR}/src/tests/common-files) set_property(TARGET obsdiff PROPERTY CXX_STANDARD 14) # Required by GPSTk v3.0.0 # Do not show warnings raised by GPSTk v3.0.0 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/src/utils/rinex2assist/CMakeLists.txt b/src/utils/rinex2assist/CMakeLists.txt index 1f83c829d..4f9e31b88 100644 --- a/src/utils/rinex2assist/CMakeLists.txt +++ b/src/utils/rinex2assist/CMakeLists.txt @@ -11,11 +11,11 @@ endif() if(NOT GNSSTK_FOUND OR ENABLE_OWN_GNSSTK) include(GNUInstallDirs) if(GNSSTK_USES_GPSTK_NAMESPACE) - set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) + set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gpstk${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GNSSTK_INCLUDE_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) else() - set(GNSSTK_LIBRARY ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}) - set(GNSSTK_INCLUDE_DIR ${CMAKE_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) + set(GNSSTK_LIBRARY ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}gnsstk${CMAKE_STATIC_LIBRARY_SUFFIX}) + set(GNSSTK_INCLUDE_DIR ${GNSSSDR_BINARY_DIR}/gnsstk-${GNSSSDR_GNSSTK_LOCAL_VERSION}/install/include) endif() endif()