Skip to content

Commit

Permalink
Merge pull request #38 from arbCoding/devel
Browse files Browse the repository at this point in the history
Fixed installers
  • Loading branch information
arbCoding authored Jan 27, 2024
2 parents cb0221e + ba19a89 commit 9a49271
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 44 deletions.
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,6 @@ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
# Archive filename
set(CPACK_ARCHIVE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-\
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
include(CPack)
# Setup components
install(TARGETS sac-format COMPONENT library)
install(TARGETS basic_tests trace_tests geometry_tests datetime_tests
RUNTIME DESTINATION bin/tests COMPONENT tests)
install(TARGETS benchmark RUNTIME DESTINATION bin/tests COMPONENT benchmarks)
install(TARGETS list_sac RUNTIME DESTINATION bin COMPONENT list_sac)
if(CPACK_GENERATOR MATCHES "productbuild")
# macOS
set(CPACK_RESOURCE_FILE_README
Expand All @@ -194,6 +187,14 @@ else()
COMPONENT license)
set(CPACK_RESOURCE_FILE_LICENSE ${sac-format_SOURCE_DIR}/LICENSE)
endif()
# For some reason, order seems to matter more than it should...
include(CPack)
# Setup components
install(TARGETS sac-format COMPONENT library)
install(TARGETS basic_tests trace_tests geometry_tests datetime_tests
RUNTIME DESTINATION bin/tests COMPONENT tests)
install(TARGETS benchmark RUNTIME DESTINATION bin/tests COMPONENT benchmarks)
install(TARGETS list_sac RUNTIME DESTINATION bin COMPONENT list_sac)
# Group components
cpack_add_component(library DISPLAY_NAME "sac-format" GROUP development
DESCRIPTION "sac-format library to use in your own programs.")
Expand Down
2 changes: 1 addition & 1 deletion docs/BasicDocumentation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Quickstart.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<!doctype html><html xmlns=http://www.w3.org/1999/xhtml lang=en-US><meta http-equiv=Content-Type content="text/xhtml;charset=utf-8"><meta http-equiv=X-UA-Compatible content="IE=11"><meta name=generator content="Doxygen 1.9.8"><meta name=viewport content="width=device-width,initial-scale=1"><title>sac-format: Quickstart</title>
<link href=tabs.css rel=stylesheet><script src=jquery.js></script><script src=dynsections.js></script><link href=navtree.css rel=stylesheet><script src=resize.js></script><script src=navtreedata.js></script><script src=navtree.js></script><link href=search/search.css rel=stylesheet><script src=search/searchdata.js></script><script src=search/search.js></script><link href=doxygen.css rel=stylesheet><link href=doxygen-awesome.css rel=stylesheet><div id=top><div id=titlearea><table cellspacing=0 cellpadding=0><tbody><tr id=projectrow><td id=projectalign><div id=projectname>sac-format<span id=projectnumber>&#160;0.6.0</span></div><div id=projectbrief>C++20 SAC (Seismic Analysis Code) File Library</div></table></div><script>var searchBox=new SearchBox("searchBox","search/",".html")</script><script src=menudata.js></script><script src=menu.js></script><script>$(function(){initMenu("",!0,!1,"search.php","Search"),$(document).ready(function(){init_search()})})</script><div id=main-nav></div></div><div id=side-nav class="ui-resizable side-nav-resizable"><div id=nav-tree><div id=nav-tree-contents><div id=nav-sync class=sync></div></div></div><div id=splitbar style=-moz-user-select:none class=ui-resizable-handle></div></div><script>$(document).ready(function(){initNavTree("Quickstart.html",""),initResizable()})</script><div id=doc-content><div id=MSearchSelectWindow onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"></div><div id=MSearchResultsWindow><div id=MSearchResults><div class=SRPage><div id=SRIndex><div id=SRResults></div><div class=SRStatus id=Loading>Loading...</div><div class=SRStatus id=Searching>Searching...</div><div class=SRStatus id=NoMatches>No Matches</div></div></div></div></div><div><div class=header><div class=headertitle><div class=title>Quickstart</div></div></div><div class=contents><div class=textblock><p>To use link to the library (<code>libsac-format.a</code> on Linux/macOS, <code>sac-format.lib</code> on Windows) and include <code>sac_format.hpp</code>.<h1><a class=anchor id=autotoc_md20></a>Example Programs</h1><h2><a class=anchor id=autotoc_md21></a>list_sac</h2><p><code>list_sac</code> is a command line program that takes a single SAC-file as its input argument. It reads the SAC-file and outputs the header/footer information, as well as the true size of the <code>data1</code> and <code>data2</code> vectors.<h1><a class=anchor id=autotoc_md22></a>CMake Integration</h1><p>To integrate sac-format into your CMake project, add it to your <code>CMakeLists.txt</code>.<div class=fragment><div class=line>include(FetchContent)</div><div class=line>set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)</div><div class=line>FetchContent_Declare(sac-format</div><div class=line>GIT_REPOSITORY https://github.com/arbCoding/sac-format</div><div class=line>GIT_TAG vX.X.X)</div><div class=line>FetchContent_MakeAvailable(sac-format)</div><div class=line>include_directory(${sacformat_SOURCE_DIR/src})</div><div class=line></div><div class=line>project (your_project</div><div class=line>LANGUAGES CXX)</div><div class=line></div><div class=line>add_executable(your_executable</div><div class=line>your_sources</div><div class=line>sac_format.hpp)</div><div class=line></div><div class=line>target_link_libraries_library(your_executable</div><div class=line>PRIVATE sac-format)</div></div><h1><a class=anchor id=autotoc_md23></a>Example</h1><h2><a class=anchor id=autotoc_md24></a>Reading and Writing</h2><div class=fragment><div class=line><span class=preprocessor>#include &lt;sac_format.hpp></span></div><div class=line><span class=preprocessor>#include &lt;filesystem></span></div><div class=line><span class=preprocessor>#include &lt;iostream></span></div><div class=line></div><div class=line><span class=keyword>using namespace </span><a class="code hl_namespace" href=namespacesacfmt.html>sacfmt</a>;</div><div class=line><span class=keyword>namespace </span><a class="code hl_struct" href=structsacfmt_1_1word__pair.html>fs</a> = std::filesystem;</div><div class=line></div><div class=line><span class=keywordtype>int</span> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>main</a>() {</div><div class=line><a class="code hl_class" href=classsacfmt_1_1Trace.html>Trace</a> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a>{};</div><div class=line><span class=comment>// Change header variable</span></div><div class=line><a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a>.kstnm(<span class=stringliteral>"Station1"</span>);</div><div class=line>fs::path <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>{<span class=stringliteral>"./test.SAC"</span>};</div><div class=line><span class=comment>// Write</span></div><div class=line><a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a>.write(<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>);</div><div class=line><span class=comment>// Read</span></div><div class=line><a class="code hl_class" href=classsacfmt_1_1Trace.html>Trace</a> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace2</a> = <a class="code hl_class" href=classsacfmt_1_1Trace.html>Trace</a>(<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>);</div><div class=line><span class=comment>// Confirm equality</span></div><div class=line>std::cout &lt;&lt; (<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a> == <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace2</a>) &lt;&lt; <span class=charliteral>'\n'</span>;</div><div class=line>fs::remove(<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>);</div><div class=line><span class=keywordflow>return</span> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>EXIT_SUCCESS</a>;</div><div class=line>}</div><div class=ttc id=aclasssacfmt_1_1Trace_html><div class=ttname><a href=classsacfmt_1_1Trace.html>sacfmt::Trace</a></div><div class=ttdoc>The Trace class.</div><div class=ttdef><b>Definition</b> sac_format.hpp:1052</div></div><div class=ttc id=anamespacesacfmt_html><div class=ttname><a href=namespacesacfmt.html>sacfmt</a></div><div class=ttdoc>sac-format namespace</div><div class=ttdef><b>Definition</b> sac_format.hpp:57</div></div><div class=ttc id=astructsacfmt_1_1word__pair_html><div class=ttname><a href=structsacfmt_1_1word__pair.html>sacfmt::word_pair</a></div><div class=ttdoc>Struct containing a pair of words.</div><div class=ttdef><b>Definition</b> sac_format.hpp:199</div></div></div></div></div></div></div><div id=nav-path class=navpath><ul><li class=footer>Generated by <a href=https://www.doxygen.org/index.html><img class=footer src=doxygen.svg width=104 height=31 alt=doxygen></a> 1.9.8</ul></div>
<link href=tabs.css rel=stylesheet><script src=jquery.js></script><script src=dynsections.js></script><link href=navtree.css rel=stylesheet><script src=resize.js></script><script src=navtreedata.js></script><script src=navtree.js></script><link href=search/search.css rel=stylesheet><script src=search/searchdata.js></script><script src=search/search.js></script><link href=doxygen.css rel=stylesheet><link href=doxygen-awesome.css rel=stylesheet><div id=top><div id=titlearea><table cellspacing=0 cellpadding=0><tbody><tr id=projectrow><td id=projectalign><div id=projectname>sac-format<span id=projectnumber>&#160;0.6.0</span></div><div id=projectbrief>C++20 SAC (Seismic Analysis Code) File Library</div></table></div><script>var searchBox=new SearchBox("searchBox","search/",".html")</script><script src=menudata.js></script><script src=menu.js></script><script>$(function(){initMenu("",!0,!1,"search.php","Search"),$(document).ready(function(){init_search()})})</script><div id=main-nav></div></div><div id=side-nav class="ui-resizable side-nav-resizable"><div id=nav-tree><div id=nav-tree-contents><div id=nav-sync class=sync></div></div></div><div id=splitbar style=-moz-user-select:none class=ui-resizable-handle></div></div><script>$(document).ready(function(){initNavTree("Quickstart.html",""),initResizable()})</script><div id=doc-content><div id=MSearchSelectWindow onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"></div><div id=MSearchResultsWindow><div id=MSearchResults><div class=SRPage><div id=SRIndex><div id=SRResults></div><div class=SRStatus id=Loading>Loading...</div><div class=SRStatus id=Searching>Searching...</div><div class=SRStatus id=NoMatches>No Matches</div></div></div></div></div><div><div class=header><div class=headertitle><div class=title>Quickstart</div></div></div><div class=contents><div class=textblock><p>To use link to the library (<code>libsac-format.a</code> on Linux/macOS, <code>sac-format.lib</code> on Windows) and include <code>sac_format.hpp</code>.<h1><a class=anchor id=autotoc_md20></a>Example Programs</h1><h2><a class=anchor id=autotoc_md21></a>list_sac</h2><p><code>list_sac</code> is a command line program that takes a single SAC-file as its input argument. It reads the SAC-file and outputs the header/footer information, as well as the true size of the <code>data1</code> and <code>data2</code> vectors.<h1><a class=anchor id=autotoc_md22></a>CMake Integration</h1><p>To integrate sac-format into your CMake project, add it to your <code>CMakeLists.txt</code>.<div class=fragment><div class=line>include(FetchContent)</div><div class=line>set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)</div><div class=line>FetchContent_Declare(sac-format</div><div class=line>GIT_REPOSITORY https://github.com/arbCoding/sac-format</div><div class=line>GIT_TAG vX.X.X)</div><div class=line>FetchContent_MakeAvailable(sac-format)</div><div class=line>include_directory(${sacformat_SOURCE_DIR/src})</div><div class=line></div><div class=line>project (your_project</div><div class=line>LANGUAGES CXX)</div><div class=line></div><div class=line>add_executable(your_executable</div><div class=line>your_sources</div><div class=line>sac_format.hpp)</div><div class=line></div><div class=line>target_link_libraries_library(your_executable</div><div class=line>PRIVATE sac-format)</div></div><h1><a class=anchor id=autotoc_md23></a>Example</h1><h2><a class=anchor id=autotoc_md24></a>Reading and Writing</h2><div class=fragment><div class=line><span class=preprocessor>#include &lt;sac_format.hpp></span></div><div class=line><span class=preprocessor>#include &lt;filesystem></span></div><div class=line><span class=preprocessor>#include &lt;iostream></span></div><div class=line></div><div class=line><span class=keyword>using namespace </span><a class="code hl_namespace" href=namespacesacfmt.html>sacfmt</a>;</div><div class=line><span class=keyword>namespace </span><a class="code hl_struct" href=structsacfmt_1_1word__pair.html>fs</a> = std::filesystem;</div><div class=line></div><div class=line><span class=keywordtype>int</span> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>main</a>() {</div><div class=line><a class="code hl_class" href=classsacfmt_1_1Trace.html>Trace</a> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a>{};</div><div class=line><span class=comment>// Change header variable</span></div><div class=line><a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a>.kstnm(<span class=stringliteral>"Station1"</span>);</div><div class=line>fs::path <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>{<span class=stringliteral>"./test.SAC"</span>};</div><div class=line><span class=comment>// Write</span></div><div class=line><a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a>.write(<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>);</div><div class=line><span class=comment>// Read</span></div><div class=line><a class="code hl_class" href=classsacfmt_1_1Trace.html>Trace</a> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace2</a>{<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>};</div><div class=line><span class=comment>// Confirm equality</span></div><div class=line>std::cout &lt;&lt; (<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace1</a> == <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>trace2</a>) &lt;&lt; <span class=charliteral>'\n'</span>;</div><div class=line>fs::remove(<a class="code hl_struct" href=structsacfmt_1_1word__pair.html>file</a>);</div><div class=line><span class=keywordflow>return</span> <a class="code hl_struct" href=structsacfmt_1_1word__pair.html>EXIT_SUCCESS</a>;</div><div class=line>}</div><div class=ttc id=aclasssacfmt_1_1Trace_html><div class=ttname><a href=classsacfmt_1_1Trace.html>sacfmt::Trace</a></div><div class=ttdoc>The Trace class.</div><div class=ttdef><b>Definition</b> sac_format.hpp:1052</div></div><div class=ttc id=anamespacesacfmt_html><div class=ttname><a href=namespacesacfmt.html>sacfmt</a></div><div class=ttdoc>sac-format namespace</div><div class=ttdef><b>Definition</b> sac_format.hpp:57</div></div><div class=ttc id=astructsacfmt_1_1word__pair_html><div class=ttname><a href=structsacfmt_1_1word__pair.html>sacfmt::word_pair</a></div><div class=ttdoc>Struct containing a pair of words.</div><div class=ttdef><b>Definition</b> sac_format.hpp:199</div></div></div></div></div></div></div><div id=nav-path class=navpath><ul><li class=footer>Generated by <a href=https://www.doxygen.org/index.html><img class=footer src=doxygen.svg width=104 height=31 alt=doxygen></a> 1.9.8</ul></div>
Binary file modified docs/pdf/sac-format_manual.pdf
Binary file not shown.
5 changes: 5 additions & 0 deletions notes.org
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
* Inbox
** Fix installers
macOS installer does not install to the correct location
The License doesn't show, none of the information shows
correctly (probably needs all the cpack setup to occur
super early in the CMakeLists.txt).
10 changes: 5 additions & 5 deletions src/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,12 @@ TEST_CASE("Input/Output") {
}
SECTION("In") {
test_sac.write(tmp_file);
BENCHMARK("Reading") { Trace in_sac = Trace(tmp_file); };
BENCHMARK("Reading") { Trace in_sac{tmp_file}; };
fs::remove(tmp_file);
}
SECTION("Comparison Between Out and In") {
test_sac.write(tmp_file);
Trace in_sac = Trace(tmp_file);
Trace in_sac{tmp_file};
BENCHMARK("Out vs In") { (void)(in_sac == test_sac); };
fs::remove(tmp_file);
}
Expand All @@ -202,14 +202,14 @@ TEST_CASE("Input/Output") {
SECTION("In") {
test_sac.write(tmp_file);
BENCHMARK("Reading") {
Trace in_sac = Trace(tmp_file);
Trace in_sac{tmp_file};
return;
};
fs::remove(tmp_file);
}
SECTION("Comparison Between Out and In Zeros") {
test_sac.write(tmp_file);
Trace in_sac = Trace(tmp_file);
Trace in_sac{tmp_file};
BENCHMARK("Trace Comparison") { (void)(test_sac == in_sac); };
fs::remove(tmp_file);
}
Expand All @@ -232,7 +232,7 @@ TEST_CASE("Input/Output") {
test_sac.data2(data);
}
test_sac.write(tmp_file);
Trace in_sac = Trace(tmp_file);
Trace in_sac{tmp_file};
// Note that this equality tests to equality within tolerance of
// what can be handled via a float this is because binary SAC files
// use floats for the data values, not doubles
Expand Down
2 changes: 1 addition & 1 deletion src/docs/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For example:

int main() {
std::filesystem::path my_file{"/home/user/data/ANMO.SAC"};
sacfmt::Trace anmo{sacfmt::Trace(my_file)};
sacfmt::Trace anmo{my_file};
return EXIT_SUCCESS;
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ int main() {
// Write
trace1.write(file);
// Read
Trace trace2 = Trace(file);
Trace trace2{file};
// Confirm equality
std::cout << (trace1 == trace2) << '\n';
fs::remove(file);
Expand Down
2 changes: 1 addition & 1 deletion src/examples/list_sac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(const int arg_count, const char *arg_array[]) {
std::cout << "WARNING: " << file << " does not have a SAC extension.\n";
}
// Okay, now we assume it is a SAC-file, let's go.
sacfmt::Trace trace = sacfmt::Trace(file);
sacfmt::Trace trace{file};
// Time to spit out the information
std::cout << "\033[1;36;40m=========================="
<< "=============================\n";
Expand Down
Loading

0 comments on commit 9a49271

Please sign in to comment.