ClickHouse / clickhouse-cpp

C++ client library for ClickHouse
Apache License 2.0
305 stars 159 forks source link

Error in CMakeLists.txt #350

Closed Anton-duckys closed 11 months ago

Anton-duckys commented 11 months ago

CMake Error at third-party/ClickHouse/clickhouse-cpp/cmake/version.cmake:26 (file): file failed to open for reading (No such file or directory): /my_project/clickhouse/version.h

There is line in clickhouse's CMakeLists.txt : file(READ ${CMAKE_SOURCE_DIR}/clickhouse/version.h VERSION_FILE_DATA) I try to add lib with FetchContent in my CMakeLists.txt The problem is that because CMAKE_SOURCE_DIR reffers to root of my project, but clickhouse lib is contained in the folder third_party that is contained in root of my project. So if i want to place clickhouse lib not directly in root there will be an error Possible solution: Remove ${CMAKE_SOURCE_DIR} from path ${CMAKE_SOURCE_DIR}/clickhouse/version.h in file cmake/version.cmake or use ${CMAKE_CURRENT_SOURCE_DIR}

Enmk commented 11 months ago

Hi @Anton-duckys ! Thank you for reporting, please take a look at #351 for the potential fix