Skip to content

Commit

Permalink
Changes that suggested on #770
Browse files Browse the repository at this point in the history
Writing to the python helper script moved to `python/volk_modtool/CMakeLists.txt`
Revert "Changes that suggested on #770" and Added way given on pull req.

This reverts commit d4afa9e partially.

as @jdemel stated:
> CMAKE_CURRENT_BINARY_DIR would possibly be the preferred way to use. I'd suspect changing this variable in the original location would already fix your issue. That'd be great. That way we can keep the code in a more generic place that makes it easier to re-use. Also, thanks for your patience.

I suspected about is there any upper config deletes CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BUILD_DIR and it overriding on 'CMakeLists.txt'.

Signed-off-by: Suleyman Poyraz <[email protected]>
  • Loading branch information
Zaryob committed Nov 1, 2024
1 parent bd4694d commit b0d9356
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 29 deletions.
54 changes: 26 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
"${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types -Werror=pointer-sign")
endif()

set(CMAKE_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
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules
)#location for custom "Modules"

Expand Down Expand Up @@ -91,8 +89,8 @@ math(EXPR VOLK_VERSION_DECIMAL "${VERSION_INFO_MAJOR_VERSION} * 10000
+ ${VERSION_INFO_MINOR_VERSION} * 100
+ ${VERSION_INFO_MAINT_VERSION}")

configure_file(${CMAKE_SOURCE_DIR}/include/volk/volk_version.h.in
${CMAKE_BINARY_DIR}/include/volk/volk_version.h @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_version.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_version.h @ONLY)

########################################################################
# Environment setup
Expand Down Expand Up @@ -236,31 +234,31 @@ set(VOLK_LIBRARY_DIR ${CMAKE_INSTALL_LIBDIR})
set(VOLK_INCLUDE_DIR include)

install(
DIRECTORY ${CMAKE_SOURCE_DIR}/kernels/volk
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/kernels/volk
DESTINATION include
COMPONENT "volk_devel"
FILES_MATCHING
PATTERN "*.h")

install(
FILES ${CMAKE_SOURCE_DIR}/include/volk/volk_prefs.h
${CMAKE_SOURCE_DIR}/include/volk/volk_alloc.hh
${CMAKE_SOURCE_DIR}/include/volk/volk_complex.h
${CMAKE_SOURCE_DIR}/include/volk/volk_common.h
${CMAKE_SOURCE_DIR}/include/volk/saturation_arithmetic.h
${CMAKE_SOURCE_DIR}/include/volk/volk_avx_intrinsics.h
${CMAKE_SOURCE_DIR}/include/volk/volk_avx2_intrinsics.h
${CMAKE_SOURCE_DIR}/include/volk/volk_avx2_fma_intrinsics.h
${CMAKE_SOURCE_DIR}/include/volk/volk_sse_intrinsics.h
${CMAKE_SOURCE_DIR}/include/volk/volk_sse3_intrinsics.h
${CMAKE_SOURCE_DIR}/include/volk/volk_neon_intrinsics.h
${CMAKE_BINARY_DIR}/include/volk/volk.h
${CMAKE_BINARY_DIR}/include/volk/volk_cpu.h
${CMAKE_BINARY_DIR}/include/volk/volk_config_fixed.h
${CMAKE_BINARY_DIR}/include/volk/volk_typedefs.h
${CMAKE_SOURCE_DIR}/include/volk/volk_malloc.h
${CMAKE_BINARY_DIR}/include/volk/volk_version.h
${CMAKE_SOURCE_DIR}/include/volk/constants.h
FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_prefs.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_alloc.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_complex.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_common.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/saturation_arithmetic.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_avx_intrinsics.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_avx2_intrinsics.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_avx2_fma_intrinsics.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_sse_intrinsics.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_sse3_intrinsics.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_neon_intrinsics.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_cpu.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_config_fixed.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_typedefs.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/volk_malloc.h
${CMAKE_CURRENT_BINARY_DIR}/include/volk/volk_version.h
${CMAKE_CURRENT_SOURCE_DIR}/include/volk/constants.h
DESTINATION include/volk
COMPONENT "volk_devel")

Expand Down Expand Up @@ -288,7 +286,7 @@ endif(APPLE)
########################################################################
# Create uninstall target
########################################################################
configure_file(${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake @ONLY)

# Only add the target if there isn't one defined already
Expand All @@ -303,11 +301,11 @@ endif()
# http://www.cmake.org/Wiki/CMake/Tutorials/Packaging
########################################################################

configure_file(${CMAKE_SOURCE_DIR}/cmake/Modules/VolkConfig.cmake.in
${CMAKE_BINARY_DIR}/cmake/Modules/VolkConfig.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/VolkConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/VolkConfig.cmake @ONLY)

configure_file(${CMAKE_SOURCE_DIR}/cmake/Modules/VolkConfigVersion.cmake.in
${CMAKE_BINARY_DIR}/cmake/Modules/VolkConfigVersion.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/VolkConfigVersion.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/Modules/VolkConfigVersion.cmake @ONLY)

########################################################################
# Install cmake search routine for external use
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/VolkPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ file(TO_CMAKE_PATH ${VOLK_PYTHON_DIR} VOLK_PYTHON_DIR)
# Usage: VOLK_UNIQUE_TARGET(<description> <dependencies list>)
########################################################################
function(VOLK_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
file(RELATIVE_PATH reldir ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
unique = hashlib.sha256(b'${reldir}${ARGN}').hexdigest()[:5]
Expand Down

0 comments on commit b0d9356

Please sign in to comment.