mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-02-19 12:04:54 +00:00
Reorganize source code in directories.
This commit is contained in:
parent
3a67f0ec29
commit
d8be48d2e8
25 changed files with 50 additions and 27 deletions
|
@ -20,44 +20,34 @@ find_package(Boost 1.53.0 REQUIRED COMPONENTS program_options)
|
|||
find_package(PostgreSQL REQUIRED)
|
||||
find_package(YamlCpp 0.5.1 REQUIRED)
|
||||
|
||||
add_library(${PROJECT_NAME} INTERFACE)
|
||||
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}Config.h.in"
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.h"
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
src/main.cpp
|
||||
src/filesearcher.cpp
|
||||
src/pathname.cpp
|
||||
src/indexer.cpp
|
||||
src/tiger.c
|
||||
src/tiger.cpp
|
||||
src/pq/connection.cpp
|
||||
src/pq/databaseexception.cpp
|
||||
src/pq/resultset.cpp
|
||||
src/dbbackend.cpp
|
||||
src/settings.cpp
|
||||
src/commandline.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME} SYSTEM
|
||||
INTERFACE ${Boost_INCLUDE_DIRS}
|
||||
PRIVATE ${PostgreSQL_INCLUDE_DIRS}
|
||||
PRIVATE ${YAMLCPP_INCLUDE_DIR}
|
||||
INTERFACE ${PostgreSQL_INCLUDE_DIRS}
|
||||
INTERFACE ${YAMLCPP_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE src
|
||||
PRIVATE include
|
||||
PRIVATE ${PROJECT_BINARY_DIR}
|
||||
INTERFACE ${PROJECT_BINARY_DIR}
|
||||
INTERFACE ${CMAKE_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
add_subdirectory(src/update)
|
||||
add_subdirectory(src/pq)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
${PostgreSQL_LIBRARIES}
|
||||
${YAMLCPP_LIBRARY}
|
||||
${Boost_LIBRARIES}
|
||||
INTERFACE ${PostgreSQL_LIBRARIES}
|
||||
INTERFACE ${YAMLCPP_LIBRARY}
|
||||
INTERFACE ${Boost_LIBRARIES}
|
||||
INTERFACE dindexer-pq
|
||||
)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PUBLIC WITH_PROGRESS_FEEDBACK
|
||||
INTERFACE WITH_PROGRESS_FEEDBACK
|
||||
)
|
||||
|
|
11
src/pq/CMakeLists.txt
Normal file
11
src/pq/CMakeLists.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
project(dindexer-pq CXX)
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC
|
||||
connection.cpp
|
||||
databaseexception.cpp
|
||||
resultset.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE dindexer
|
||||
)
|
|
@ -15,9 +15,9 @@
|
|||
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "pq/connection.hpp"
|
||||
#include "connection.hpp"
|
||||
#include "pq/databaseexception.hpp"
|
||||
#include "pq/resultinfo.hpp"
|
||||
#include "resultinfo.hpp"
|
||||
#include <libpq-fe.h>
|
||||
#include <algorithm>
|
||||
#include <ciso646>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#include "pq/resultset.hpp"
|
||||
#include "pq/resultinfo.hpp"
|
||||
#include "resultinfo.hpp"
|
||||
#include "pq/databaseexception.hpp"
|
||||
#include <libpq-fe.h>
|
||||
#include <map>
|
||||
|
|
22
src/update/CMakeLists.txt
Normal file
22
src/update/CMakeLists.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
project(dindexer-update CXX C)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
main.cpp
|
||||
filesearcher.cpp
|
||||
pathname.cpp
|
||||
indexer.cpp
|
||||
tiger.c
|
||||
tiger.cpp
|
||||
dbbackend.cpp
|
||||
settings.cpp
|
||||
commandline.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
PUBLIC ${CMAKE_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
PRIVATE dindexer
|
||||
)
|
Loading…
Add table
Reference in a new issue