2 OUTPUT ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h
3 COMMAND ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/gen_db_md5.sh
4 ARGS ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h
5 ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db
6 DEPENDS ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db
7 ${CMAKE_SOURCE_DIR}/modules/auto_save_dao/orm/gen_db_md5.sh
8 COMMENT "Generating WRT auto save database checksum"
11 ADD_CUSTOM_COMMAND( OUTPUT .wrt_autosave.db
12 COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db
13 COMMAND gcc -Wall -include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h -I${PROJECT_SOURCE_DIR}/modules/db/include -I${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm -E ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db_sql_generator.h | grep --invert-match "^#" > ${CMAKE_CURRENT_BINARY_DIR}/wrt_autosave_db.sql
14 COMMAND sqlite3 ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db ".read ${CMAKE_CURRENT_BINARY_DIR}/wrt_autosave_db.sql" || rm -f ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db
15 DEPENDS ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db_sql_generator.h ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm/autosave_db
18 ADD_CUSTOM_COMMAND( OUTPUT .wrt_autosave.db-journal
20 ARGS ${CMAKE_CURRENT_BINARY_DIR}/.wrt_autosave.db-journal
23 ADD_CUSTOM_TARGET(Sqlite3DbAutoSave ALL DEPENDS .wrt_autosave.db .wrt_autosave.db-journal)
24 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wrt_autosave_db.sql DESTINATION share/wrt-engine/)
26 ###############################################################################
28 INCLUDE(FindPkgConfig)
30 PKG_CHECK_MODULES(AUTO_SAVE_DAO_DEPS
34 SET(AUTO_SAVE_DAO_INCLUDE_DIRS
35 ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/include
36 ${PROJECT_SOURCE_DIR}/modules/auto_save_dao/orm
37 ${PROJECT_SOURCE_DIR}/modules/core/include
38 ${PROJECT_SOURCE_DIR}/modules/db/include
39 ${PROJECT_SOURCE_DIR}/modules/log/include
40 ${AUTO_SAVE_DAO_DEPS_INCLUDE_DIRS}
43 SET(AUTO_SAVE_DAO_SOURCES
44 dao/common_dao_types.cpp
45 dao/AutoSaveDatabase.cpp
48 SET(AUTO_SAVE_DAO_RO_SOURCES
49 dao/auto_save_dao_read_only.cpp
52 SET(AUTO_SAVE_DAO_RW_SOURCES
56 INCLUDE_DIRECTORIES(${AUTO_SAVE_DAO_INCLUDE_DIRS})
58 ADD_LIBRARY(${TARGET_AUTO_SAVE_DAO_LIB} SHARED ${AUTO_SAVE_DAO_SOURCES})
59 SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION})
60 SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h")
61 TARGET_LINK_LIBRARIES(${TARGET_AUTO_SAVE_DAO_LIB} ${TARGET_DPL_EFL} ${TARGET_DPL_DB_EFL} ${AUTO_SAVE_DAO_DEPS_LIBRARIES})
63 ADD_LIBRARY(${TARGET_AUTO_SAVE_DAO_RO_LIB} SHARED ${AUTO_SAVE_DAO_RO_SOURCES})
64 SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION})
65 SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h")
66 TARGET_LINK_LIBRARIES(${TARGET_AUTO_SAVE_DAO_RO_LIB} ${TARGET_AUTO_SAVE_DAO_LIB})
68 ADD_LIBRARY(${TARGET_AUTO_SAVE_DAO_RW_LIB} SHARED ${AUTO_SAVE_DAO_RW_SOURCES})
69 SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} PROPERTIES SOVERSION ${API_VERSION} VERSION ${VERSION})
70 SET_TARGET_PROPERTIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_BINARY_DIR}/modules/auto_save_dao/database_checksum_autosave.h")
71 TARGET_LINK_LIBRARIES(${TARGET_AUTO_SAVE_DAO_RW_LIB} ${TARGET_AUTO_SAVE_DAO_RO_LIB})
73 INSTALL(TARGETS ${TARGET_AUTO_SAVE_DAO_LIB} DESTINATION lib)
74 INSTALL(TARGETS ${TARGET_AUTO_SAVE_DAO_RO_LIB} DESTINATION lib)
75 INSTALL(TARGETS ${TARGET_AUTO_SAVE_DAO_RW_LIB} DESTINATION lib)
78 include/wrt-commons/auto-save-dao/common_dao_types.h
79 include/wrt-commons/auto-save-dao/AutoSaveDatabase.h
80 DESTINATION include/dpl-efl/wrt-commons/auto-save-dao
84 include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h
85 DESTINATION include/dpl-efl/wrt-commons/auto-save-dao-ro
89 include/wrt-commons/auto-save-dao-rw/auto_save_dao.h
90 DESTINATION include/dpl-efl/wrt-commons/auto-save-dao-rw