Commit 0e0a42d32412cc509c61ad82e9ab6178ff86c2b2

Authored by Peter M. Groen
1 parent a03706ad

Initial setup

Showing 1 changed file with 51 additions and 0 deletions
CMakeLists.txt
  1 +#
  2 +# Copyright (c) 2022 Peter M. Groen
  3 +#
  4 +# This source code is licensed under the MIT license found in the
  5 +# LICENSE file in the root directory of this source tree.
  6 +#
  7 +cmake_minimum_required(VERSION 3.16)
  8 +LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/submodules/cmake)
1 9  
  10 +include(projectheader)
  11 +project_header(calcprimes)
  12 +
  13 +find_package( Qt5Core REQUIRED )
  14 +find_package( Qt5Gui REQUIRED )
  15 +find_package( Qt5Widgets REQUIRED )
  16 +
  17 +include_directories( SYSTEM
  18 + ${Qt5Core_INCLUDE_DIRS}
  19 + ${Qt5Gui_INCLUDE_DIRS}
  20 + ${Qt5Widgets_INCLUDE_DIRS}
  21 +)
  22 +
  23 +include(compiler)
  24 +
  25 +set(SRC_LIST
  26 + ${CMAKE_SOURCE_DIR}/src/main.cpp
  27 +)
  28 +
  29 +include(qtmoc)
  30 +create_mocs( SRC_LIST MOC_LIST
  31 + # ${CMAKE_SOURCE_DIR}/<moc_header.h>
  32 +)
  33 +
  34 +add_executable( ${PROJECT_NAME}
  35 + ${SRC_LIST}
  36 +)
  37 +
  38 +target_link_libraries(
  39 + ${PROJECT_NAME}
  40 + ${Qt5Core_LIBRARIES}
  41 + ${Qt5Gui_LIBRARIES}
  42 + ${Qt5Widgets_LIBRARIES}
  43 +)
  44 +
  45 +set_target_properties( ${PROJECT_NAME} PROPERTIES
  46 + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
  47 + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
  48 + ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/archive
  49 +)
  50 +
  51 +include(installation)
  52 +install_application()
... ...