src/CMakeLists.txt
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Oct 2019 21:50:31 +0200
branchv_0
changeset 8 1dab2b99f51d
parent 1 ac5f3768ebb1
permissions -rw-r--r--
fix license version: GNU GPLv3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
     1
# Spacenav lib hack
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
     2
# Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
0
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
#
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
# This program is free software: you can redistribute it and/or modify
37aa134ae57b empty QT project linked to spnav library
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
8
1dab2b99f51d fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents: 1
diff changeset
     6
# the Free Software Foundation, version 3 of the License.
0
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
#
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
# This program is distributed in the hope that it will be useful,
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
# GNU General Public License for more details.
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
#
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
# You should have received a copy of the GNU General Public License
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
1
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    16
set(LIBRARY_FILE spnav-lib-hack)
0
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
# Add ASan AddressSanitizer
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
# From ASan wiki: "To get nicer stack traces in error messages add -fno-omit-frame-pointer."
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
# Executable output:
1
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    24
add_library(
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    25
	${LIBRARY_FILE} SHARED
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    26
	spacenav-lib-hack.h
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    27
	spacenav-lib-hack.c
0
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
)
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
# Link libraries:
1
ac5f3768ebb1 almost working, but there is an SIGABRT
František Kučera <franta-hg@frantovo.cz>
parents: 0
diff changeset
    31
target_link_libraries(${LIBRARY_FILE} -ldl -lX11 -lm -lspnav)
0
37aa134ae57b empty QT project linked to spnav library
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32