Skip to content

Commit

Permalink
build: clean up include_directories and use full path includes
Browse files Browse the repository at this point in the history
Removed the relative search path include_directories from the
CMakeLists files and changed the includes to also name the path.
  • Loading branch information
pstorz committed Sep 4, 2018
1 parent 12e6863 commit bd0aa12
Show file tree
Hide file tree
Showing 63 changed files with 77 additions and 111 deletions.
3 changes: 1 addition & 2 deletions core/CMakeLists.txt
Expand Up @@ -124,8 +124,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include_directories(
${CMAKE_SOURCE_DIR}/src/win32/include
${CMAKE_SOURCE_DIR}/src/win32/compat/include
#${CMAKE_SOURCE_DIR}/src/win32/cats/pgsql/include
#${CMAKE_SOURCE_DIR}/src/win32/plugins/python/include
)
set(HAVE_WIN32 1)

Expand Down Expand Up @@ -254,6 +252,7 @@ include_directories(${PYTHON_INCLUDE_DIRS})

include_directories(${PYTHON_INCLUDE_PATH})

include_directories(${CMAKE_SOURCE_DIR}/src)

# trick for socklen_t
set(CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h")
Expand Down
2 changes: 1 addition & 1 deletion core/src/cats/CMakeLists.txt
Expand Up @@ -18,7 +18,7 @@
# 02110-1301, USA.


include_directories(. .. ../include ${MYSQL_INCLUDE_DIR} ${PostgreSQL_INCLUDE_DIR})
include_directories(${MYSQL_INCLUDE_DIR} ${PostgreSQL_INCLUDE_DIR})


add_definitions( -D_BDB_PRIV_INTERFACE_)
Expand Down
6 changes: 3 additions & 3 deletions core/src/cats/bvfs.cc
Expand Up @@ -28,10 +28,10 @@

#if HAVE_SQLITE3 || HAVE_MYSQL || HAVE_POSTGRESQL || HAVE_INGRES || HAVE_DBI

#include "cats.h"
#include "sql.h"
#include "cats/cats.h"
#include "cats/sql.h"
#include "lib/htable.h"
#include "bvfs.h"
#include "cats/bvfs.h"
#include "lib/edit.h"

#define dbglevel 10
Expand Down
2 changes: 1 addition & 1 deletion core/src/cats/cats.h
Expand Up @@ -879,7 +879,7 @@ struct SqlPoolDescriptor {
dlink link; /**< list management */
};

#include "jcr.h"
#include "include/jcr.h"

/**
* Object used in db_list_xxx function
Expand Down
1 change: 0 additions & 1 deletion core/src/console/CMakeLists.txt
Expand Up @@ -17,7 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

include_directories(. .. ../include )

SET (BCONSSRCS console.cc console_conf.cc)
IF(HAVE_WIN32)
Expand Down
4 changes: 2 additions & 2 deletions core/src/console/console.cc
Expand Up @@ -29,8 +29,8 @@
*/

#include "include/bareos.h"
#include "console_conf.h"
#include "jcr.h"
#include "console/console_conf.h"
#include "include/jcr.h"
#include "lib/bnet.h"

#ifdef HAVE_CONIO
Expand Down
4 changes: 1 addition & 3 deletions core/src/dird/CMakeLists.txt
Expand Up @@ -39,13 +39,11 @@ IF(HAVE_WIN32)
ENDIF()

IF(HAVE_WIN32)
include_directories(${CMAKE_SOURCE_DIR}/src/win32/generic ${CMAKE_SOURCE_DIR}/src/win32/dird ../include ..)
include_directories(${CMAKE_SOURCE_DIR}/src/win32/generic ${CMAKE_SOURCE_DIR}/src/win32/dird)
LIST(APPEND DIRDSRCS
../win32/generic/main.cc
../win32/generic/service.cc
)
ELSE()
include_directories(. .. ../include ../lmdb ../ndmp)
ENDIF()


Expand Down
4 changes: 2 additions & 2 deletions core/src/dird/dir_plugins.h
Expand Up @@ -45,8 +45,8 @@
#endif

#include <sys/types.h>
#include "hostconfig.h"
#include "bc_types.h"
#include "include/hostconfig.h"
#include "include/bc_types.h"
#include "lib/plugins.h"

/*
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/dird.h
Expand Up @@ -40,7 +40,7 @@
#include "dir_plugins.h"
#include "cats/cats.h"

#include "jcr.h"
#include "include/jcr.h"
#include "bsr.h"
#include "ua.h"
#include "jobq.h"
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/ndmp_fhdb_lmdb.cc
Expand Up @@ -34,7 +34,7 @@

#include "ndmp/ndmagents.h"
#include "ndmp_dma_priv.h"
#include "lmdb.h"
#include "lmdb/lmdb.h"

/*
* What is actually stored in the LMDB
Expand Down
5 changes: 2 additions & 3 deletions core/src/filed/CMakeLists.txt
Expand Up @@ -22,9 +22,8 @@ IF(HAVE_WIN32)
include_directories(
${CMAKE_SOURCE_DIR}/src/win32/generic
${CMAKE_SOURCE_DIR}/src/win32/filed
${CMAKE_SOURCE_DIR}/src/win32/vss/include ../include . .. ../lmdb/)
ELSE()
include_directories(. .. ../include ../lmdb)
${CMAKE_SOURCE_DIR}/src/win32/vss/include
)
ENDIF()

set(FDSRCS accurate.cc authenticate.cc crypto.cc fd_plugins.cc fileset.cc sd_cmds.cc verify.cc
Expand Down
4 changes: 2 additions & 2 deletions core/src/filed/accurate.h
Expand Up @@ -41,7 +41,7 @@
* also cost some bytes.
*/

#include "hostconfig.h"
#include "include/hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push,4)
Expand Down Expand Up @@ -153,7 +153,7 @@ class BareosAccurateFilelistHtable: public BareosAccurateFilelist {

#ifdef HAVE_LMDB

#include "lmdb.h"
#include "lmdb/lmdb.h"

/*
* Lightning Memory DataBase (LMDB) specific storage abstraction class using the Symas LMDB.
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/backup.cc
Expand Up @@ -35,7 +35,7 @@
#include "filed/crypto.h"
#include "filed/heartbeat.h"
#include "filed/backup.h"
#include "ch.h"
#include "include/ch.h"
#include "findlib/attribs.h"
#include "findlib/hardlink.h"
#include "findlib/find_one.h"
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/dir_cmd.cc
Expand Up @@ -30,7 +30,7 @@

#include "include/bareos.h"
#include "filed/filed.h"
#include "ch.h"
#include "include/ch.h"
#include "filed/authenticate.h"
#include "filed/dir_cmd.h"
#include "filed/estimate.h"
Expand Down
8 changes: 4 additions & 4 deletions core/src/filed/fd_plugins.h
Expand Up @@ -44,11 +44,11 @@

#include <sys/types.h>

#include "hostconfig.h"
#include "include/hostconfig.h"

#include "version.h"
#include "bc_types.h"
#include "fileopts.h"
#include "include/version.h"
#include "include/bc_types.h"
#include "include/fileopts.h"
#include "lib/plugins.h"
#include <sys/stat.h>

Expand Down
8 changes: 4 additions & 4 deletions core/src/filed/filed.h
Expand Up @@ -34,15 +34,15 @@
#ifdef HAVE_WIN32
#include "vss.h"
#endif
#include "jcr.h"
#include "include/jcr.h"
#include "lib/breg.h"
#include "lib/htable.h"
#include "lib/runscript.h"
#include "findlib/find.h"
#include "fd_plugins.h"
#include "ch.h"
#include "backup.h"
#include "restore.h"
#include "include/ch.h"
#include "filed/backup.h"
#include "filed/restore.h"

extern ClientResource *me; /* "Global" Client resource */
extern ConfigurationParser *my_config; /* Our Global config */
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/fileset.cc
Expand Up @@ -33,7 +33,7 @@
#include "filed/filed.h"
#include "findlib/match.h"
#include "lib/edit.h"
#include "ch.h"
#include "include/ch.h"

#ifdef HAVE_WIN32
#include "win32/findlib/win32.h"
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/restore.cc
Expand Up @@ -33,7 +33,7 @@
#include "filed/compression.h"
#include "filed/crypto.h"
#include "filed/verify.h"
#include "ch.h"
#include "include/ch.h"
#include "findlib/create_file.h"
#include "findlib/attribs.h"
#include "findlib/find.h"
Expand Down
2 changes: 0 additions & 2 deletions core/src/findlib/CMakeLists.txt
Expand Up @@ -17,8 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

include_directories(../include .. .)

SET(BAREOSFIND_SRCS acl.cc attribs.cc bfile.cc create_file.cc drivetype.cc
enable_priv.cc find_one.cc find.cc fstype.cc hardlink.cc match.cc
mkpath.cc shadowing.cc xattr.cc)
Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/acl.cc
Expand Up @@ -62,7 +62,7 @@
*/

#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "find.h"

#if !defined(HAVE_ACL) && !defined(HAVE_AFS_ACL)
Expand Down
4 changes: 2 additions & 2 deletions core/src/findlib/attribs.cc
Expand Up @@ -29,9 +29,9 @@
*/

#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "find.h"
#include "ch.h"
#include "include/ch.h"
#include "findlib/attribs.h"
#include "lib/edit.h"

Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/create_file.cc
Expand Up @@ -29,7 +29,7 @@
*/

#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "find.h"
#include "findlib/makepath.h"
#include "findlib/create_file.h"
Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/enable_priv.cc
Expand Up @@ -29,7 +29,7 @@

#include "include/bareos.h"
#include "find.h"
#include "jcr.h"
#include "include/jcr.h"
#include "findlib/enable_priv.h"

/*=============================================================*/
Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/find.cc
Expand Up @@ -33,7 +33,7 @@
*/

#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "find.h"
#include "findlib/find_one.h"

Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/find.h
Expand Up @@ -31,7 +31,7 @@
#ifndef BAREOS_FINDLIB_FIND_H_
#define BAREOS_FINDLIB_FIND_H_

#include "fileopts.h"
#include "include/fileopts.h"
#include "bfile.h"

#ifdef HAVE_DIRENT_H
Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/find_one.cc
Expand Up @@ -32,7 +32,7 @@
*/

#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "find.h"
#include "findlib/match.h"
#include "findlib/find_one.h"
Expand Down
4 changes: 2 additions & 2 deletions core/src/findlib/match.cc
Expand Up @@ -38,9 +38,9 @@
*/

#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "find.h"
#include "ch.h"
#include "include/ch.h"

#include <sys/types.h>
#include "findlib/match.h"
Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/mkpath.cc
Expand Up @@ -35,7 +35,7 @@
* the top, which can be rather inefficient for long path names.
*/
#include "include/bareos.h"
#include "jcr.h"
#include "include/jcr.h"
#include "lib/path_list.h"

#define debuglevel 50
Expand Down
2 changes: 0 additions & 2 deletions core/src/findlib/unittests/CMakeLists.txt
Expand Up @@ -17,8 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

include_directories(.. ../.. ../../include/)

set (TEST_SRC
# drivetype_test.cc
# fstype_test.cc
Expand Down
2 changes: 1 addition & 1 deletion core/src/findlib/xattr.cc
Expand Up @@ -58,7 +58,7 @@

#include "include/bareos.h"
#include "find.h"
#include "jcr.h"
#include "include/jcr.h"

#if !defined(HAVE_XATTR)
/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

include_directories(../include ..
include_directories(
${OPENSSL_INCLUDE_DIRS}
${PTHREAD_INCLUDE_DIRS}
${FASTLZ_INCLUDE_DIRS}
Expand Down
4 changes: 2 additions & 2 deletions core/src/lib/compression.cc
Expand Up @@ -31,8 +31,8 @@

#include "include/bareos.h"
#include "include/jcr.h"
#include "ch.h"
#include "streams.h"
#include "include/ch.h"
#include "include/streams.h"
#include "lib/edit.h"

#if defined(HAVE_LZO) || defined(HAVE_LIBZ) || defined(HAVE_FASTLZ)
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/htable.cc
Expand Up @@ -40,7 +40,7 @@
* Kern Sibbald, July MMIII
*/

#include "hostconfig.h"
#include "include/hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(4)
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/htable.h
Expand Up @@ -46,7 +46,7 @@
#endif


#include "hostconfig.h"
#include "include/hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push,4)
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/parse_conf.h
Expand Up @@ -26,7 +26,7 @@
#pragma once

#include "include/bareos.h"
#include "bc_types.h"
#include "include/bc_types.h"

#include <functional>

Expand Down
4 changes: 2 additions & 2 deletions core/src/lib/tree.h
Expand Up @@ -27,9 +27,9 @@
* Directory tree build/traverse routines
*/

#include "htable.h"
#include "lib/htable.h"

#include "hostconfig.h"
#include "include/hostconfig.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push,4)
Expand Down
1 change: 0 additions & 1 deletion core/src/lib/unittests/CMakeLists.txt
Expand Up @@ -17,7 +17,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

include_directories(.. ../.. ../../include/)
IF(HAVE_WIN32)
link_libraries(kernel32
user32 gdi32 winspool shell32 ole32 oleaut32 uuid comdlg32 advapi32)
Expand Down

0 comments on commit bd0aa12

Please sign in to comment.