forked from gnuradio/volk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
109 lines (94 loc) · 3.36 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
########################################################################
# Setup profiler
########################################################################
# POSIX_MEMALIGN: If we have to fall back to `posix_memalign`.
if(HAVE_POSIX_MEMALIGN)
message(STATUS "Use `posix_memalign` for aligned malloc!")
add_definitions(-DHAVE_POSIX_MEMALIGN)
endif(HAVE_POSIX_MEMALIGN)
# MAKE volk_profile
add_executable(volk_profile
${CMAKE_CURRENT_SOURCE_DIR}/volk_profile.cc
${PROJECT_SOURCE_DIR}/lib/qa_utils.cc
${CMAKE_CURRENT_SOURCE_DIR}/volk_option_helpers.cc
)
if(MSVC)
target_include_directories(volk_profile
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/cmake/msvc>
)
endif(MSVC)
target_include_directories(volk_profile
PRIVATE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
PRIVATE $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/lib>
PRIVATE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/lib>
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
)
if(NOT FILESYSTEM_FOUND)
target_include_directories(volk_profile
PUBLIC ${Boost_INCLUDE_DIRS}
)
target_link_libraries(volk_profile PRIVATE ${Boost_LIBRARIES})
endif()
if(FILESYSTEM_FOUND)
add_definitions(-DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
add_definitions(-DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(volk_profile PRIVATE std::filesystem)
endif()
if(ENABLE_STATIC_LIBS)
target_link_libraries(volk_profile PRIVATE volk_static)
set_target_properties(volk_profile PROPERTIES LINK_FLAGS "-static")
else()
target_link_libraries(volk_profile PRIVATE volk)
endif()
install(
TARGETS volk_profile
DESTINATION bin
COMPONENT "volk"
)
# MAKE volk-config-info
add_executable(volk-config-info volk-config-info.cc ${CMAKE_CURRENT_SOURCE_DIR}/volk_option_helpers.cc
)
if(ENABLE_STATIC_LIBS)
target_link_libraries(volk-config-info volk_static)
set_target_properties(volk-config-info PROPERTIES LINK_FLAGS "-static")
else()
target_link_libraries(volk-config-info volk)
endif()
install(
TARGETS volk-config-info
DESTINATION bin
COMPONENT "volk"
)
# Launch volk_profile if requested to do so
if(ENABLE_PROFILING)
if(DEFINED VOLK_CONFIGPATH)
set( VOLK_CONFIG_ARG "-p${VOLK_CONFIGPATH}" )
set( VOLK_CONFIG "${VOLK_CONFIGPATH}/volk_config" )
endif()
add_custom_command(OUTPUT ${VOLK_CONFIG}
COMMAND volk_profile "${VOLK_CONFIG_ARG}"
DEPENDS volk_profile
COMMENT "Launching profiler, this may take a few minutes..."
)
add_custom_target(volk-profile-run ALL DEPENDS ${VOLK_CONFIG})
endif()