[cmake] add cmake building

This commit is contained in:
2021-02-15 18:15:50 +01:00
parent f83fb911dd
commit 80b23bd9c9
2 changed files with 92 additions and 0 deletions

30
cmake/FindNIX.cmake Normal file
View File

@@ -0,0 +1,30 @@
# - Try to find NIX
# Once done this will define
# NIX_FOUND - System has Nix
# NIX_INCLUDE_DIRS - The Nix include directories
# NIX_LIBRARIES - The libraries needed to use Nix
find_path(NIX_INCLUDE_DIR nix.hpp
HINTS $ENV{NIX_ROOT}/include
/usr/local/include
/usr/include
PATH_SUFFIXES nix)
find_library(NIX_LIBRARY NAMES nix libnix
HINTS ${NIX_INCLUDE_DIR}/../lib
HINTS ${NIX_INCLUDE_DIR}/../build
/usr/local/lib
/usr/lib)
set(NIX_LIBRARIES ${NIX_LIBRARY})
set(NIX_INCLUDE_DIRS ${NIX_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set NIX_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Nix DEFAULT_MSG
NIX_LIBRARY NIX_INCLUDE_DIR)
mark_as_advanced(NIX_INCLUDE_DIR NIX_LIBRARY)