fix build using cmake 3.5

upstream: https://github.com/gnuradio/volk/pull/65
This commit is contained in:
dbj 2016-03-19 23:40:25 +00:00
parent ae64d46248
commit 9b9c9681ec
3 changed files with 167 additions and 1 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.23 2016/03/07 13:14:31 mef Exp $
$NetBSD: distinfo,v 1.24 2016/03/19 23:40:25 dbj Exp $
SHA1 (gnuradio-3.7.9.1.tar.gz) = 6b9960ebed57610e52da2c23ef953674faefb849
RMD160 (gnuradio-3.7.9.1.tar.gz) = a058199b480db264d2ca6b8b87a7b18d2a876d62
@ -10,3 +10,5 @@ SHA1 (patch-gnuradio_runtime_lib_thread_thread_cc) = c05628aa88ac968928f9eabd8c5
SHA1 (patch-gr-audio_lib_CMakeLists.txt) = 00ff8c14658acd2d1dc8be18ea6a19ace8d12968
SHA1 (patch-gr-audio_lib_alsa_alsa__impl_h) = d61dcd31058c04a6050479a6e8c321ca15420d49
SHA1 (patch-grc_script_gnuradio-companion) = 15dde8f3a9e057061e56157533f8af1919240b93
SHA1 (patch-volk_apps_CMakeLists.txt) = 1523b725fdf83751bd6f8d73d62a8f8b9a618886
SHA1 (patch-volk_lib_CMakeLists.txt) = 67a1545e138d6472803caa1f601c7b430101b83f

View file

@ -0,0 +1,37 @@
$NetBSD: patch-volk_apps_CMakeLists.txt,v 1.1 2016/03/19 23:40:25 dbj Exp $
Fix compilation with cmake 3.5
upstream: https://github.com/gnuradio/volk/pull/65
--- volk/apps/CMakeLists.txt.orig 2016-02-07 17:09:12.000000000 +0000
+++ volk/apps/CMakeLists.txt
@@ -19,23 +19,23 @@
# Setup profiler
########################################################################
if(MSVC)
- include_directories(${CMAKE_SOURCE_DIR}/cmake/msvc)
+ include_directories(${PROJECT_SOURCE_DIR}/cmake/msvc)
endif(MSVC)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_BINARY_DIR}/include
- ${CMAKE_SOURCE_DIR}/lib
- ${CMAKE_BINARY_DIR}/lib
+ ${PROJECT_SOURCE_DIR}/include
+ ${PROJECT_BINARY_DIR}/include
+ ${PROJECT_SOURCE_DIR}/lib
+ ${PROJECT_BINARY_DIR}/lib
${Boost_INCLUDE_DIRS}
)
# MAKE volk_profile
add_executable(volk_profile
${CMAKE_CURRENT_SOURCE_DIR}/volk_profile.cc
- ${CMAKE_SOURCE_DIR}/lib/qa_utils.cc
+ ${PROJECT_SOURCE_DIR}/lib/qa_utils.cc
)

View file

@ -0,0 +1,127 @@
$NetBSD: patch-volk_lib_CMakeLists.txt,v 1.1 2016/03/19 23:40:25 dbj Exp $
Fix compilation with cmake 3.5
upstream: https://github.com/gnuradio/volk/pull/65
--- volk/lib/CMakeLists.txt.orig 2016-02-07 17:09:12.000000000 +0000
+++ volk/lib/CMakeLists.txt
@@ -90,7 +90,7 @@ endif()
########################################################################
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_SOURCE_DIR}/gen/volk_compile_utils.py
+ ${PROJECT_SOURCE_DIR}/gen/volk_compile_utils.py
--mode "arch_flags" --compiler "${COMPILER_NAME}"
OUTPUT_VARIABLE arch_flag_lines OUTPUT_STRIP_TRAILING_WHITESPACE
)
@@ -278,7 +278,7 @@ message(STATUS "Available architectures:
########################################################################
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_SOURCE_DIR}/gen/volk_compile_utils.py
+ ${PROJECT_SOURCE_DIR}/gen/volk_compile_utils.py
--mode "machines" --archs "${available_archs}"
OUTPUT_VARIABLE available_machines OUTPUT_STRIP_TRAILING_WHITESPACE
)
@@ -310,9 +310,9 @@ message(STATUS "Available machines: ${av
########################################################################
#dependencies are all python, xml, and header implementation files
-file(GLOB xml_files ${CMAKE_SOURCE_DIR}/gen/*.xml)
-file(GLOB py_files ${CMAKE_SOURCE_DIR}/gen/*.py)
-file(GLOB h_files ${CMAKE_SOURCE_DIR}/kernels/volk/*.h)
+file(GLOB xml_files ${PROJECT_SOURCE_DIR}/gen/*.xml)
+file(GLOB py_files ${PROJECT_SOURCE_DIR}/gen/*.py)
+file(GLOB h_files ${PROJECT_SOURCE_DIR}/kernels/volk/*.h)
macro(gen_template tmpl output)
list(APPEND volk_gen_sources ${output})
@@ -320,21 +320,21 @@ macro(gen_template tmpl output)
OUTPUT ${output}
DEPENDS ${xml_files} ${py_files} ${h_files} ${tmpl}
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_SOURCE_DIR}/gen/volk_tmpl_utils.py
+ ${PROJECT_SOURCE_DIR}/gen/volk_tmpl_utils.py
--input ${tmpl} --output ${output} ${ARGN}
)
endmacro(gen_template)
-make_directory(${CMAKE_BINARY_DIR}/include/volk)
+make_directory(${PROJECT_BINARY_DIR}/include/volk)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk.tmpl.h ${CMAKE_BINARY_DIR}/include/volk/volk.h)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk.c)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_typedefs.tmpl.h ${CMAKE_BINARY_DIR}/include/volk/volk_typedefs.h)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_cpu.tmpl.h ${CMAKE_BINARY_DIR}/include/volk/volk_cpu.h)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_cpu.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_cpu.c)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_config_fixed.tmpl.h ${CMAKE_BINARY_DIR}/include/volk/volk_config_fixed.h)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_machines.tmpl.h ${CMAKE_BINARY_DIR}/lib/volk_machines.h)
-gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_machines.tmpl.c ${CMAKE_BINARY_DIR}/lib/volk_machines.c)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk.tmpl.h ${PROJECT_BINARY_DIR}/include/volk/volk.h)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk.c)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_typedefs.tmpl.h ${PROJECT_BINARY_DIR}/include/volk/volk_typedefs.h)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_cpu.tmpl.h ${PROJECT_BINARY_DIR}/include/volk/volk_cpu.h)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_cpu.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_cpu.c)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_config_fixed.tmpl.h ${PROJECT_BINARY_DIR}/include/volk/volk_config_fixed.h)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_machines.tmpl.h ${PROJECT_BINARY_DIR}/lib/volk_machines.h)
+gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_machines.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_machines.c)
set(BASE_CFLAGS NONE)
string(TOUPPER ${CMAKE_BUILD_TYPE} CBTU)
@@ -362,12 +362,12 @@ set(COMPILER_INFO "${CMAKE_C_COMPILER}::
foreach(machine_name ${available_machines})
#generate machine source
set(machine_source ${CMAKE_CURRENT_BINARY_DIR}/volk_machine_${machine_name}.c)
- gen_template(${CMAKE_SOURCE_DIR}/tmpl/volk_machine_xxx.tmpl.c ${machine_source} ${machine_name})
+ gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_machine_xxx.tmpl.c ${machine_source} ${machine_name})
#determine machine flags
execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
- ${CMAKE_SOURCE_DIR}/gen/volk_compile_utils.py
+ ${PROJECT_SOURCE_DIR}/gen/volk_compile_utils.py
--mode "machine_flags" --machine "${machine_name}" --compiler "${COMPILER_NAME}"
OUTPUT_VARIABLE ${machine_name}_flags OUTPUT_STRIP_TRAILING_WHITESPACE
)
@@ -393,9 +393,9 @@ string(REPLACE "\n" " \\n" COMPILER_INFO
# Set local include directories first
########################################################################
include_directories(
- ${CMAKE_BINARY_DIR}/include
- ${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/kernels
+ ${PROJECT_BINARY_DIR}/include
+ ${PROJECT_SOURCE_DIR}/include
+ ${PROJECT_SOURCE_DIR}/kernels
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
@@ -420,8 +420,8 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8
# setup architecture specific assembler flags
set(ARCH_ASM_FLAGS "-mfpu=neon -g")
# then add the files
- include_directories(${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon)
- file(GLOB asm_files ${CMAKE_SOURCE_DIR}/kernels/volk/asm/neon/*.s)
+ include_directories(${PROJECT_SOURCE_DIR}/kernels/volk/asm/neon)
+ file(GLOB asm_files ${PROJECT_SOURCE_DIR}/kernels/volk/asm/neon/*.s)
foreach(asm_file ${asm_files})
list(APPEND volk_sources ${asm_file})
message(STATUS "Adding source file: ${asm_file}")
@@ -453,7 +453,7 @@ if(ORC_FOUND)
list(APPEND volk_libraries ${ORC_LIBRARIES})
#setup orc functions
- file(GLOB orc_files ${CMAKE_SOURCE_DIR}/kernels/volk/asm/orc/*.orc)
+ file(GLOB orc_files ${PROJECT_SOURCE_DIR}/kernels/volk/asm/orc/*.orc)
foreach(orc_file ${orc_files})
#extract the name for the generated c source from the orc file
@@ -511,7 +511,7 @@ PROPERTIES COMPILE_DEFINITIONS "${machin
if(MSVC)
#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)
#compile the sources as C++ due to the lack of complex.h under MSVC
set_source_files_properties(${volk_sources} PROPERTIES LANGUAGE CXX)