-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
30 lines (24 loc) · 1.08 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
cmake_minimum_required(VERSION 3.13)
project(SoData VERSION 1.5 LANGUAGES CXX)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_CXX_STANDARD 11)
find_package(EXPAT REQUIRED)
add_library(SoDataCommon xmldb.cpp soimport.cpp dbspec.cpp)
add_executable(csvimport csvbuilder.cpp csvimport.cpp)
target_link_libraries(csvimport PRIVATE SoDataCommon)
target_link_libraries(csvimport PRIVATE EXPAT::EXPAT)
find_package(SQLite3)
if (SQLite3_FOUND)
add_executable(sqliteimport sqlitebuilder.cpp sqliteimport.cpp)
target_link_libraries(sqliteimport PRIVATE SoDataCommon)
target_link_libraries(sqliteimport PRIVATE SQLite::SQLite3)
target_link_libraries(sqliteimport PRIVATE EXPAT::EXPAT)
endif (SQLite3_FOUND)
find_package(PQXX)
if (PQXX_FOUND)
add_executable(pgimport csvbuilder.cpp pgbuilder.cpp pgimport.cpp)
target_compile_definitions(pgimport PUBLIC PQXX_HIDE_EXP_OPTIONAL=1)
target_link_libraries(pgimport PRIVATE SoDataCommon)
target_link_libraries(pgimport PRIVATE PQXX::PQXX)
target_link_libraries(pgimport PRIVATE EXPAT::EXPAT)
endif (PQXX_FOUND)