Debian Codegraph @

examples/CMakeLists.txt

raw
1 #
2 # %injeqt copyright begin%
3 # Copyright 2014 Rafał Malinowski ([email protected])
4 # %injeqt copyright end%
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #
20
21 find_package(Qt5Test 5.2 REQUIRED)
22
23 include_directories(
24 ${CMAKE_SOURCE_DIR}/src
25 )
26
27 function (injeqt_add_example name_)
28 file (RELATIVE_PATH sourcePath "${CMAKE_SOURCE_DIR}/examples" "${CMAKE_CURRENT_SOURCE_DIR}")
29
30 get_filename_component (exeDir "${CMAKE_CURRENT_BINARY_DIR}/${name_}" PATH)
31 file (MAKE_DIRECTORY "${exeDir}")
32
33 add_executable (${name_} ${ARGN})
34 target_link_libraries (${name_} injeqt)
35 set_property (TARGET ${name_} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-error")
36 qt5_use_modules (${name_} Core)
37 endfunction ()
38
39 injeqt_add_example(hello-world-example hello-world.cpp)