1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-30 10:54:50 +00:00

Fix compilation with CMake 3.5

The CMake variables CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR should never be set. Now CMake 3.5 prevents the user from doing that. They have been replaced by their counterparts PROJECT_BINARY_DIR and PROJECT_SOURCE_DIR
This commit is contained in:
Carles Fernandez 2016-02-25 15:26:32 +01:00
parent 29a91e66bf
commit b24db5d77e
6 changed files with 61 additions and 61 deletions

View File

@ -32,8 +32,8 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF) option(ENABLE_STRIP "Create a stripped volk_gnsssdr_profile binary (without shared libraries)" OFF)
set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project set(PROJECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) #allows this to be a sub-project
set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project set(PROJECT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) #allows this to be a sub-project
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) #location for custom "Modules" list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) #location for custom "Modules"
include(VolkBuildTypes) include(VolkBuildTypes)
@ -119,13 +119,13 @@ endif(ENABLE_ORC)
find_package(Doxygen) find_package(Doxygen)
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/Doxyfile.in ${PROJECT_SOURCE_DIR}/Doxyfile.in
${CMAKE_BINARY_DIR}/Doxyfile ${PROJECT_BINARY_DIR}/Doxyfile
@ONLY) @ONLY)
add_custom_target(doc add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
COMMENT "Generating documentation with Doxygen" VERBATIM COMMENT "Generating documentation with Doxygen" VERBATIM
) )
endif(DOXYGEN_FOUND) endif(DOXYGEN_FOUND)
@ -159,22 +159,22 @@ set(VOLK_LIBRARY_DIR lib${LIB_SUFFIX})
set(VOLK_INCLUDE_DIR include) set(VOLK_INCLUDE_DIR include)
install( install(
DIRECTORY ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr DIRECTORY ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr
DESTINATION include COMPONENT "volk_gnsssdr_devel" DESTINATION include COMPONENT "volk_gnsssdr_devel"
FILES_MATCHING PATTERN "*.h" FILES_MATCHING PATTERN "*.h"
) )
install(FILES install(FILES
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_prefs.h ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_prefs.h
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_complex.h ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_complex.h
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_common.h ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_common.h
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_avx_intrinsics.h
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_sse3_intrinsics.h
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h
${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h
${CMAKE_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_malloc.h ${PROJECT_SOURCE_DIR}/include/volk_gnsssdr/volk_gnsssdr_malloc.h
DESTINATION include/volk_gnsssdr DESTINATION include/volk_gnsssdr
COMPONENT "volk_gnsssdr_devel" COMPONENT "volk_gnsssdr_devel"
) )
@ -205,7 +205,7 @@ endif(APPLE)
# Create uninstall target # Create uninstall target
######################################################################## ########################################################################
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in ${PROJECT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
@ONLY) @ONLY)
@ -226,8 +226,8 @@ endif()
######################################################################## ########################################################################
configure_file( configure_file(
${CMAKE_SOURCE_DIR}/cmake/Modules/VolkConfigVersion.cmake.in ${PROJECT_SOURCE_DIR}/cmake/Modules/VolkConfigVersion.cmake.in
${CMAKE_BINARY_DIR}/cmake/Modules/VolkConfigVersion.cmake ${PROJECT_BINARY_DIR}/cmake/Modules/VolkConfigVersion.cmake
@ONLY) @ONLY)

View File

@ -674,7 +674,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty. # tag is left empty.
LAYOUT_FILE = @CMAKE_SOURCE_DIR@/DoxygenLayout.xml LAYOUT_FILE = @PROJECT_SOURCE_DIR@/DoxygenLayout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing # The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib # the reference definitions. This must be a list of .bib files. The .bib
@ -756,7 +756,7 @@ WARN_LOGFILE =
# spaces. # spaces.
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = @CMAKE_SOURCE_DIR@ INPUT = @PROJECT_SOURCE_DIR@
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -832,7 +832,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is # Note that relative paths are relative to the directory from which doxygen is
# run. # run.
EXCLUDE = @CMAKE_BINARY_DIR@ EXCLUDE = @PROJECT_BINARY_DIR@
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded # directories that are symbolic links (a Unix file system feature) are excluded

View File

@ -21,16 +21,16 @@
# Setup profiler # Setup profiler
######################################################################## ########################################################################
if(MSVC) if(MSVC)
include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc) include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
endif(MSVC) endif(MSVC)
include_directories( include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include ${PROJECT_BINARY_DIR}/include
${CMAKE_SOURCE_DIR}/lib ${PROJECT_SOURCE_DIR}/lib
${CMAKE_BINARY_DIR}/lib ${PROJECT_BINARY_DIR}/lib
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )
@ -50,7 +50,7 @@ endif(ORC_FOUND)
# MAKE volk_gnsssdr_profile # MAKE volk_gnsssdr_profile
add_executable(volk_gnsssdr_profile add_executable(volk_gnsssdr_profile
${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_profile.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_gnsssdr_profile.cc
${CMAKE_SOURCE_DIR}/lib/qa_utils.cc ${PROJECT_SOURCE_DIR}/lib/qa_utils.cc
) )
if(ENABLE_STATIC_LIBS) if(ENABLE_STATIC_LIBS)

View File

@ -111,7 +111,7 @@ file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)
# Usage: VOLK_UNIQUE_TARGET(<description> <dependencies list>) # Usage: VOLK_UNIQUE_TARGET(<description> <dependencies list>)
######################################################################## ########################################################################
function(VOLK_UNIQUE_TARGET desc) function(VOLK_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}) file(RELATIVE_PATH reldir ${PROJECT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5] unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))" print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
@ -163,13 +163,13 @@ function(VOLK_PYTHON_INSTALL)
#the command to generate the pyc files #the command to generate the pyc files
add_custom_command( add_custom_command(
DEPENDS ${pysrcfiles} OUTPUT ${pycfiles} DEPENDS ${pysrcfiles} OUTPUT ${pycfiles}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles} COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pycfiles}
) )
#the command to generate the pyo files #the command to generate the pyo files
add_custom_command( add_custom_command(
DEPENDS ${pysrcfiles} OUTPUT ${pyofiles} DEPENDS ${pysrcfiles} OUTPUT ${pyofiles}
COMMAND ${PYTHON_EXECUTABLE} -O ${CMAKE_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles} COMMAND ${PYTHON_EXECUTABLE} -O ${PROJECT_BINARY_DIR}/python_compile_helper.py ${pysrcfiles} ${pyofiles}
) )
#create install rule and add generated files to target list #create install rule and add generated files to target list
@ -192,7 +192,7 @@ function(VOLK_PYTHON_INSTALL)
foreach(pyfile ${VOLK_PYTHON_INSTALL_PROGRAMS}) foreach(pyfile ${VOLK_PYTHON_INSTALL_PROGRAMS})
get_filename_component(pyfile_name ${pyfile} NAME) get_filename_component(pyfile_name ${pyfile} NAME)
get_filename_component(pyfile ${pyfile} ABSOLUTE) get_filename_component(pyfile ${pyfile} ABSOLUTE)
string(REPLACE "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" pyexefile "${pyfile}.exe") string(REPLACE "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" pyexefile "${pyfile}.exe")
list(APPEND python_install_gen_targets ${pyexefile}) list(APPEND python_install_gen_targets ${pyexefile})
get_filename_component(pyexefile_path ${pyexefile} PATH) get_filename_component(pyexefile_path ${pyexefile} PATH)
@ -227,7 +227,7 @@ endfunction(VOLK_PYTHON_INSTALL)
######################################################################## ########################################################################
# Write the python helper script that generates byte code files # Write the python helper script that generates byte code files
######################################################################## ########################################################################
file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py " file(WRITE ${PROJECT_BINARY_DIR}/python_compile_helper.py "
import sys, py_compile import sys, py_compile
files = sys.argv[1:] files = sys.argv[1:]
srcs, gens = files[:len(files)/2], files[len(files)/2:] srcs, gens = files[:len(files)/2], files[len(files)/2:]

View File

@ -32,12 +32,12 @@ set(MAINT_VERSION ${VERSION_INFO_MAINT_VERSION})
######################################################################## ########################################################################
find_package(Git) find_package(Git)
if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) if(GIT_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.git)
message(STATUS "Extracting version information from git describe...") message(STATUS "Extracting version information from git describe...")
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
) )
else() else()
if(NOT VOLK_GIT_COUNT) if(NOT VOLK_GIT_COUNT)

View File

@ -97,7 +97,7 @@ endif()
######################################################################## ########################################################################
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
--mode "arch_flags" --compiler "${COMPILER_NAME}" --mode "arch_flags" --compiler "${COMPILER_NAME}"
OUTPUT_VARIABLE arch_flag_lines OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE arch_flag_lines OUTPUT_STRIP_TRAILING_WHITESPACE
) )
@ -285,7 +285,7 @@ message(STATUS "Available architectures: ${available_archs}")
######################################################################## ########################################################################
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
--mode "machines" --archs "${available_archs}" --mode "machines" --archs "${available_archs}"
OUTPUT_VARIABLE available_machines OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE available_machines OUTPUT_STRIP_TRAILING_WHITESPACE
) )
@ -317,9 +317,9 @@ message(STATUS "Available machines: ${available_machines}")
######################################################################## ########################################################################
#dependencies are all python, xml, and header implementation files #dependencies are all python, xml, and header implementation files
file(GLOB xml_files ${CMAKE_SOURCE_DIR}/gen/*.xml) file(GLOB xml_files ${PROJECT_SOURCE_DIR}/gen/*.xml)
file(GLOB py_files ${CMAKE_SOURCE_DIR}/gen/*.py) file(GLOB py_files ${PROJECT_SOURCE_DIR}/gen/*.py)
file(GLOB h_files ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/*.h) file(GLOB h_files ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/*.h)
macro(gen_template tmpl output) macro(gen_template tmpl output)
list(APPEND volk_gnsssdr_gen_sources ${output}) list(APPEND volk_gnsssdr_gen_sources ${output})
@ -327,21 +327,21 @@ macro(gen_template tmpl output)
OUTPUT ${output} OUTPUT ${output}
DEPENDS ${xml_files} ${py_files} ${h_files} ${tmpl} DEPENDS ${xml_files} ${py_files} ${h_files} ${tmpl}
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_tmpl_utils.py
--input ${tmpl} --output ${output} ${ARGN} --input ${tmpl} --output ${output} ${ARGN}
) )
endmacro(gen_template) endmacro(gen_template)
make_directory(${CMAKE_BINARY_DIR}/include/volk_gnsssdr) make_directory(${PROJECT_BINARY_DIR}/include/volk_gnsssdr)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr.c) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr.c)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_typedefs.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_typedefs.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_typedefs.h)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_cpu.h)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr_cpu.c) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_cpu.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr_cpu.c)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_config_fixed.tmpl.h ${CMAKE_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_config_fixed.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr_config_fixed.h)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.h ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr_machines.h) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.h ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr_machines.h)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_gnsssdr_machines.c) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_machines.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr_machines.c)
set(BASE_CFLAGS NONE) set(BASE_CFLAGS NONE)
string(TOUPPER ${CMAKE_BUILD_TYPE} CBTU) string(TOUPPER ${CMAKE_BUILD_TYPE} CBTU)
@ -367,12 +367,12 @@ set(COMPILER_INFO "${CMAKE_C_COMPILER}:::${CMAKE_C_FLAGS_${GRCBTU}} ${CMAKE_C_FL
foreach(machine_name ${available_machines}) foreach(machine_name ${available_machines})
#generate machine source #generate machine source
set(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_machine_${machine_name}.c) set(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_machine_${machine_name}.c)
gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_gnsssdr_machine_xxx.tmpl.c ${machine_source} ${machine_name}) gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr_machine_xxx.tmpl.c ${machine_source} ${machine_name})
#determine machine flags #determine machine flags
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
${CMAKE_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py ${PROJECT_SOURCE_DIR}/gen/volk_gnsssdr_compile_utils.py
--mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}" --mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}"
OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE
) )
@ -398,9 +398,9 @@ string(REPLACE "\n" " \\n" COMPILER_INFO ${COMPILER_INFO})
# Set local include directories first # Set local include directories first
######################################################################## ########################################################################
include_directories( include_directories(
${CMAKE_BINARY_DIR}/include ${PROJECT_BINARY_DIR}/include
${CMAKE_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/kernels ${PROJECT_SOURCE_DIR}/kernels
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
) )
@ -425,8 +425,8 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.9")
# setup architecture specific assembler flags # setup architecture specific assembler flags
set(ARCH_ASM_FLAGS "-mfpu=neon -g") set(ARCH_ASM_FLAGS "-mfpu=neon -g")
# then add the files # then add the files
include_directories(${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon) include_directories(${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon)
file(GLOB asm_files ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon/*.s) file(GLOB asm_files ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/neon/*.s)
foreach(asm_file ${asm_files}) foreach(asm_file ${asm_files})
list(APPEND volk_gnsssdr_sources ${asm_file}) list(APPEND volk_gnsssdr_sources ${asm_file})
message(STATUS "Adding source file: ${asm_file}") message(STATUS "Adding source file: ${asm_file}")
@ -458,7 +458,7 @@ if(ORC_FOUND)
list(APPEND volk_gnsssdr_libraries ${ORC_LIBRARIES}) list(APPEND volk_gnsssdr_libraries ${ORC_LIBRARIES})
#setup orc functions #setup orc functions
file(GLOB orc_files ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc) file(GLOB orc_files ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc)
foreach(orc_file ${orc_files}) foreach(orc_file ${orc_files})
#extract the name for the generated c source from the orc file #extract the name for the generated c source from the orc file
@ -516,7 +516,7 @@ PROPERTIES COMPILE_DEFINITIONS "${machine_defs}")
if(MSVC) if(MSVC)
#add compatibility includes for stdint types #add compatibility includes for stdint types
include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc) include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
add_definitions(-DHAVE_CONFIG_H) add_definitions(-DHAVE_CONFIG_H)
#compile the sources as C++ due to the lack of complex.h under MSVC #compile the sources as C++ due to the lack of complex.h under MSVC
set_source_files_properties(${volk_gnsssdr_sources} PROPERTIES LANGUAGE CXX) set_source_files_properties(${volk_gnsssdr_sources} PROPERTIES LANGUAGE CXX)
@ -528,7 +528,7 @@ if(CMAKE_VERSION VERSION_GREATER "2.8.7")
add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources}) add_library(volk_gnsssdr_obj OBJECT ${volk_gnsssdr_sources})
#Add dynamic library #Add dynamic library
file(GLOB orc ${CMAKE_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc) file(GLOB orc ${PROJECT_SOURCE_DIR}/kernels/volk_gnsssdr/asm/orc/*.orc)
if(ENABLE_STATIC_LIBS) if(ENABLE_STATIC_LIBS)
add_library(volk_gnsssdr STATIC $<TARGET_OBJECTS:volk_gnsssdr_obj> ${orc}) add_library(volk_gnsssdr STATIC $<TARGET_OBJECTS:volk_gnsssdr_obj> ${orc})