diff --git a/CMakeLists.txt b/CMakeLists.txt index 439c36e..14439ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,8 @@ option(DINDEXER_WITH_MEDIA_AUTODETECT "Enable code that tries to autodetect the if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION_MAJOR EQUAL "5") option(DINDEXER_CXX11_ABI "Controls if _GLIBCXX_USE_CXX11_ABI gets set to 0 or not" ON) endif() -set(ACTIONS_PATH "${CMAKE_CURRENT_BINARY_DIR}/src" CACHE STRING "Actions search path") +set(DINDEXER_ACTIONS_PATH "${CMAKE_CURRENT_BINARY_DIR}/src" CACHE STRING "Actions search path") +string(REGEX MATCH "[^/].*" ACTIONS_PATH_INSTALL "${DINDEXER_ACTIONS_PATH}") set(DB_OWNER_NAME "$ENV{USER}" CACHE STRING "Name that will be used as the DB owner name") set(PROJECT_VERSION_BETA "1") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -Wall -Wextra -Wno-missing-field-initializers") @@ -37,7 +38,7 @@ import_libpqtypes_project("${PostgreSQL_INCLUDE_DIRS}") add_library(${PROJECT_NAME} INTERFACE) add_library(${bare_name}-inc INTERFACE) -message(STATUS "Actions search path set to: \"${ACTIONS_PATH}\"") +message(STATUS "Actions search path set to: \"${DINDEXER_ACTIONS_PATH}\"") configure_file( "${PROJECT_SOURCE_DIR}/src/${bare_name}Config.h.in" diff --git a/action_skel_code/CMakeLists.txt b/action_skel_code/CMakeLists.txt index 7459e82..88bee40 100644 --- a/action_skel_code/CMakeLists.txt +++ b/action_skel_code/CMakeLists.txt @@ -18,3 +18,9 @@ string(REPLACE "${bare_name}-" "" ACTION_NAME "${PROJECT_NAME}") target_compile_definitions(${PROJECT_NAME} PRIVATE ACTION_NAME="${ACTION_NAME}" ) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION ${ACTIONS_PATH_INSTALL} + ARCHIVE DESTINATION lib/static +) diff --git a/cmake/Modules/Buildlibpqtypes.cmake b/cmake/Modules/Buildlibpqtypes.cmake index 31aca55..7a07078 100644 --- a/cmake/Modules/Buildlibpqtypes.cmake +++ b/cmake/Modules/Buildlibpqtypes.cmake @@ -22,6 +22,12 @@ function (import_libpqtypes_project PostgreSQL_INCLUDE_DIRS) set_target_properties(pqtypes PROPERTIES IMPORTED_LOCATION ${libpqtypes_prefix}/lib/libpqtypes.so ) + install( + DIRECTORY ${libpqtypes_prefix}/lib/ + DESTINATION "lib" + COMPONENT runtime + FILES_MATCHING PATTERN "libpqtypes.so*" + ) if(EXISTS "${libpqtypes_base_path}/configure.ac") file(STRINGS "${libpqtypes_base_path}/configure.ac" libpqtypes_version_str REGEX "^AC_INIT[\t ]*\\([\t ]*libpqtypes[\t ]*,[\t ]*[0-9].*$") diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index a3f5ef8..e59e493 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -19,3 +19,9 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ${bare_name}-if PRIVATE ${YAMLCPP_LIBRARY} ) + +#install(TARGETS ${PROJECT_NAME} +# LIBRARY DESTINATION lib +# RUNTIME DESTINATION bin +# ARCHIVE DESTINATION lib/static +#) diff --git a/src/delete/CMakeLists.txt b/src/delete/CMakeLists.txt index b15b2aa..7d05e34 100644 --- a/src/delete/CMakeLists.txt +++ b/src/delete/CMakeLists.txt @@ -19,3 +19,9 @@ string(REPLACE "${bare_name}-" "" ACTION_NAME "${PROJECT_NAME}") target_compile_definitions(${PROJECT_NAME} PRIVATE ACTION_NAME="${ACTION_NAME}" ) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION ${ACTIONS_PATH_INSTALL} + ARCHIVE DESTINATION lib/static +) diff --git a/src/dindexerConfig.h.in b/src/dindexerConfig.h.in index 7179b3a..0422db1 100644 --- a/src/dindexerConfig.h.in +++ b/src/dindexerConfig.h.in @@ -25,7 +25,7 @@ #define VERSION_PATCH @PROJECT_VERSION_PATCH@ #define VERSION_GIT "@PROJECT_VERSION_GIT@" #define CONFIG_FILE_PATH "@DINDEXER_CONFIG_FILE@" -#define ACTIONS_SEARCH_PATH "@ACTIONS_PATH@" +#define ACTIONS_SEARCH_PATH "@DINDEXER_ACTIONS_PATH@" #define ACTION_PREFIX "@bare_name@-" #define DB_OWNER_NAME "@DB_OWNER_NAME@" diff --git a/src/locate/CMakeLists.txt b/src/locate/CMakeLists.txt index 439f414..77128dd 100644 --- a/src/locate/CMakeLists.txt +++ b/src/locate/CMakeLists.txt @@ -19,3 +19,9 @@ string(REPLACE "${bare_name}-" "" ACTION_NAME "${PROJECT_NAME}") target_compile_definitions(${PROJECT_NAME} PRIVATE ACTION_NAME="${ACTION_NAME}" ) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION ${ACTIONS_PATH_INSTALL} + ARCHIVE DESTINATION lib/static +) diff --git a/src/machinery/CMakeLists.txt b/src/machinery/CMakeLists.txt index 02a6ec6..a4c0882 100644 --- a/src/machinery/CMakeLists.txt +++ b/src/machinery/CMakeLists.txt @@ -38,3 +38,9 @@ if (DINDEXER_WITH_MEDIA_AUTODETECT) PRIVATE WITH_MEDIA_AUTODETECT ) endif() + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib/static +) diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index 766deba..5810cc5 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -21,3 +21,9 @@ if (DINDEXER_WITH_MEDIA_AUTODETECT) PRIVATE WITH_MEDIA_AUTODETECT ) endif() + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib/static +) diff --git a/src/navigate/CMakeLists.txt b/src/navigate/CMakeLists.txt index 5069141..8bb77d5 100644 --- a/src/navigate/CMakeLists.txt +++ b/src/navigate/CMakeLists.txt @@ -21,3 +21,9 @@ string(REPLACE "${bare_name}-" "" ACTION_NAME "${PROJECT_NAME}") target_compile_definitions(${PROJECT_NAME} PRIVATE ACTION_NAME="${ACTION_NAME}" ) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION ${ACTIONS_PATH_INSTALL} + ARCHIVE DESTINATION lib/static +) diff --git a/src/pq/CMakeLists.txt b/src/pq/CMakeLists.txt index 66903f1..8699637 100644 --- a/src/pq/CMakeLists.txt +++ b/src/pq/CMakeLists.txt @@ -14,3 +14,9 @@ target_link_libraries(${PROJECT_NAME} PRIVATE ${bare_name}-if PRIVATE pqtypes ) + +#install(TARGETS ${PROJECT_NAME} +# LIBRARY DESTINATION lib +# RUNTIME DESTINATION bin +# ARCHIVE DESTINATION lib/static +#) diff --git a/src/query/CMakeLists.txt b/src/query/CMakeLists.txt index 9ea78d9..4b04331 100644 --- a/src/query/CMakeLists.txt +++ b/src/query/CMakeLists.txt @@ -18,3 +18,9 @@ string(REPLACE "${bare_name}-" "" ACTION_NAME "${PROJECT_NAME}") target_compile_definitions(${PROJECT_NAME} PRIVATE ACTION_NAME="${ACTION_NAME}" ) + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION ${ACTIONS_PATH_INSTALL} + ARCHIVE DESTINATION lib/static +) diff --git a/src/scan/CMakeLists.txt b/src/scan/CMakeLists.txt index f76db69..e3e89f6 100644 --- a/src/scan/CMakeLists.txt +++ b/src/scan/CMakeLists.txt @@ -29,3 +29,9 @@ if (DINDEXER_WITH_MEDIA_AUTODETECT) PRIVATE WITH_MEDIA_AUTODETECT ) endif() + +install(TARGETS ${PROJECT_NAME} + LIBRARY DESTINATION lib + RUNTIME DESTINATION ${ACTIONS_PATH_INSTALL} + ARCHIVE DESTINATION lib/static +)