aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2015-06-21 02:14:54 +0200
committerAleix Pol <aleixpol@kde.org>2015-06-21 02:14:54 +0200
commit173b33592739f9a671f34eb816499ef32fe65c06 (patch)
treed4dd33cee0d95dc5a3ef2b4ab023ba922af86e7e
parenta5bb0860caf443cb89a7d4b67a040485e7509e74 (diff)
downloadkconfig-173b33592739f9a671f34eb816499ef32fe65c06.tar.gz
kconfig-173b33592739f9a671f34eb816499ef32fe65c06.tar.bz2
Make it possible to use kconfig_compiler from different sources
This way we can specify the used tooling targets to be used, useful if we're cross-compiling, since we get to use the tooling that runs in the local platform. REVIEW: 124104
-rw-r--r--CMakeLists.txt3
-rw-r--r--KF5ConfigConfig.cmake.in7
-rw-r--r--src/kconfig_compiler/CMakeLists.txt11
3 files changed, 18 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f510e3ea..b44fbf24 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,6 +61,9 @@ install(EXPORT KF5ConfigTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE KF5ConfigTargets.cmake NAMESPACE KF5:: COMPONENT Devel)
+install(EXPORT KF5ConfigCompilerTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ FILE KF5ConfigCompilerTargets.cmake NAMESPACE KF5:: COMPONENT Devel)
+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kconfig_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel )
diff --git a/KF5ConfigConfig.cmake.in b/KF5ConfigConfig.cmake.in
index b4e5f565..c1dd9af9 100644
--- a/KF5ConfigConfig.cmake.in
+++ b/KF5ConfigConfig.cmake.in
@@ -2,9 +2,14 @@
# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file.
-
include("${CMAKE_CURRENT_LIST_DIR}/KF5ConfigTargets.cmake")
find_dependency(Qt5Xml "@REQUIRED_QT_VERSION@")
+if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING)
+ find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH)
+ include("${TARGETSFILE}")
+else()
+ include("${CMAKE_CURRENT_LIST_DIR}/KF5ConfigCompilerTargets.cmake")
+endif()
include("${CMAKE_CURRENT_LIST_DIR}/KF5ConfigMacros.cmake")
diff --git a/src/kconfig_compiler/CMakeLists.txt b/src/kconfig_compiler/CMakeLists.txt
index ec4a7335..0937f578 100644
--- a/src/kconfig_compiler/CMakeLists.txt
+++ b/src/kconfig_compiler/CMakeLists.txt
@@ -7,10 +7,17 @@ add_executable(kconfig_compiler ${kconfig_compiler_SRCS})
set_target_properties(kconfig_compiler PROPERTIES
OUTPUT_NAME "kconfig_compiler_kf5"
)
-add_executable(KF5::kconfig_compiler ALIAS kconfig_compiler)
+
+if(CMAKE_TOOLCHAIN_FILE)
+ if(BUILD_TESTING)
+ message("Testing should be disabled on cross-compilation")
+ endif()
+else()
+ add_executable(KF5::kconfig_compiler ALIAS kconfig_compiler)
+endif()
find_package(Qt5Xml 5.2.0 REQUIRED NO_MODULE)
target_link_libraries(kconfig_compiler Qt5::Xml)
-install(TARGETS kconfig_compiler EXPORT KF5ConfigTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS kconfig_compiler EXPORT KF5ConfigCompilerTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})