Commit c5c26762 authored by Daan De Meyer's avatar Daan De Meyer

Rename kate target to kate-lib to fix Windows compilation error

parent a167b312
# We use an intermediate static library because linking tests directly to an executable is not # We use an intermediate static library because linking tests directly to an executable is not
# possible with CMake yet. # possible with CMake yet.
add_library(kate STATIC "") add_library(kate-lib STATIC "")
configure_file(config.h.in config.h) configure_file(config.h.in config.h)
include(GenerateExportHeader) include(GenerateExportHeader)
generate_export_header( generate_export_header(
kate kate-lib
EXPORT_FILE_NAME katetests_export.h EXPORT_FILE_NAME katetests_export.h
EXPORT_MACRO_NAME KATE_TESTS_EXPORT EXPORT_MACRO_NAME KATE_TESTS_EXPORT
) )
target_include_directories( target_include_directories(
kate kate-lib
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/session ${CMAKE_CURRENT_SOURCE_DIR}/session
...@@ -35,7 +35,7 @@ find_package( ...@@ -35,7 +35,7 @@ find_package(
) )
target_link_libraries( target_link_libraries(
kate kate-lib
PUBLIC PUBLIC
KF5::TextEditor KF5::TextEditor
KF5::IconThemes KF5::IconThemes
...@@ -45,11 +45,11 @@ target_link_libraries( ...@@ -45,11 +45,11 @@ target_link_libraries(
) )
if(KF5Activities_FOUND) if(KF5Activities_FOUND)
target_link_libraries(kate PUBLIC KF5::Activities) target_link_libraries(kate-lib PUBLIC KF5::Activities)
endif() endif()
ki18n_wrap_ui(UI_SOURCES ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui) ki18n_wrap_ui(UI_SOURCES ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui)
target_sources(kate PRIVATE ${UI_SOURCES}) target_sources(kate-lib PRIVATE ${UI_SOURCES})
set(ICONS_PNG set(ICONS_PNG
${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kate.png ${CMAKE_CURRENT_SOURCE_DIR}/icons/16-apps-kate.png
...@@ -64,10 +64,10 @@ set(ICONS_SVG ${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kate.svgz) ...@@ -64,10 +64,10 @@ set(ICONS_SVG ${CMAKE_CURRENT_SOURCE_DIR}/icons/sc-apps-kate.svgz)
# Add icon files to the application's source files to have CMake bundle them in the executable. # Add icon files to the application's source files to have CMake bundle them in the executable.
ecm_add_app_icon(ICONS_SOURCES ICONS ${ICONS_PNG}) ecm_add_app_icon(ICONS_SOURCES ICONS ${ICONS_PNG})
target_sources(kate PRIVATE ${ICONS_SOURCES}) target_sources(kate-lib PRIVATE ${ICONS_SOURCES})
target_sources( target_sources(
kate kate-lib
PRIVATE PRIVATE
data/kate.qrc data/kate.qrc
...@@ -100,10 +100,10 @@ target_sources( ...@@ -100,10 +100,10 @@ target_sources(
# Use a single application on MacOS + Windows instead of dbus. # Use a single application on MacOS + Windows instead of dbus.
if(APPLE OR WIN32) if(APPLE OR WIN32)
target_compile_definitions(kate PRIVATE USE_QT_SINGLE_APP) target_compile_definitions(kate-lib PRIVATE USE_QT_SINGLE_APP)
target_sources( target_sources(
kate kate-lib
PRIVATE PRIVATE
qtsingleapplication/qtlocalpeer.cpp qtsingleapplication/qtlocalpeer.cpp
qtsingleapplication/qtsingleapplication.cpp qtsingleapplication/qtsingleapplication.cpp
...@@ -111,15 +111,15 @@ if(APPLE OR WIN32) ...@@ -111,15 +111,15 @@ if(APPLE OR WIN32)
) )
if(WIN32) if(WIN32)
target_sources(kate PRIVATE qtsingleapplication/qtlockedfile_win.cpp) target_sources(kate-lib PRIVATE qtsingleapplication/qtlockedfile_win.cpp)
else() else()
target_sources(kate PRIVATE qtsingleapplication/qtlockedfile_unix.cpp) target_sources(kate-lib PRIVATE qtsingleapplication/qtlockedfile_unix.cpp)
endif() endif()
endif() endif()
# Executable only adds the main definition. # Executable only adds the main definition.
add_executable(kate-bin main.cpp) add_executable(kate-bin main.cpp)
target_link_libraries(kate-bin PRIVATE kate) target_link_libraries(kate-bin PRIVATE kate-lib)
set_property( set_property(
TARGET kate-bin TARGET kate-bin
......
...@@ -9,7 +9,7 @@ macro(kate_executable_tests) ...@@ -9,7 +9,7 @@ macro(kate_executable_tests)
target_link_libraries( target_link_libraries(
${_testname} ${_testname}
PRIVATE PRIVATE
kate kate-lib
Qt5::Test Qt5::Test
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment