src/CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Mar 2022 02:19:39 +0100
branchv_0
changeset 21 1a4174f4693a
parent 5 165f6162524d
permissions -rw-r--r--
generate random request ID (UUID) if missing
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Relational pipes
5
165f6162524d introduce HTTPClient wrapper around CURL
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
     2
# Copyright © 2022 František Kučera (Frantovo.cz, GlobalCode.info)
0
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
# it under the terms of the GNU General Public License as published by
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, version 3 of the License.
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
set(EXECUTABLE_FILE "relpipe-tr-http")
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
# Relpipe libraries:
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
INCLUDE(FindPkgConfig)
21
1a4174f4693a generate random request ID (UUID) if missing
František Kučera <franta-hg@frantovo.cz>
parents: 5
diff changeset
    20
pkg_check_modules (RELPIPE_LIBS relpipe-lib-reader.cpp relpipe-lib-writer.cpp relpipe-lib-cli.cpp libcurl uuid)
0
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
include_directories(${RELPIPE_LIBS_INCLUDE_DIRS})
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
link_directories(${RELPIPE_LIBS_LIBRARY_DIRS})
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
# Add ASan AddressSanitizer
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
# From ASan wiki: "To get nicer stack traces in error messages add -fno-omit-frame-pointer."
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
# Executable output:
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
add_executable(
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	${EXECUTABLE_FILE}
5
165f6162524d introduce HTTPClient wrapper around CURL
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
    32
	HTTPClient.cpp
0
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	relpipe-tr-http.cpp
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
)
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
# Link libraries:
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIBS_LIBRARIES})
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
ce520a238309 new project relpipe-tr-http
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
install(TARGETS ${EXECUTABLE_FILE} DESTINATION bin)