Skip to content

Commit 7157019

Browse files
committed
Fix issue installing empty database directory
The CMake code to install the empty database directory doesn't appear to do anything. Further, it is causing build issues for some users. Instead of running code to make the directory, it appears we can just install a directory directly. Fixes: #1142
1 parent c48146a commit 7157019

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

freshclam/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ else()
4747
endif()
4848

4949
# Install an empty database directory
50-
INSTALL(CODE "FILE(MAKE_DIRECTORY \${ENV}\${CMAKE_INSTALL_PREFIX}/\${DATABASE_DIRECTORY})" COMPONENT programs)
50+
if(IS_ABSOLUTE ${DATABASE_DIRECTORY})
51+
INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${DATABASE_DIRECTORY} COMPONENT programs)
52+
else()
53+
INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${DATABASE_DIRECTORY} COMPONENT programs)
54+
endif()
5155

5256
# Now we rename freshclam-bin executable to freshclam using target properties
5357
set_target_properties( freshclam-bin

0 commit comments

Comments
 (0)