src/CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Mon, 10 Dec 2018 00:06:54 +0100
branchv_0
changeset 6 0f28565508ca
parent 3 8731263d44f1
child 7 aebaf590a838
permissions -rw-r--r--
create project (clone of tr-validator)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Relational pipes
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info)
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
a1301a106504 empty cmake project
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
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, either version 3 of the License, or
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
# (at your option) any later version.
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
#
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# This program is distributed in the hope that it will be useful,
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
# GNU General Public License for more details.
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
#
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# You should have received a copy of the GNU General Public License
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
6
0f28565508ca create project (clone of tr-validator)
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    17
set(EXECUTABLE_FILE "relpipe-tr-grep")
0
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
# Relpipe libraries:
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
INCLUDE(FindPkgConfig)
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
pkg_check_modules (RELPIPE_LIBS relpipe-lib-reader.cpp relpipe-lib-writer.cpp relpipe-lib-cli.cpp)
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
include_directories(${RELPIPE_LIBS_INCLUDE_DIRS})
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
link_directories(${RELPIPE_LIBS_LIBRARY_DIRS})
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
# Add ASan AddressSanitizer
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
# From ASan wiki: "To get nicer stack traces in error messages add -fno-omit-frame-pointer."
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
# Executable output:
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
add_executable(
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	${EXECUTABLE_FILE}
3
8731263d44f1 PassthroughHandler (string-based version)
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    33
	PassthroughHandler.h
6
0f28565508ca create project (clone of tr-validator)
František Kučera <franta-hg@frantovo.cz>
parents: 3
diff changeset
    34
	relpipe-tr-grep.cpp
0
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
)
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
# Link libraries:
a1301a106504 empty cmake project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIBS_LIBRARIES})