mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-01-27 18:34:56 +01:00
allow building librtlsdr as CMake subproject
Replace CMAKE_SOURCE_DIR by PROJECT_SOURCE_DIR in main CMakeLists.txt to fix CMake errors when building librtlsdr as a subproject.
This commit is contained in:
parent
43b257854c
commit
bd73737c49
@ -31,7 +31,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||||||
endif(NOT CMAKE_BUILD_TYPE)
|
endif(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
|
set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "")
|
||||||
|
|
||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
||||||
|
|
||||||
if(NOT LIB_INSTALL_DIR)
|
if(NOT LIB_INSTALL_DIR)
|
||||||
set(LIB_INSTALL_DIR lib)
|
set(LIB_INSTALL_DIR lib)
|
||||||
@ -80,7 +80,7 @@ endif()
|
|||||||
# Setup the include and linker paths
|
# Setup the include and linker paths
|
||||||
########################################################################
|
########################################################################
|
||||||
include_directories(
|
include_directories(
|
||||||
${CMAKE_SOURCE_DIR}/include
|
${PROJECT_SOURCE_DIR}/include
|
||||||
${LIBUSB_INCLUDE_DIR}
|
${LIBUSB_INCLUDE_DIR}
|
||||||
${THREADS_PTHREADS_INCLUDE_DIR}
|
${THREADS_PTHREADS_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
@ -96,7 +96,7 @@ include_directories(
|
|||||||
# 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)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user