-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
34 lines (25 loc) · 970 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.14)
project(QI18n
LANGUAGES CXX
VERSION 1.0.0)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
message("Building ${PROJECT_NAME} using Qt${QT_VERSION_MAJOR}")
set(TARGET_NAME Qt${QT_VERSION_MAJOR}I18n)
add_library(${TARGET_NAME} SHARED
QI18n_global.h
qi18n.cpp
qi18n.h
)
target_link_libraries(${TARGET_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core)
target_compile_definitions(${TARGET_NAME} PRIVATE QI18N_LIBRARY)
configure_file(QI18n.pc.in Qt${QT_VERSION_MAJOR}I18n.pc @ONLY)
install(FILES qi18n.h QI18n_global.h DESTINATION include/)
install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION lib)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Qt${QT_VERSION_MAJOR}I18n.pc DESTINATION lib/pkgconfig)