Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
KCalc
Commits
ebfb644c
Commit
ebfb644c
authored
Feb 06, 2021
by
Nicolas Fella
Committed by
Albert Astals Cid
Feb 09, 2021
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
ebfb644c
...
...
@@ -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
}
)
...
...
knumber/CMakeLists.txt
View file @
ebfb644c
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
)
knumber/tests/CMakeLists.txt
View file @
ebfb644c
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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment