-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
75 lines (60 loc) · 2.28 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#=============================================================================
# SPDX-FileCopyrightText: 2021 Tomaz Canabrava <[email protected]>
# SPDX-FileCopyrightText: Alexander Lohnau <[email protected]>
#
# SPDX-License-Identifier: MIT
#=============================================================================
project(configurationGeneration)
cmake_minimum_required(VERSION 3.10)
if(EXISTS "${CMAKE_BINARY_DIR}/conan_paths.cmake")
message("Found conan paths")
include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/ConfigurationParser")
find_package(Qt6 COMPONENTS Core)
if (NOT Qt6_FOUND)
find_package(Qt5 REQUIRED COMPONENTS Core)
endif()
include_directories(.)
add_library(confgen_lib STATIC
parser/statemachine.cpp
common/string_helpers.cpp
common/dump_common.cpp
kconfig/dump_kconfig.cpp
qobject/dump_qobject.cpp
qsettings/dump_qsettings.cpp
)
target_link_libraries(confgen_lib Qt::Core)
add_executable(confgen
main.cpp
)
add_executable(ConfigurationParser::confgen ALIAS confgen)
target_link_libraries(confgen confgen_lib ${EXTRA_SYSTEM_LIBRARIES})
install(TARGETS confgen EXPORT ConfigurationParserTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/ConfigurationParser)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/ConfigurationParserConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/ConfigurationParserConfig.cmake"
INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}")
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/ConfigurationParserConfigVersion.cmake"
VERSION "0.0.1"
COMPATIBILITY ExactVersion
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/ConfigurationParserConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/ConfigurationParserConfigVersion.cmake"
"cmake/ConfigurationCompiler.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}")
install(EXPORT ConfigurationParserTargets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE ConfigurationParserTargets.cmake
NAMESPACE ConfigurationParser:: )
if (ENABLE_TESTING)
enable_testing()
add_subdirectory(test)
endif()