src/CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Thu, 03 Dec 2020 17:16:09 +0100
branchv_0
changeset 1 8d2d8f4077af
parent 0 66a454290286
child 8 35696fee5662
permissions -rw-r--r--
OOP wrapper for yaml.h + list event types
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Relational pipes
1
8d2d8f4077af OOP wrapper for yaml.h + list event types
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
     2
# Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info)
0
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
66a454290286 project skeleton
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
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, version 3 of the License.
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
set(EXECUTABLE_FILE "relpipe-in-yaml")
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
set(EXECUTABLE_FILE_JSON "relpipe-in-json")
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
# Relpipe libraries:
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
INCLUDE(FindPkgConfig)
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
pkg_check_modules (RELPIPE_LIBS relpipe-lib-writer.cpp relpipe-lib-cli.cpp yaml-0.1)
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
include_directories(${RELPIPE_LIBS_INCLUDE_DIRS})
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
link_directories(${RELPIPE_LIBS_LIBRARY_DIRS})
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
# Add ASan AddressSanitizer
66a454290286 project skeleton
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")
66a454290286 project skeleton
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")
66a454290286 project skeleton
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."
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
# Executable output:
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
add_executable(
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	${EXECUTABLE_FILE}
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	relpipe-in-yaml.cpp
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
)
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
ADD_CUSTOM_TARGET(in_mode_symlink ALL COMMAND ${CMAKE_COMMAND} -E create_symlink ${EXECUTABLE_FILE} ${EXECUTABLE_FILE_JSON})
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
# Link libraries:
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIBS_LIBRARIES})
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
66a454290286 project skeleton
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
install(TARGETS ${EXECUTABLE_FILE} DESTINATION bin)