Skip to content

Commit

Permalink
Merge pull request #228 from feelpp/master
Browse files Browse the repository at this point in the history
c++20 and cmake fixes
  • Loading branch information
jlblancoc committed Dec 30, 2023
2 parents 52191e1 + 461335f commit 0b9fc58
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ if(NOT DEFINED PKGCONFIG_INSTALL_DIR)
set(PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endif()

# Save all executables (unit tests & examples) in the same place:
set(EXECUTABLE_OUTPUT_PATH ${${PROJECT_NAME}_BINARY_DIR}/bin CACHE PATH "Output directory for executables")
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
# This is the root project
set(MASTER_PROJECT ON)
else()
set(MASTER_PROJECT OFF)
endif()
if (MASTER_PROJECT)
# Save all executables (unit tests & examples) in the same place:
set(EXECUTABLE_OUTPUT_PATH ${${PROJECT_NAME}_BINARY_DIR}/bin CACHE PATH "Output directory for executables")
endif()

# Define nanoflann lib (header-only)
add_library(nanoflann INTERFACE)
Expand Down Expand Up @@ -147,7 +155,9 @@ configure_file(
"${nanoflann_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY IMMEDIATE)

if (NOT TARGET uninstall)
option(MASTER_PROJECT_HAS_TARGET_UNINSTALL "uninstall target to master project CMakeLists.txt" OFF)

if(NOT MASTER_PROJECT_HAS_TARGET_UNINSTALL OR NOT TARGET uninstall)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${nanoflann_BINARY_DIR}/cmake_uninstall.cmake")
else()
Expand Down
1 change: 1 addition & 0 deletions include/nanoflann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <cassert>
#include <cmath> // for abs()
#include <cstdlib> // for abs()
#include <cstdint>
#include <functional> // std::reference_wrapper
#include <future>
#include <istream>
Expand Down

0 comments on commit 0b9fc58

Please sign in to comment.