84 lines
2.4 KiB
CMake
84 lines
2.4 KiB
CMake
cmake_minimum_required(VERSION 3.0)
|
|
cmake_policy(SET CMP0017 NEW) # need include() with .cmake
|
|
cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default
|
|
project(qad)
|
|
set(qad_MAJOR 2)
|
|
set(qad_MINOR 6)
|
|
set(qad_REVISION 0)
|
|
set(qad_SUFFIX )
|
|
set(qad_COMPANY SHS)
|
|
set(qad_DOMAIN org.SHS)
|
|
|
|
if ("x${CMAKE_MODULE_PATH}" STREQUAL "x")
|
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
endif()
|
|
|
|
include(SHSTKMacros)
|
|
include(QtWraps)
|
|
shstk_begin_project(qad QAD)
|
|
include(SHSTKQtMacros)
|
|
|
|
shstk_qt_founded(QtVersions)
|
|
foreach(_v ${_QT_VERSIONS_})
|
|
#message("Qt ${_v} -> ${QtVersions}")
|
|
option(Qt${_v} "Build for Qt${_v}" ON)
|
|
endforeach()
|
|
|
|
if (NOT DEFINED ANDROID_PLATFORM)
|
|
find_package(OpenGL REQUIRED)
|
|
endif()
|
|
#include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
option(UTILS "Build various utils" ${_plugins_default_})
|
|
option(DESIGNER_PLUGINS "Build Qt designer plugins" ${_plugins_default_})
|
|
option(HAS_GL "Build with OpenGL" ${_plugins_default_})
|
|
|
|
macro(qad_library NAME _MODULES _LIBS)
|
|
shstk_qad_project(qad_${NAME} FALSE "qad" "${_MODULES}" "${_LIBS}" ${ARGN})
|
|
shstk_qad_install("qad" FALSE qad_${NAME} "${out_HDR}" "out_QM")
|
|
endmacro()
|
|
|
|
macro(qad_application NAME _MODULES _LIBS)
|
|
shstk_qad_project(${NAME} TRUE "qad" "${_MODULES}" "${_LIBS}" ${ARGN})
|
|
shstk_qad_install("qad" TRUE ${NAME} "" "out_QM")
|
|
endmacro()
|
|
|
|
macro(qad_plugin NAME _MODULES _LIBS)
|
|
shstk_qad_plugin(qad_${NAME} "${_MODULES}" "qad_${NAME};${_LIBS}")
|
|
endmacro()
|
|
|
|
shstk_install(qad FALSE "" "${qad_VERSION_FILE}")
|
|
file(GLOB CMAKES "cmake/*.cmake" "cmake/*.in")
|
|
install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules)
|
|
|
|
add_subdirectory(libs)
|
|
if (UTILS)
|
|
add_subdirectory(utils)
|
|
endif()
|
|
|
|
message("----------QAD----------")
|
|
message(" Build for ${QtVersions}")
|
|
message(" Version: ${qad_VERSION} ")
|
|
message(" Linkage: ${qad_LIB_TYPE_MSG}")
|
|
message(" Type : ${qad_BUILD_TYPE}")
|
|
if (NOT LOCAL)
|
|
message(" Install: \"${CMAKE_INSTALL_PREFIX}\"")
|
|
else()
|
|
if(NOT PIP_FREERTOS)
|
|
message(" Install: local \"bin\", \"lib\" and \"include\"")
|
|
endif()
|
|
endif()
|
|
message("")
|
|
print_list("${_qt_libs}" " Libraries:" " * ")
|
|
if (NOT "x${_qt_plugs}" STREQUAL "x")
|
|
message("")
|
|
print_list("${_qt_plugs}" " Plugins:" " * ")
|
|
endif()
|
|
if (NOT "x${_qt_apps}" STREQUAL "x")
|
|
message("")
|
|
print_list("${_qt_apps}" " Applications:" " * ")
|
|
endif()
|
|
message("-----------------------")
|
|
|
|
shstk_copy_to_parent()
|