From e5cd3cde133d72093dbdc03edef79e10820feb59 Mon Sep 17 00:00:00 2001 From: Christine Kim Date: Mon, 25 Sep 2023 12:06:25 -0700 Subject: [PATCH] Builds with cspice --- CMakeLists.txt | 11 ++++------- SpiceQL/src/io.cpp | 2 +- SpiceQL/tests/CMakeLists.txt | 7 ++++++- SpiceQL/tests/KernelTests.cpp | 2 +- SpiceQL/tests/UtilTests.cpp | 2 +- cmake/FindCSPICE.cmake | 3 +++ environment.yml | 2 +- submodules/googletest | 1 + submodules/gularkfilesystem | 1 + submodules/hippomocks | 1 + submodules/json | 1 + submodules/redis-plus-plus | 1 + 12 files changed, 22 insertions(+), 12 deletions(-) create mode 160000 submodules/googletest create mode 160000 submodules/gularkfilesystem create mode 160000 submodules/hippomocks create mode 160000 submodules/json create mode 160000 submodules/redis-plus-plus diff --git a/CMakeLists.txt b/CMakeLists.txt index b7742c3..2e0e480 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,7 +98,6 @@ if(SPICEQL_BUILD_LIB) ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking1.json ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/viking2.json) - set(SPICEQL_KERNELS ${CMAKE_CURRENT_SOURCE_DIR}/SpiceQL/db/kernels/naif0011.tls) add_library(SpiceQL SHARED ${SPICEQL_SRC_FILES}) @@ -107,7 +106,6 @@ if(SPICEQL_BUILD_LIB) VERSION ${PROJECT_VERSION} SOVERSION 0) - target_compile_definitions(SpiceQL PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE PUBLIC -D_SOURCE_PREFIX="${CMAKE_CURRENT_SOURCE_DIR}") @@ -119,7 +117,7 @@ if(SPICEQL_BUILD_LIB) PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/submodules/redis-plus-plus/src/ cereal - ) + ) target_link_libraries(SpiceQL PUBLIC @@ -128,10 +126,10 @@ if(SPICEQL_BUILD_LIB) nlohmann_json::nlohmann_json PRIVATE redis++ - CSpice::cspice + cspice spdlog::spdlog_header_only ) - + install(TARGETS SpiceQL LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY ${SPICEQL_INCLUDE_DIR} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) @@ -153,9 +151,8 @@ if(SPICEQL_BUILD_LIB) # Install the shipped kernels install(FILES ${SPICEQL_KERNELS} DESTINATION "etc/SpiceQL/db/kernels") - # Install the library - install(TARGETS SpiceQL nlohmann_json + install(TARGETS SpiceQL nlohmann_json ghc_filesystem EXPORT spiceQLTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${SPICEQL_INSTALL_INCLUDE_DIR}) diff --git a/SpiceQL/src/io.cpp b/SpiceQL/src/io.cpp index d94bdd3..680cca1 100644 --- a/SpiceQL/src/io.cpp +++ b/SpiceQL/src/io.cpp @@ -3,7 +3,7 @@ #include -#include "SpiceUsr.h" +#include #include "io.h" #include "utils.h" diff --git a/SpiceQL/tests/CMakeLists.txt b/SpiceQL/tests/CMakeLists.txt index 4888de2..0f1748a 100644 --- a/SpiceQL/tests/CMakeLists.txt +++ b/SpiceQL/tests/CMakeLists.txt @@ -7,7 +7,12 @@ else() set(CMAKE_CXX_STANDARD 17) endif() +find_package(CSpice REQUIRED) +get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) +foreach(dir ${dirs}) + message(STATUS "dir='${dir}'") +endforeach() set(SPICEQL_TEST_DIRECTORY ${CMAKE_SOURCE_DIR}/SpiceQL/tests/) # collect all of the test sources @@ -30,7 +35,7 @@ target_link_libraries(runSpiceQLTests PRIVATE SpiceQL redis++ - CSpice::cspice + cspice gtest gmock Threads::Threads diff --git a/SpiceQL/tests/KernelTests.cpp b/SpiceQL/tests/KernelTests.cpp index 862f919..f8b0325 100644 --- a/SpiceQL/tests/KernelTests.cpp +++ b/SpiceQL/tests/KernelTests.cpp @@ -8,7 +8,7 @@ #include "spice_types.h" #include "query.h" -#include "SpiceUsr.h" +#include #include "spdlog/spdlog.h" diff --git a/SpiceQL/tests/UtilTests.cpp b/SpiceQL/tests/UtilTests.cpp index f91aa80..9efa10b 100644 --- a/SpiceQL/tests/UtilTests.cpp +++ b/SpiceQL/tests/UtilTests.cpp @@ -11,7 +11,7 @@ using namespace std::chrono; #include "Fixtures.h" #include "spice_types.h" #include "config.h" -#include "SpiceUsr.h" +#include #include "memo.h" #include "query.h" diff --git a/cmake/FindCSPICE.cmake b/cmake/FindCSPICE.cmake index 5026718..271e79e 100644 --- a/cmake/FindCSPICE.cmake +++ b/cmake/FindCSPICE.cmake @@ -14,5 +14,8 @@ find_library(CSPICE_LIBRARY NAMES cspice ) +link_directories($ENV{CONDA_PREFIX}/lib) +include_directories(${CSPICE_INCLUDE_DIR}) + message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} ) message(STATUS "CSPICE LIB: " ${CSPICE_LIBRARY} ) \ No newline at end of file diff --git a/environment.yml b/environment.yml index 6ef7997..bfbd9f9 100644 --- a/environment.yml +++ b/environment.yml @@ -6,7 +6,7 @@ channels: dependencies: - cmake - - cspice-cmake + - cspice - cpp-filesystem - doxygen - fmt diff --git a/submodules/googletest b/submodules/googletest new file mode 160000 index 0000000..e40661d --- /dev/null +++ b/submodules/googletest @@ -0,0 +1 @@ +Subproject commit e40661d89b051e9ef4eb8a2420b74bf78b39ef41 diff --git a/submodules/gularkfilesystem b/submodules/gularkfilesystem new file mode 160000 index 0000000..fcea331 --- /dev/null +++ b/submodules/gularkfilesystem @@ -0,0 +1 @@ +Subproject commit fcea331ebb8273581cef3e91a131e3d7877f7dfd diff --git a/submodules/hippomocks b/submodules/hippomocks new file mode 160000 index 0000000..10960d0 --- /dev/null +++ b/submodules/hippomocks @@ -0,0 +1 @@ +Subproject commit 10960d027b398444ec3ec6ce2487de3db0283ff8 diff --git a/submodules/json b/submodules/json new file mode 160000 index 0000000..5fec803 --- /dev/null +++ b/submodules/json @@ -0,0 +1 @@ +Subproject commit 5fec8034933ef434a98dfbd2551b052c56345869 diff --git a/submodules/redis-plus-plus b/submodules/redis-plus-plus new file mode 160000 index 0000000..48e178c --- /dev/null +++ b/submodules/redis-plus-plus @@ -0,0 +1 @@ +Subproject commit 48e178c09a2fbd10d3b991e54b8a71b70791b933 -- GitLab