Commit ebfb644c authored by Nicolas Fella's avatar Nicolas Fella Committed by Albert Astals Cid
Browse files

Make knumber a static library

Since it is used by both the executable and the test

Simplifies the code a bit
parent 3830d4bd
......@@ -73,23 +73,9 @@ check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
configure_file(config-kcalc.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kcalc.h )
include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/knumber ${GMP_INCLUDE_DIR} )
########### next target ###############
# Needs absolute paths due to the test program for knumber
set(libknumber_la_SRCS
${kcalc_SOURCE_DIR}/knumber/knumber.cpp
${kcalc_SOURCE_DIR}/knumber/knumber_error.cpp
${kcalc_SOURCE_DIR}/knumber/knumber_float.cpp
${kcalc_SOURCE_DIR}/knumber/knumber_fraction.cpp
${kcalc_SOURCE_DIR}/knumber/knumber_integer.cpp
${kcalc_SOURCE_DIR}/knumber/knumber_operators.cpp
)
add_subdirectory( knumber )
# add_subdirectory( tests )
add_subdirectory(knumber)
set(kcalc_KDEINIT_SRCS ${libknumber_la_SRCS}
set(kcalc_KDEINIT_SRCS
kcalc.cpp
bitbutton.cpp
kcalc_bitset.cpp
......@@ -133,8 +119,7 @@ target_link_libraries(kdeinit_kcalc
KF5::Notifications
KF5::XmlGui
KF5::Crash
${GMP_LIBRARIES}
${MPFR_LIBRARIES}
knumber
)
install(TARGETS kdeinit_kcalc ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
add_library(knumber STATIC
knumber.cpp
knumber_error.cpp
knumber_float.cpp
knumber_fraction.cpp
knumber_integer.cpp
knumber_operators.cpp
)
target_include_directories(knumber PUBLIC ${CMAKE_BINARY_DIR})
target_link_libraries(knumber PUBLIC Qt5::Core PRIVATE ${GMP_LIBRARIES} ${MPFR_LIBRARIES})
add_subdirectory( tests )
include_directories( ${CMAKE_SOURCE_DIR}/knumber )
include(ECMAddTests)
list(APPEND knumbertest_LIBS Qt5::Core ${MPFR_LIBRARIES} ${GMP_LIBRARIES})
ecm_add_test(knumbertest.cpp ${libknumber_la_SRCS}
LINK_LIBRARIES ${knumbertest_LIBS}
ecm_add_test(knumbertest.cpp
LINK_LIBRARIES knumber
TEST_NAME knumbertest
)
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