Skip to content

Commit 6f830a8

Browse files
author
Kharchenko
committed
cmake updates
1 parent 2574da4 commit 6f830a8

2 files changed

Lines changed: 59 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ add_library(baysor_lib
221221
src/processing/data_processing/neighborhood_composition.cpp
222222
src/processing/data_processing/noise_estimation.cpp
223223
src/processing/data_processing/boundary_estimation.cpp
224-
src/processing/data_processing/umap_wrappers.cpp
225-
226224
# Processing - bmm_algorithm
227225
src/processing/bmm_algorithm/bmm_algorithm.cpp
228226
src/processing/bmm_algorithm/molecule_clustering.cpp
@@ -242,6 +240,20 @@ add_library(baysor_lib
242240
src/reporting/run_report.cpp
243241
)
244242

243+
add_library(baysor_umap_wrappers STATIC
244+
src/processing/data_processing/umap_wrappers.cpp
245+
)
246+
247+
target_include_directories(baysor_umap_wrappers PUBLIC
248+
${CMAKE_CURRENT_SOURCE_DIR}/include
249+
)
250+
251+
target_link_libraries(baysor_umap_wrappers PUBLIC
252+
Eigen3::Eigen
253+
umappp
254+
knncolle::knncolle
255+
)
256+
245257
target_include_directories(baysor_lib PUBLIC
246258
${CMAKE_CURRENT_SOURCE_DIR}/include
247259
${BAYSOR_HDF5_INCLUDE_DIRS}
@@ -257,8 +269,7 @@ target_link_libraries(baysor_lib PUBLIC
257269
${BAYSOR_HDF5_LIBRARIES}
258270
nlohmann_json::nlohmann_json
259271
TIFF::TIFF
260-
umappp
261-
knncolle::knncolle
272+
baysor_umap_wrappers
262273
)
263274

264275
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

cmake/build_and_install.cmake

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,50 @@ function(_baysor_run)
5353
endif()
5454
endfunction()
5555

56+
find_program(_baysor_ninja NAMES ninja ninja-build)
57+
if(NOT _baysor_ninja)
58+
if(APPLE)
59+
set(_baysor_ninja_install_hint [=[
60+
On macOS, install Ninja with Homebrew:
61+
brew install ninja
62+
63+
Then rerun:
64+
cmake -P cmake/build_and_install.cmake
65+
66+
If you do not use Homebrew, install Ninja with your package manager and make sure the 'ninja' executable is on PATH.]=])
67+
elseif(UNIX)
68+
set(_baysor_ninja_install_hint [=[
69+
Install Ninja with your system package manager, for example:
70+
sudo apt-get install ninja-build # Debian/Ubuntu
71+
sudo dnf install ninja-build # Fedora
72+
sudo pacman -S ninja # Arch
73+
74+
Then rerun:
75+
cmake -P cmake/build_and_install.cmake]=])
76+
elseif(WIN32)
77+
set(_baysor_ninja_install_hint [=[
78+
Install Ninja with your package manager, for example:
79+
winget install Ninja-build.Ninja
80+
choco install ninja
81+
82+
Then rerun:
83+
cmake -P cmake/build_and_install.cmake
84+
85+
Make sure the 'ninja' executable is on PATH.]=])
86+
else()
87+
set(_baysor_ninja_install_hint [=[
88+
Install Ninja from https://ninja-build.org/ and make sure the 'ninja'
89+
executable is on PATH. Then rerun:
90+
cmake -P cmake/build_and_install.cmake]=])
91+
endif()
92+
93+
message(FATAL_ERROR
94+
"Baysor's build helper uses the Ninja CMake generator, but Ninja was "
95+
"not found on PATH.\n\n"
96+
"${_baysor_ninja_install_hint}"
97+
)
98+
endif()
99+
56100
set(_configure_args
57101
-S "${_source_dir}"
58102
-B "${_build_dir}"

0 commit comments

Comments
 (0)