src/CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Thu, 06 Jun 2019 13:21:43 +0200
branchv_0
changeset 0 f28025ce355d
child 2 bca03092cdb6
permissions -rw-r--r--
empty GTK/cmake/netbeans project
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
# Relational pipes
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
# Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
f28025ce355d empty GTK/cmake/netbeans 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
f28025ce355d empty GTK/cmake/netbeans 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
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
# the Free Software Foundation, either version 3 of the License, or
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
# (at your option) any later version.
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
#
f28025ce355d empty GTK/cmake/netbeans 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,
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
# GNU General Public License for more details.
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
#
f28025ce355d empty GTK/cmake/netbeans 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
f28025ce355d empty GTK/cmake/netbeans 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/>.
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
set(EXECUTABLE_FILE "relpipe-out-gui")
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
# Relpipe libraries:
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
INCLUDE(FindPkgConfig)
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
pkg_check_modules (RELPIPE_LIBS relpipe-lib-reader.cpp relpipe-lib-cli.cpp gtkmm-3.0)
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
include_directories(${RELPIPE_LIBS_INCLUDE_DIRS})
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
link_directories(${RELPIPE_LIBS_LIBRARY_DIRS})
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
# Add ASan AddressSanitizer
f28025ce355d empty GTK/cmake/netbeans 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")
f28025ce355d empty GTK/cmake/netbeans 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")
f28025ce355d empty GTK/cmake/netbeans 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."
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
# Executable output:
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
add_executable(
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	${EXECUTABLE_FILE}
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
	relpipe-out-gui.cpp
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
)
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
# Link libraries:
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIBS_LIBRARIES})
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
f28025ce355d empty GTK/cmake/netbeans project
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
install(TARGETS ${EXECUTABLE_FILE} DESTINATION bin)