@@ -83,31 +83,25 @@ set(CMAKE_CXX_STANDARD 17)
8383set(CMAKE_CXX_STANDARD_REQUIRED ON)
8484set(CMAKE_CXX_EXTENSIONS OFF)
8585
86- find_package(Git REQUIRED)
8786include(FetchContent)
8887
8988FetchContent_Declare(
9089 c_questdb_client_proj
9190 GIT_REPOSITORY https://github.com/questdb/c-questdb-client.git
9291 GIT_TAG CHOSEN_RELEASE_TAG) # CHANGE ME!
9392
94- FetchContent_GetProperties(c_questdb_client_proj)
95- if(NOT c_questdb_client_proj_POPULATED)
96- FetchContent_Populate(c_questdb_client_proj)
97- add_subdirectory(
98- ${c_questdb_client_proj_SOURCE_DIR}
99- ${c_questdb_client_proj_BINARY_DIR}
100- EXCLUDE_FROM_ALL)
101- endif()
93+ FetchContent_MakeAvailable(c_questdb_client)
10294
10395add_executable(
10496 main
10597 main.cpp)
10698target_link_libraries(
10799 main
108- c_questdb_client_static )
100+ questdb_client )
109101```
110102
103+ * Note:* By default, the library will be linked statically. Call ` cmake .. -DBUILD_SHARED_LIBS=ON ` to depend on the dynamic library.
104+
111105## Option 2: CMake add_subdirectory & Git source code grafting
112106
113107If you're using both CMake and git in your project, then you can graft this
@@ -231,7 +225,7 @@ add_executable(
231225 main.cpp)
232226target_link_libraries(
233227 main
234- c_questdb_client_static )
228+ questdb_client )
235229```
236230
237231## Option 3: Other build systems
@@ -251,6 +245,8 @@ If you use a build system other than CMake, the following tips should help you:
251245 to mark ` __declspec(dllexport) ` :
252246 This define should * not* be present when * using* the library.
253247
248+ * Note:* By default, the library will be linked statically. Call ` cmake .. -DBUILD_SHARED_LIBS=ON ` to depend on the dynamic library.
249+
254250## Package Managers
255251
256252If you are using a particular package manager (e.g. Conan or vcpkg), contact us
0 commit comments