@@ -3,6 +3,22 @@ cmake_minimum_required(VERSION 3.11)
33## Specify the top level name of the project - this will define the solution name for Visual Studio
44project (RMV)
55
6+ # Define version information
7+ set (RMV_MAJOR_VERSION 1)
8+ set (RMV_MINOR_VERSION 5)
9+ if (NOT RMV_BUGFIX_NUMBER)
10+ set (RMV_BUGFIX_NUMBER 0)
11+ endif ()
12+ if (NOT RMV_BUILD_NUMBER)
13+ set (RMV_BUILD_NUMBER 0)
14+ endif ()
15+ string (TIMESTAMP DATE "\" %m/%d/%Y\" " )
16+ string (TIMESTAMP YEAR "%Y" )
17+ string (TIMESTAMP YEAR_STRING "\" %Y\" " )
18+
19+ configure_file ("${CMAKE_SOURCE_DIR} /Buildinfo.properties.in" "${CMAKE_SOURCE_DIR} /Buildinfo.properties" )
20+ configure_file ("${CMAKE_SOURCE_DIR} /source/frontend/util/version.h.in" "${CMAKE_SOURCE_DIR} /source/frontend/util/version.h" )
21+
622## For RMV we only care about the Debug and Release configuration types
723set (CMAKE_CONFIGURATION_TYPES Debug Release)
824
@@ -18,11 +34,11 @@ set (CMAKE_DEBUG_POSTFIX -d${ADT_INTERNAL_POSTFIX})
1834set (CMAKE_RELEASE_POSTFIX ${ADT_INTERNAL_POSTFIX} )
1935
2036IF (WIN32 )
21- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR} /../release${ADT_INTERNAL_POSTFIX } )
22- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} /../debug${ADT_INTERNAL_POSTFIX } )
37+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR} /../release${ADT_INTERNAL_POSTFIX_LOWER } )
38+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} /../debug${ADT_INTERNAL_POSTFIX_LOWER } )
2339ELSE (WIN32 )
24- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR} /../../release${ADT_INTERNAL_POSTFIX } )
25- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} /../../debug${ADT_INTERNAL_POSTFIX } )
40+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR} /../../release${ADT_INTERNAL_POSTFIX_LOWER } )
41+ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} /../../debug${ADT_INTERNAL_POSTFIX_LOWER } )
2642ENDIF (WIN32 )
2743
2844# Add for CentOS compiler warning
@@ -33,20 +49,12 @@ include_directories("${PROJECT_SOURCE_DIR}/external/")
3349
3450# Global compiler options
3551IF (WIN32 )
36- add_compile_options (/W4 /WX /MP)
37- # disable warning C4201: nonstandard extension used: nameless struct/union
38- add_compile_options (/wd4201)
39- # this warning is caused by the QT header files - use pragma to disable at source
40- # disable warning C4127: conditional expression is constant
41- add_compile_options (/wd4127)
42- # this warning is caused by QT header files and has been introduced by VS2019 16.9.6
43- # disable warning C5240: 'nodiscard': attribute is ignored in this syntactic position
44- add_compile_options (/wd5240)
52+ add_compile_options (/MP)
4553 # bump the stack size
4654 add_link_options (/STACK:16777216)
4755ELSEIF (UNIX )
4856 # Use -Wno-missing-field-initializers for CentOS compiler warning
49- add_compile_options (-std=c++11 - D_LINUX -Wall -Wextra -Werror -Wno-missing-field-initializers)
57+ add_compile_options (-D_LINUX -Wall -Wextra -Wno-missing-field-initializers)
5058 # Allow executable to be double clicked.
5159 add_link_options (-no -pie)
5260 # Use _DEBUG on Unix for Debug Builds (defined automatically on Windows)
@@ -113,18 +121,17 @@ ENDIF(WIN32)
113121# This is evaluated at project build time - not at CMake generation time
114122set (BUILD_ROOT $<$<CONFIG:debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG} >$<$<CONFIG:release>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE} >)
115123
116- # Define the option to pass to the sphinx documentation job
117- set (SPHINX_OPTION public )
118-
119- find_program (SPHINX_EXECUTABLE sphinx-build )
120- if (NOT SPHINX_EXECUTABLE)
121- message (FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!" )
124+ if (APPLE )
125+ set (DOCS_OUTPUT_DIR $<TARGET_FILE_DIR:RadeonMemoryVisualizer>/../Resources)
126+ else ()
127+ set (DOCS_OUTPUT_DIR ${BUILD_ROOT} )
122128endif ()
123129
124130# group sphinx source files into a sphinx folder
125131file (GLOB SPHINX_DOC_FILES ${SPHINX_DOC_FILES} ${CMAKE_SOURCE_DIR} /documentation/source /*.rst)
126132set (SPHINX_DOC_MAIN ${CMAKE_SOURCE_DIR} /documentation/source /conf.py)
127- source_group ("sphinx" FILES ${SPHINX_DOC_FILES} ${SPHINX_DOC_MAIN} )
133+ set (ALL_SPHINX_FILES ${SPHINX_DOC_FILES} ${SPHINX_DOC_MAIN} )
134+ source_group ("sphinx" FILES ${ALL_SPHINX_FILES} )
128135
129136# group release documents into a release_docs folder
130137set (RELEASE_DOCS_IN_ROOT
@@ -136,34 +143,47 @@ set (RELEASE_DOCS_IN_ROOT
136143set (RELEASE_DOCS ${RELEASE_DOCS_IN_ROOT} )
137144source_group ("release_docs" FILES ${RELEASE_DOCS} )
138145
139- # hang the sphinx build on the conf.py file and specify a dummy output ("sphinx_output")
140- # this ensures the sphinx docs are built everytime you ask to build the Documentation target
141- # Sphinx has proper dependency checking, so this works as expected.
142- # Once built, clean up any unneeded files.
143- add_custom_target (Documentation SOURCES ${SPHINX_DOC_FILES} ${RELEASE_DOCS} DEPENDS sphinx_output)
144- add_custom_command (MAIN_DEPENDENCY ${SPHINX_DOC_MAIN} OUTPUT sphinx_output
145- COMMAND ${CMAKE_COMMAND} -E echo "building Sphinx documentation"
146- COMMAND ${SPHINX_EXECUTABLE} ${CMAKE_SOURCE_DIR} /documentation/source ${BUILD_ROOT} /docs/help/rmv/html/. -t ${SPHINX_OPTION}
147- COMMAND ${CMAKE_COMMAND} -E remove_directory ${BUILD_ROOT} /docs/help/rmv/html/.doctrees
148- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/allocation_explorer.html
149- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/allocation_overview.html
150- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/capture.html
151- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/carousel.html
152- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/heap_overview.html
153- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/memory_leak_finder.html
154- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/resource_details.html
155- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/resource_list.html
156- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/resource_overview.html
157- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/settings.html
158- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/snapshot_delta.html
159- COMMAND ${CMAKE_COMMAND} -E remove ${BUILD_ROOT} /docs/help/rmv/html/timeline.html
160- )
146+ find_program (SPHINX_EXECUTABLE sphinx-build )
147+ if (SPHINX_EXECUTABLE)
148+ # Define the option to pass to the sphinx documentation job
149+ set (SPHINX_OPTION public )
150+
151+ # hang the sphinx build on the conf.py file and specify a dummy output ("sphinx_output")
152+ # this ensures the sphinx docs are built everytime you ask to build the Documentation target
153+ # Sphinx has proper dependency checking, so this works as expected.
154+ # Once built, clean up any unneeded files.
155+ add_custom_target (Documentation ALL SOURCES ${ALL_SPHINX_FILES} ${RELEASE_DOCS} DEPENDS sphinx_output)
156+ if (APPLE )
157+ add_dependencies (Documentation RadeonMemoryVisualizer)
158+ endif ()
159+ add_custom_command (MAIN_DEPENDENCY ${SPHINX_DOC_MAIN} OUTPUT sphinx_output
160+ COMMAND ${CMAKE_COMMAND} -E echo "building Sphinx documentation"
161+ COMMAND ${SPHINX_EXECUTABLE} ${CMAKE_SOURCE_DIR} /documentation/source ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/. -t ${SPHINX_OPTION}
162+ COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/.doctrees
163+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/allocation_explorer.html
164+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/allocation_overview.html
165+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/capture.html
166+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/carousel.html
167+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/heap_overview.html
168+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/memory_leak_finder.html
169+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/resource_details.html
170+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/resource_list.html
171+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/resource_overview.html
172+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/settings.html
173+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/snapshot_delta.html
174+ COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR} /docs/help/rmv/html/timeline.html
175+ )
176+ else ()
177+ message (WARNING "SPHINX_EXECUTABLE (sphinx-build) is not found! Documentation will not be built!" )
178+ # If the sphinx binary isn't found, then just create the Documentation project with only the release docs in it.
179+ add_custom_target (Documentation ALL SOURCES ${ALL_SPHINX_FILES} ${RELEASE_DOCS} )
180+ endif ()
161181
162182add_custom_command (TARGET Documentation POST_BUILD
163183 COMMAND ${CMAKE_COMMAND} -E echo "copying Documentation to output directory"
164- COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_ROOT } /docs
165- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RELEASE_DOCS_IN_ROOT} ${BUILD_ROOT } /.
184+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOCS_OUTPUT_DIR } /docs
185+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RELEASE_DOCS_IN_ROOT} ${DOCS_OUTPUT_DIR } /.
166186 COMMAND ${CMAKE_COMMAND} -E echo "copying Samples to output directory"
167- COMMAND ${CMAKE_COMMAND} -E make_directory ${BUILD_ROOT } /samples
168- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR} /samples/sampleTrace.rmv ${BUILD_ROOT } /samples/sample_trace.rmv
187+ COMMAND ${CMAKE_COMMAND} -E make_directory ${DOCS_OUTPUT_DIR } /samples
188+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR} /samples/sampleTrace.rmv ${DOCS_OUTPUT_DIR } /samples/sample_trace.rmv
169189)
0 commit comments