diff --git a/freshclam/CMakeLists.txt b/freshclam/CMakeLists.txt index ef3616fe32..7f2ae9e1d9 100644 --- a/freshclam/CMakeLists.txt +++ b/freshclam/CMakeLists.txt @@ -47,7 +47,11 @@ else() endif() # Install an empty database directory -INSTALL(CODE "FILE(MAKE_DIRECTORY \${ENV}\${CMAKE_INSTALL_PREFIX}/\${DATABASE_DIRECTORY})" COMPONENT programs) +if(IS_ABSOLUTE ${DATABASE_DIRECTORY}) + INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${DATABASE_DIRECTORY} COMPONENT programs) +else() + INSTALL(DIRECTORY DESTINATION $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${DATABASE_DIRECTORY} COMPONENT programs) +endif() # Now we rename freshclam-bin executable to freshclam using target properties set_target_properties( freshclam-bin