summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorManuel Bentele2020-10-19 14:35:01 +0200
committerManuel Bentele2020-10-19 14:44:05 +0200
commitf617270a773669885f263e394f8a10553e110e28 (patch)
treee2b8effab564350324aeebb5fcec3b9f1ba304af /CMakeLists.txt
parent[BUILD] rewrite CMake build system to track changes of source files (diff)
downloaddnbd3-f617270a773669885f263e394f8a10553e110e28.tar.gz
dnbd3-f617270a773669885f263e394f8a10553e110e28.tar.xz
dnbd3-f617270a773669885f263e394f8a10553e110e28.zip
[BUILD] fixes issues to build user space programs on FreeBSD 12.1
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt23
1 files changed, 10 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1a91aa..6bf7d0b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,14 +31,18 @@ endif()
if(CMAKE_SYSTEM_NAME MATCHES "BSD")
message(STATUS "Detected BSD System: Disable build of the dnbd3 Linux kernel module")
set(DNBD3_KERNEL_MODULE OFF)
+else(CMAKE_SYSTEM_NAME MATCHES "BSD")
+ # set Linux kernel directories
+ set(KERNEL_BUILD_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build"
+ CACHE PATH "Path to Linux kernel modules to compile against")
+ set(KERNEL_INSTALL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/extra"
+ CACHE PATH "Path to install Linux kernel modules")
+
+ # print configured settings
+ message(STATUS "Path to Linux kernel modules to compile against is " ${KERNEL_BUILD_DIR})
+ message(STATUS "Path to install Linux kernel modules is " ${KERNEL_INSTALL_DIR})
endif(CMAKE_SYSTEM_NAME MATCHES "BSD")
-# set Linux kernel directories
-set(KERNEL_BUILD_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build"
- CACHE PATH "Path to Linux kernel modules to compile against")
-set(KERNEL_INSTALL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/extra"
- CACHE PATH "Path to install Linux kernel modules")
-
# search for required packages
find_package(Git)
find_package(Threads)
@@ -60,9 +64,6 @@ include(KernelVersion)
# include project version related macros
include(ProjectVersion)
-# get Linux kernel version from path
-get_kernel_version(LINUX_KERNEL_VERSION ${KERNEL_BUILD_DIR})
-
# set include directories
set(PROJECT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/inc)
set(PROJECT_INCLUDE_TMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/inc)
@@ -72,10 +73,6 @@ include_directories(${PROJECT_INCLUDE_DIR})
# exposes dnbd3-generate-version and dnbd3-version target
gen_project_version(${PROJECT_INCLUDE_DIR}/dnbd3/version.h.in ${PROJECT_INCLUDE_TMP_DIR}/dnbd3/version.h)
-# print configured settings
-message(STATUS "Path to Linux kernel modules to compile against is " ${KERNEL_BUILD_DIR})
-message(STATUS "Path to install Linux kernel modules is " ${KERNEL_INSTALL_DIR})
-
# add compile option to handle files greater than 2GB on a 32bit system
add_definitions(-D_FILE_OFFSET_BITS=64)