Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt
5018 views
1
add_library(MathFunctions)
2
3
target_sources(MathFunctions
4
PRIVATE
5
MathFunctions.cxx
6
7
PUBLIC
8
FILE_SET HEADERS
9
FILES
10
MathFunctions.h
11
)
12
13
target_link_libraries(MathFunctions
14
PRIVATE
15
MathLogger
16
17
PUBLIC
18
OpAdd
19
OpMul
20
OpSub
21
)
22
23
target_compile_features(MathFunctions PRIVATE cxx_std_20)
24
25
if(TUTORIAL_USE_STD_SQRT)
26
target_compile_definitions(MathFunctions PRIVATE TUTORIAL_USE_STD_SQRT)
27
endif()
28
29
# TODO1: Include the CheckIncludeFiles module and use it to check for
30
# the emmintrin.h header.
31
32
# TODO2: If emmintrin.h is available, add a compile definition to MathFunctions
33
# named TUTORIAL_USE_SSE2. This will only be needed by the MathFunctions
34
# implementation file.
35
36
# TODO4: Include the CheckSourceCompiles module and use it to check if the
37
# following program compiles:
38
#
39
# typedef double v2df __attribute__((vector_size(16)));
40
# int main() {
41
# __builtin_ia32_sqrtsd(v2df{});
42
# }
43
44
# TODO5: If the GNU builtins are available, add a compile definition to
45
# MathFunctions named TUTORIAL_USE_GNU_BUILTIN. This will only be needed
46
# by the MathFunctions implementation file.
47
48
add_subdirectory(MathLogger)
49
add_subdirectory(MathExtensions)
50
51