kdelibs/kunitconversion/CMakeLists.txt
Ivailo Monev 6ad8959836 generic: fix some tests build after 1f34f5ad
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2016-05-03 01:14:03 +00:00

105 lines
2.1 KiB
CMake

project(kunitconversion)
if(KDE_PLATFORM_FEATURE_BINARY_COMPATIBLE_FEATURE_REDUCTION)
set(KUNITCONVERSION_NO_SOLID TRUE)
set(KUNITCONVERSION_NO_KIO TRUE)
endif()
configure_file(
config-kunitconversion.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-kunitconversion.h
)
set(kunitconversion_LIB_SRCS
converter.cpp
value.cpp
unit.cpp
unitcategory.cpp
length.cpp
area.cpp
volume.cpp
temperature.cpp
velocity.cpp
mass.cpp
pressure.cpp
energy.cpp
currency.cpp
power.cpp
timeunit.cpp
fuel_efficiency.cpp
density.cpp
acceleration.cpp
force.cpp
angle.cpp
frequency.cpp
)
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=930)
if(NOT KUNITCONVERSION_NO_KIO)
include_directories(${KDE4_KIO_INCLUDES})
set(KUNITCONVERSION_EXTRA_LIBS
${KUNITCONVERSION_EXTRA_LIBS}
${KDE4_KIO_LIBS}
)
else()
set(KUNITCONVERSION_EXTRA_LIBS
${KUNITCONVERSION_EXTRA_LIBS}
${QT_QTNETWORK_LIBRARY}
${QT_QTXML_LIBRARY}
)
endif()
if(NOT KUNITCONVERSION_NO_SOLID)
include_directories(
${CMAKE_BINARY_DIR}/solid
${CMAKE_SOURCE_DIR}/solid
)
set(KUNITCONVERSION_EXTRA_LIBS
${KUNITCONVERSION_EXTRA_LIBS}
${KDE4_SOLID_LIBS}
)
endif()
include_directories(
${CMAKE_SOURCE_DIR}
# for the export header
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_KDECORE_INCLUDES}
${KDE4_KDEUI_INCLUDES}
)
add_library(kunitconversion ${LIBRARY_TYPE} ${kunitconversion_LIB_SRCS})
target_link_libraries(kunitconversion
${KDE4_KDECORE_LIBS}
${KUNITCONVERSION_EXTRA_LIBS}
)
set_target_properties(kunitconversion PROPERTIES
VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
)
install(
TARGETS kunitconversion
EXPORT kdelibsLibraryTargets
${INSTALL_TARGETS_DEFAULT_ARGS}
)
generate_export_header(kunitconversion)
install(
FILES
converter.h
value.h
unit.h
unitcategory.h
${CMAKE_CURRENT_BINARY_DIR}/kunitconversion_export.h
DESTINATION ${INCLUDE_INSTALL_DIR}/kunitconversion
COMPONENT Devel
)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()