Move cmdparser.*, command.*, and execution.* from celengine to celestia, modify celephem to OBJECT library and merge the objects in the celengine library, fix Spice dependency

pull/3/head
laikh 2019-08-12 20:49:33 +02:00 committed by Hleb Valoshka
parent a5fa3f5114
commit cfdda11bf6
24 changed files with 90 additions and 56 deletions

View File

@ -109,8 +109,9 @@ if(ENABLE_SPICE)
if(NOT CSPICE_FOUND)
message(STATUS "Using cspice submodule")
add_subdirectory("${CMAKE_SOURCE_DIR}/thirdparty/Spice")
include_directories("${CMAKE_SOURCE_DIR}/thirdparty/Spice/include")
get_target_property(SPICE_INCLUDE_DIR Spice INCLUDE_DIRECTORIES)
include_directories(${SPICE_INCLUDE_DIR})
message(STATUS "Spice include directories: ${SPICE_INCLUDE_DIR}")
add_library(CSPICE::CSPICE ALIAS Spice)
endif()
add_definitions(-DUSE_SPICE)

View File

@ -1,7 +1,6 @@
set(CELESTIA_LIBS
cel3ds
celengine
celephem
celestia
celmath
celmodel
@ -13,6 +12,9 @@ foreach(lib ${CELESTIA_LIBS})
add_subdirectory(${lib})
endforeach()
# Compiled celephem objects are merged with the celengine library
add_subdirectory(celephem)
if (ENABLE_TOOLS)
add_subdirectory(tools)
endif()

View File

@ -7,7 +7,7 @@ set(CEL3DS_SOURCES
)
add_library(cel3ds STATIC ${CEL3DS_SOURCES})
cotire(cel3ds)
#[[
add_library(cel3ds SHARED ${CEL3DS_SOURCES})
set_target_properties(cel3ds PROPERTIES
@ -15,4 +15,10 @@ set_target_properties(cel3ds PROPERTIES
SOVERSION ${VERSION}
)
]]#
add_dependencies(cel3ds celutil)
target_link_libraries(cel3ds celutil)
cotire(cel3ds)
#install(TARGETS cel3ds LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -16,10 +16,6 @@ set(CELENGINE_SOURCES
category.h
catentry.cpp
catentry.h
cmdparser.cpp
cmdparser.h
command.cpp
command.h
console.cpp
console.h
constellation.cpp
@ -38,8 +34,6 @@ set(CELENGINE_SOURCES
dsooctree.cpp
dsooctree.h
execenv.h
execution.cpp
execution.h
frame.cpp
frame.h
frametree.cpp
@ -152,8 +146,9 @@ set(CELENGINE_SOURCES
visibleregion.h
)
add_library(celengine STATIC ${CELENGINE_SOURCES})
cotire(celengine)
# The object files in the celephem directory are merged in the celengine library
add_library(celengine STATIC ${CELENGINE_SOURCES} $<TARGET_OBJECTS:celephem>)
#[[
add_library(celengine SHARED ${CELENGINE_SOURCES})
set_target_properties(celengine PROPERTIES
@ -161,6 +156,15 @@ set_target_properties(celengine PROPERTIES
SOVERSION ${VERSION}
)
]]#
add_dependencies(celengine cel3ds celmath celmodel)
target_link_libraries(celengine cel3ds celmath celmodel)
add_dependencies(celengine cel3ds celmath celmodel celtxf celutil)
target_link_libraries(celengine cel3ds celmath celmodel celtxf celutil)
# Some celephem objects depend on Spice
if(ENABLE_SPICE)
target_link_libraries(celengine CSPICE::CSPICE)
endif()
cotire(celengine)
#install(TARGETS celengine LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -44,16 +44,7 @@ if(ENABLE_CELX)
)
endif()
add_library(celephem STATIC ${CELEPHEM_SOURCES})
if(ENABLE_SPICE)
target_link_libraries(celephem CSPICE::CSPICE)
endif()
# These object files are merged in the celegine library
add_library(celephem OBJECT ${CELEPHEM_SOURCES})
cotire(celephem)
#[[
add_library(celephem SHARED ${CELEPHEM_SOURCES})
set_target_properties(celephem PROPERTIES
VERSION ${VERSION}
SOVERSION ${VERSION}
)
]]#
#install(TARGETS celephem LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -3,10 +3,16 @@ set(CELESTIA_SOURCES
celestiacore.h
configfile.cpp
configfile.h
cmdparser.cpp
cmdparser.h
command.cpp
command.h
destination.cpp
destination.h
eclipsefinder.cpp
eclipsefinder.h
execution.cpp
execution.h
favorites.cpp
favorites.h
helper.cpp
@ -65,6 +71,7 @@ elseif(_UNIX AND ENABLE_THEORA)
endif()
add_library(celestia STATIC ${CELESTIA_SOURCES})
#[[
add_library(celestia SHARED ${CELESTIA_SOURCES})
set_target_properties(celestia PROPERTIES
@ -72,9 +79,12 @@ set_target_properties(celestia PROPERTIES
SOVERSION ${VERSION}
)
]]#
add_dependencies(celestia celengine celephem)
add_dependencies(celestia celengine celmath celtxf celutil)
target_link_libraries(celestia celengine celmath celtxf celutil)
cotire(celestia)
target_link_libraries(celestia celengine celephem)
#install(TARGETS celestia LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
# celestia-glut binary

View File

@ -21,8 +21,8 @@
#include <celengine/boundaries.h>
#include <celengine/overlay.h>
#include <celengine/console.h>
#include <celengine/execution.h>
#include <celengine/cmdparser.h>
#include "execution.h"
#include "cmdparser.h"
#include <celengine/multitexture.h>
#ifdef USE_SPICE
#include <celephem/spiceinterface.h>

View File

@ -15,8 +15,8 @@
// #include <celutil/watchable.h>
#include <celengine/solarsys.h>
#include <celengine/overlay.h>
#include <celengine/command.h>
#include <celengine/execution.h>
#include "command.h"
#include "execution.h"
#include <celengine/texture.h>
#include <celengine/universe.h>
#include <celengine/render.h>

View File

@ -16,9 +16,9 @@
#include <map>
#include <celengine/astro.h>
#include <celengine/asterism.h>
#include <celengine/cmdparser.h>
#include "cmdparser.h"
#include <celengine/execenv.h>
#include <celengine/execution.h>
#include "execution.h"
#include <celengine/timeline.h>
#include <celengine/timelinephase.h>
#include <fmt/printf.h>

View File

@ -2,9 +2,9 @@
#include <fmt/printf.h>
#include "celx_misc.h"
#include "celx_internal.h"
#include <celengine/cmdparser.h>
#include "cmdparser.h"
#include <celengine/execenv.h>
#include <celengine/execution.h>
#include "execution.h"
#include "celestiacore.h"
LuaState *getLuaStateObject(lua_State*);

View File

@ -11,17 +11,16 @@
#include <config.h>
#include "astro.h"
#include "cmdparser.h"
#ifdef USE_GLCONTEXT
#include "glcontext.h"
#include <celengine/glcontext.h>
#endif
#include <celutil/util.h>
#include <celutil/debug.h>
#include <celmath/mathlib.h>
#include <celengine/astro.h>
#include <celestia/celx.h>
#include <celestia/celx_internal.h>
#include "celx.h"
#include "celx_internal.h"
#include <celengine/render.h>
#include <algorithm>
#include <Eigen/Geometry>

View File

@ -12,7 +12,7 @@
#ifndef _CMDPARSER_H_
#define _CMDPARSER_H_
#include <celengine/command.h>
#include "command.h"
#include <celengine/parser.h>
#include <celengine/render.h>
#include <iostream>

View File

@ -8,15 +8,15 @@
// of the License, or (at your option) any later version.
#include "command.h"
#include "astro.h"
#include "asterism.h"
#include <celengine/astro.h>
#include <celengine/asterism.h>
#include "execution.h"
#ifdef USE_GLCONTEXT
#include "glcontext.h"
#include <celengine/glcontext.h>
#endif
#include <celestia/celestiacore.h>
#include <celestia/imagecapture.h>
#include <celestia/celx_internal.h>
#include "celestiacore.h"
#include "imagecapture.h"
#include "celx_internal.h"
#include <celengine/multitexture.h>
#include <celutil/util.h>
#include <celmath/mathlib.h>

View File

@ -11,7 +11,7 @@
#define _EXECUTION_H_
#include <celengine/execenv.h>
#include <celengine/command.h>
#include "command.h"
class Execution

View File

@ -13,7 +13,7 @@
#include <iomanip>
#include <celutil/debug.h>
#include <celutil/util.h>
#include <celengine/cmdparser.h>
#include "cmdparser.h"
#include "favorites.h"
using namespace Eigen;

View File

@ -23,7 +23,7 @@
#include <celengine/body.h>
#include <celengine/simulation.h>
#include <celengine/cmdparser.h>
#include <celestia/cmdparser.h>
#include <celengine/render.h>
#include <celestia/celestiacore.h>
#include <celestia/imagecapture.h>

View File

@ -9,7 +9,7 @@
#include <celestia/celestiacore.h>
#include <celestia/url.h>
#include <celengine/cmdparser.h>
#include <celestia/cmdparser.h>
extern CelestiaCore *appCore;

View File

@ -33,7 +33,7 @@
#include <celutil/winutil.h>
#include <celutil/filetype.h>
#include <celengine/astro.h>
#include <celengine/cmdparser.h>
#include <celestia/cmdparser.h>
#include <celengine/axisarrow.h>
#include <celengine/planetgrid.h>

View File

@ -14,7 +14,7 @@ set(CELMATH_SOURCES
)
add_library(celmath STATIC ${CELMATH_SOURCES})
cotire(celmath)
#[[
add_library(celmath SHARED ${CELMATH_SOURCES})
set_target_properties(celmath PROPERTIES
@ -22,4 +22,7 @@ set_target_properties(celmath PROPERTIES
SOVERSION ${VERSION}
)
]]#
cotire(celmath)
#install(TARGETS celmath LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -10,7 +10,7 @@ set(CELMODEL_SOURCES
)
add_library(celmodel STATIC ${CELMODEL_SOURCES})
cotire(celmodel)
#[[
add_library(celmodel SHARED ${CELMODEL_SOURCES})
set_target_properties(celmodel PROPERTIES
@ -18,5 +18,11 @@ set_target_properties(celmodel PROPERTIES
SOVERSION ${VERSION}
)
]]#
add_dependencies(celmodel celutil)
target_link_libraries(celmodel celutil)
cotire(celmodel)
#install(TARGETS celmodel LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
#install(TARGETS celmodel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -4,7 +4,7 @@ set(CELTFX_SOURCES
)
add_library(celtxf STATIC ${CELTFX_SOURCES})
cotire(celtxf)
#[[
add_library(celtxf SHARED ${CELTFX_SOURCES})
set_target_properties(celtxf PROPERTIES
@ -12,4 +12,10 @@ set_target_properties(celtxf PROPERTIES
SOVERSION ${VERSION}
)
]]#
add_dependencies(celtxf celutil)
target_link_libraries(celtxf celutil)
cotire(celtxf)
#install(TARGETS celtxf LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -38,7 +38,7 @@ else()
endif()
add_library(celutil STATIC ${CELUTIL_SOURCES})
cotire(celutil)
#[[
add_library(celutil SHARED ${CELUTIL_SOURCES})
set_target_properties(celutil PROPERTIES
@ -46,4 +46,10 @@ set_target_properties(celutil PROPERTIES
SOVERSION ${VERSION}
)
]]#
add_dependencies(celutil celmath)
target_link_libraries(celutil celmath)
cotire(celutil)
#install(TARGETS celutil LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})