src/CMakeLists.txt
branchv_0
changeset 0 a37196931f63
child 4 a0689654b3c2
equal deleted inserted replaced
-1:000000000000 0:a37196931f63
       
     1 # Relational pipes
       
     2 # Copyright © 2018 František Kučera (Frantovo.cz, GlobalCode.info)
       
     3 #
       
     4 # This program is free software: you can redistribute it and/or modify
       
     5 # it under the terms of the GNU General Public License as published by
       
     6 # the Free Software Foundation, either version 3 of the License, or
       
     7 # (at your option) any later version.
       
     8 #
       
     9 # This program is distributed in the hope that it will be useful,
       
    10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
       
    12 # GNU General Public License for more details.
       
    13 #
       
    14 # You should have received a copy of the GNU General Public License
       
    15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
       
    16 
       
    17 set(EXECUTABLE_FILE "relpipe-in-xmltable")
       
    18 
       
    19 # Relpipe libraries:
       
    20 INCLUDE(FindPkgConfig)
       
    21 pkg_check_modules (RELPIPE_LIBS relpipe-lib-writer.cpp relpipe-lib-cli.cpp libxml++-2.6)
       
    22 include_directories(${RELPIPE_LIBS_INCLUDE_DIRS})
       
    23 link_directories(${RELPIPE_LIBS_LIBRARY_DIRS})
       
    24 
       
    25 # Add ASan AddressSanitizer
       
    26 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
       
    27 set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
       
    28 # From ASan wiki: "To get nicer stack traces in error messages add -fno-omit-frame-pointer."
       
    29 
       
    30 # Executable output:
       
    31 add_executable(
       
    32 	${EXECUTABLE_FILE}
       
    33 	relpipe-in-xmltable.cpp
       
    34 )
       
    35 
       
    36 # Link libraries:
       
    37 target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIBS_LIBRARIES})
       
    38 set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
       
    39 
       
    40 install(TARGETS ${EXECUTABLE_FILE} DESTINATION bin)