Commit 8c09fb96 authored by AustinSanders's avatar AustinSanders Committed by amystamile-usgs
Browse files

Initial core deployment (#4355)

parent fce72a78
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ option(buildStaticCore "Build libisis static as well as dynamic" OFF )
option(buildTests      "Set up unit, application, and module tests."    ON  )
option(JP2KFLAG        "Whether or not to build using JPEG2000 support" OFF )
option(pybindings      "Turn on to build Python bindings"               ON )
option(buildSwig       "Turn on to build swig wrappers"                 OFF )
option(ISIS_BUILD_SWIG "Turn on to build swig wrappers"                 OFF )
option(BUILD_CORE_TESTS "Turn on to build core tests"                   ON )

# if cmake install prefix is not set, and conda env is activated, use the
+9 −10
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.10)

project (core VERSION 0.0.1)
option(buildStaticCore "Build libisis static as well as dynamic"        OFF )
option (BUILD_CORE_TESTS "Build core module tests" ON)
option (BUILD_TESTS "Build core module tests" ON)
option(ISIS_BUILD_SWIG "Turn on to build swig wrappers"                 OFF )

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")

@@ -46,7 +47,7 @@ set(Pvl_source_files ${PROJECT_SOURCE_DIR}/src/ArraySubscriptNotInRange.cpp
                     ${PROJECT_SOURCE_DIR}/src/PvlObject.cpp
                     ${PROJECT_SOURCE_DIR}/src/PvlSequence.cpp)
# Define a target
add_library(core "${Pvl_source_files}")
add_library(core SHARED "${Pvl_source_files}")

target_include_directories(core PUBLIC ${PROJECT_SOURCE_DIR}/include)

@@ -70,10 +71,7 @@ find_package(Qt5 REQUIRED COMPONENTS
                # Search this path explicitly for MacOS OpenGL Framework
                PATHS /System/Library/Frameworks/ REQUIRED)

# find_package(Json REQUIRED)
find_package(Geos REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(CSPICE    65      REQUIRED)

include_directories(SYSTEM
                    ${Qt5Widgets_INCLUDE_DIRS}
@@ -90,21 +88,22 @@ target_link_libraries(core PUBLIC Qt5::Core
                                  Qt5::Xml
                                  nlohmann_json::nlohmann_json)

target_link_libraries(core PUBLIC ${GEOS_LIBRARY} ${CSPICE_LIBRARY})
target_include_directories(core PUBLIC ${GEOS_INCLUDE_DIR} ${CSPICE_INCLUDE_DIR})
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include DESTINATION  ${CMAKE_INSTALL_PREFIX}/include/isis)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/
        DESTINATION ${CMAKE_INSTALL_PREFIX}/include/isis
        FILES_MATCHING PATTERN "*.h")

install(TARGETS core DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

# Copy the preferences file
EXECUTE_PROCESS(COMMAND cp -f ${PROJECT_SOURCE_DIR}/IsisPreferences ${CMAKE_BINARY_DIR}/)
install(FILES     ${CMAKE_SOURCE_DIR}/IsisPreferences DESTINATION  ${CMAKE_INSTALL_PREFIX})

if (BUILD_CORE_TESTS)
if (BUILD_TESTS)
  # Copy the test preferences file
  EXECUTE_PROCESS(COMMAND cp -f ${PROJECT_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/)
  enable_testing()
  add_subdirectory(tests)
endif()
if(buildSwig)
if(ISIS_BUILD_SWIG)
  add_subdirectory(swig)
endif()
+0 −18
Original line number Diff line number Diff line
# CMake module for find_package(CSPICE)
# Finds include directory and all applicable libraries
#
# Sets the following:
#   CSPICE_INCLUDE_DIR
#   CSPICE_LIBRARY

find_path(CSPICE_INCLUDE_DIR
  NAME SpiceUsr.h
  PATH_SUFFIXES naif cspice
)

find_library(CSPICE_LIBRARY
  NAMES cspice
)

message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} )
message(STATUS "CSPICE LIB: "  ${CSPICE_LIBRARY} )
+0 −24
Original line number Diff line number Diff line
# CMake module for find_package(Geos)
# Finds include directory and all applicable libraries
#
# Sets the following:
#   GEOS_INCLUDE_DIR
#   GEOS_LIBRARY

find_path(GEOS_INCLUDE_DIR
  NAMES geos.h
  PATH_SUFFIXES "geos/geos${Geos_FIND_VERSION}" "geos"
)

find_library(GEOS_LIBRARY
  NAMES geos
)
find_library(GEOS_C_LIBRARY
  NAMES geos_c
)

message(STATUS "GEOS INCLUDE DIR: "  ${GEOS_INCLUDE_DIR} )
message(STATUS "GEOS LIB: "  ${GEOS_LIBRARY} )
message(STATUS "GEOS C LIB: "  ${GEOS_C_LIBRARY} )

get_filename_component(GEOS_ROOT_INCLUDE_DIR "${GEOS_INCLUDE_DIR}" DIRECTORY)
+2 −9
Original line number Diff line number Diff line
@@ -4,21 +4,14 @@ include_directories(${PYTHON_INCLUDE_DIR})

set(CMAKE_SWIG_FLAGS "")
set(CMAKE_SWIG_OUTDIR isispvl)
message(">>>> ${CMAKE_SWIG_OUTDIR}")
set_source_files_properties(../isispvl.i
                            PROPERTIES CPLUSPLUS ON SWIG_FLAGS "-py3")

#Find dependencies
message(">>>> ${PROJECT_SOURCE_DIR}")
message(">>>> ${PYTHON_LIBRARY}")
message(">>>> ${CMAKE_SOURCE_DIR}")
find_path(PVL_INCLUDE_DIR NAMES Pvl.h
                          PATH_SUFFIXES include
                          PATHS ${PROJECT_SOURCE_DIR}/)
find_library(PVL_LIBRARY NAMES core
             PATHS ${CMAKE_SOURCE_DIR}/../build/objects/core/)
message("-- Found PVL Include: ${PVL_INCLUDE_DIR}")
message("-- Found PVL Lib: ${PVL_LIBRARY}")
include_directories(${PVL_INCLUDE_DIR})

# Add and link
@@ -33,9 +26,9 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
if (APPLE)
     set_target_properties(_isispvl PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
     # On OSX, do not link python - this causes segfaults
     swig_link_libraries(isispvl ${PVL_LIBRARY})
     swig_link_libraries(isispvl core)
else()
     swig_link_libraries(isispvl ${PVL_LIBRARY} ${PYTHON_LIBRARY})
     swig_link_libraries(isispvl core ${PYTHON_LIBRARY})
endif()

# Build out a standard directory structure
Loading