Skip to content

Commit

Permalink
CMake: remove custom pq module and outdated ENABLE_LIBS_PACKAGING flag
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
  • Loading branch information
lebdron committed Dec 25, 2019
1 parent e6f9515 commit 16dbbe6
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 159 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ option(PACKAGE_ZIP "Create ZIP package" OFF)
option(PACKAGE_TGZ "Create TGZ package" OFF)
option(PACKAGE_RPM "Create RPM package" OFF)
option(PACKAGE_DEB "Create DEB package" OFF)
option(ENABLE_LIBS_PACKAGING "Enable libs packaging" ON)
option(USE_LIBURSA "Use Hyperledger Ursa cryptography" OFF)
option(SANITIZE_THREAD "Build with thread sanitizer" OFF)
option(SANITIZE_ADDRESS "Build with address sanitizer" OFF)
Expand Down Expand Up @@ -149,7 +148,6 @@ message(STATUS "-DPACKAGE_ZIP=${PACKAGE_ZIP}")
message(STATUS "-DPACKAGE_TGZ=${PACKAGE_TGZ}")
message(STATUS "-DPACKAGE_RPM=${PACKAGE_RPM}")
message(STATUS "-DPACKAGE_DEB=${PACKAGE_DEB}")
message(STATUS "-DENABLE_LIBS_PACKAGING=${ENABLE_LIBS_PACKAGING}")
message(STATUS "-DSANITIZE_THREAD=${SANITIZE_THREAD}")
message(STATUS "-DSANITIZE_ADDRESS=${SANITIZE_ADDRESS}")
message(STATUS "-DSANITIZE_MEMORY=${SANITIZE_MEMORY}")
Expand Down
85 changes: 0 additions & 85 deletions cmake/Modules/Findpq.cmake

This file was deleted.

4 changes: 0 additions & 4 deletions cmake/Modules/Findprotobuf-mutator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,3 @@ set_target_properties(protobuf-mutator PROPERTIES
INTERFACE_LINK_LIBRARIES ${protobuf_mutator_LIBRARY}
IMPORTED_LOCATION ${binary_dir}/src/libfuzzer/${libfuzzer_LIB}
)

if(ENABLE_LIBS_PACKAGING)
add_install_step_for_lib(${protobuf_mutator_LIBRARY})
endif()
56 changes: 1 addition & 55 deletions cmake/Modules/Findsoci.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,55 +32,6 @@ mark_as_advanced(SOCI_LIBRARY_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(soci DEFAULT_MSG ${_SOCI_REQUIRED_VARS})

set(URL https://github.com/SOCI/soci)
set(VERSION 349ce86b79e63b99ba95200bc4bd1d83791e9094)
set_target_description(soci "The C++ Database Access Library" ${URL} ${VERSION})

if (NOT soci_FOUND)
SET(CMAKE_CXX_SOCI_FLAGS "${CMAKE_CXX_FLAGS} -I${postgres_INCLUDE_DIR}")
externalproject_add(soci_soci
GIT_REPOSITORY ${URL}
GIT_TAG ${VERSION}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-G${CMAKE_GENERATOR}
-H${EP_PREFIX}/src/soci_soci
-B${EP_PREFIX}/src/soci_soci-build
-DCMAKE_INCLUDE_PATH=${pq_INCLUDE_DIR}
-DCMAKE_LIBRARY_PATH=${pq_INCLUDE_DIR}
-DCMAKE_PROGRAM_PATH=${pg_config_EXECUTABLE_DIR}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_SOCI_FLAGS}
-DCMAKE_INSTALL_PREFIX=${EP_PREFIX}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DSOCI_CXX_C11=ON
-DSOCI_TESTS=OFF
-DSOCI_EMPTY=OFF
-DWITH_BOOST=ON
-DWITH_DB2=OFF
-DWITH_FIREBIRD=OFF
-DWITH_MYSQL=OFF
-DWITH_ODBC=OFF
-DWITH_ORACLE=OFF
-DWITH_POSTGRESQL=ON
-DWITH_SQLITE3=OFF
BUILD_BYPRODUCTS ${EP_PREFIX}/src/soci_soci-build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}soci_core${CMAKE_STATIC_LIBRARY_SUFFIX}
${EP_PREFIX}/src/soci_soci-build/lib/${CMAKE_STATIC_LIBRARY_PREFIX}soci_postgresql${CMAKE_STATIC_LIBRARY_SUFFIX}
TEST_COMMAND "" # remove test step
UPDATE_COMMAND "" # remove update step
)
externalproject_get_property(soci_soci binary_dir)
set(SOCI_INCLUDE_DIRS ${EP_PREFIX}/include ${EP_PREFIX}/include/soci)
set(SOCI_LIBRARY ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}soci_core${CMAKE_STATIC_LIBRARY_SUFFIX})
set(SOCI_postgresql_PLUGIN ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}soci_postgresql${CMAKE_STATIC_LIBRARY_SUFFIX})
file(MAKE_DIRECTORY ${EP_PREFIX}/include/soci)

add_dependencies(soci_soci pq)
add_dependencies(SOCI::core soci_soci)
add_dependencies(SOCI::postgresql soci_soci)
endif ()

set_target_properties(SOCI::core PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SOCI_INCLUDE_DIRS}"
IMPORTED_LOCATION "${SOCI_LIBRARY}"
Expand All @@ -95,10 +46,5 @@ endif ()
set_target_properties(SOCI::postgresql PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SOCI_INCLUDE_DIRS}"
IMPORTED_LOCATION "${SOCI_postgresql_PLUGIN}"
INTERFACE_LINK_LIBRARIES pq
INTERFACE_LINK_LIBRARIES PostgreSQL::PostgreSQL
)

if(ENABLE_LIBS_PACKAGING)
add_install_step_for_lib(${SOCI_LIBRARY})
add_install_step_for_lib(${SOCI_postgresql_PLUGIN})
endif()
16 changes: 8 additions & 8 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ set_target_properties(RapidJSON::rapidjson PROPERTIES
)

##########################
# pq #
# libpq #
##########################
find_package(pq)
find_package(PostgreSQL REQUIRED)

find_package(OpenSSL REQUIRED)
target_link_libraries(PostgreSQL::PostgreSQL
INTERFACE
OpenSSL::SSL
)

##########################
# SOCI #
Expand Down Expand Up @@ -76,12 +82,6 @@ find_package(Boost 1.65.0 REQUIRED
thread
)

if(ENABLE_LIBS_PACKAGING)
foreach (library ${Boost_LIBRARIES})
add_install_step_for_lib(${library})
endforeach(library)
endif()

##########################
# benchmark #
##########################
Expand Down
1 change: 0 additions & 1 deletion cmake/release/linux/deb/iroha.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ else()

set(CPACK_DEBIAN_PACKAGE_NAME iroha )
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${arch}) # dpkg --print-architecture
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libtbb-dev, libpq-dev")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ON)
Expand Down
2 changes: 1 addition & 1 deletion cmake/release/linux/rpm/iroha.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ else()
message(STATUS "[package] linux-rpm standalone will be packaged.")

SET(CPACK_RPM_PACKAGE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
SET(CPACK_RPM_PACKAGE_REQUIRES "libstdc++5, libpq-dev, libtbb-dev, libboost-system-dev, libboost-filesystem-dev, libc-ares-dev")
SET(CPACK_RPM_PACKAGE_REQUIRES "libstdc++5")
endif()
4 changes: 1 addition & 3 deletions docs/source/build/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,7 @@ Packaging Specific Parameters
+-----------------------+-----------------+---------+--------------------------------------------+
| Parameter | Possible values | Default | Description |
+=======================+=================+=========+============================================+
| ENABLE_LIBS_PACKAGING | ON/OFF | ON | Enables or disables all types of packaging |
+-----------------------+ +---------+--------------------------------------------+
| PACKAGE_ZIP | | OFF | Enables or disables zip packaging |
| PACKAGE_ZIP | ON/OFF | OFF | Enables or disables zip packaging |
+-----------------------+ +---------+--------------------------------------------+
| PACKAGE_TGZ | | OFF | Enables or disables tar.gz packaging |
+-----------------------+ +---------+--------------------------------------------+
Expand Down

0 comments on commit 16dbbe6

Please sign in to comment.