diff --git a/cmake/TestCase.cmake b/cmake/TestCase.cmake index 7df3cde4c..80adeaf38 100644 --- a/cmake/TestCase.cmake +++ b/cmake/TestCase.cmake @@ -4,7 +4,7 @@ macro(test_case) list(REMOVE_AT libs 0 0) add_executable(${trgt} "${trgt}_test.cpp") - target_link_libraries(${trgt} PRIVATE ${libs}) + target_link_libraries(${trgt} PRIVATE celestia ${libs}) add_test(${trgt} ${trgt}) set_target_properties(${trgt} PROPERTIES FOLDER test/unit) endmacro() diff --git a/src/cel3ds/CMakeLists.txt b/src/cel3ds/CMakeLists.txt index 92843908f..c23a0e93f 100644 --- a/src/cel3ds/CMakeLists.txt +++ b/src/cel3ds/CMakeLists.txt @@ -6,19 +6,5 @@ set(CEL3DS_SOURCES 3dsread.h ) -add_library(cel3ds STATIC ${CEL3DS_SOURCES}) - -#[[ -add_library(cel3ds SHARED ${CEL3DS_SOURCES}) -set_target_properties(cel3ds PROPERTIES - VERSION ${VERSION} - SOVERSION ${VERSION} -) -]]# - -add_dependencies(cel3ds celutil) -target_link_libraries(cel3ds celutil) - +add_library(cel3ds OBJECT ${CEL3DS_SOURCES}) cotire(cel3ds) - -#install(TARGETS cel3ds LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/celengine/CMakeLists.txt b/src/celengine/CMakeLists.txt index 1dee98a4e..15d5aac2f 100644 --- a/src/celengine/CMakeLists.txt +++ b/src/celengine/CMakeLists.txt @@ -171,25 +171,5 @@ set(CELENGINE_SOURCES visibleregion.h ) -# The object files in the celephem directory are merged in the celengine library -add_library(celengine STATIC ${CELENGINE_SOURCES} $) - -#[[ -add_library(celengine SHARED ${CELENGINE_SOURCES}) -set_target_properties(celengine PROPERTIES - VERSION ${VERSION} - SOVERSION ${VERSION} -) -]]# - -add_dependencies(celengine cel3ds celmath celmodel celutil celttf) -target_link_libraries(celengine cel3ds celmath celmodel celutil celttf) - -# Some celephem objects depend on Spice -if(ENABLE_SPICE) - target_link_libraries(celengine CSPICE::CSPICE) -endif() - +add_library(celengine OBJECT ${CELENGINE_SOURCES}) cotire(celengine) - -#install(TARGETS celengine LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/celestia/CMakeLists.txt b/src/celestia/CMakeLists.txt index 9d0393d50..f2d737a46 100644 --- a/src/celestia/CMakeLists.txt +++ b/src/celestia/CMakeLists.txt @@ -44,15 +44,27 @@ list(GET PROJECT_VERSION_LIST 0 PROJECT_VERSION_MAJOR) list(GET PROJECT_VERSION_LIST 1 PROJECT_VERSION_MINOR) set(CELSO "celestia-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") -add_library(celestia SHARED ${CELESTIA_SOURCES} ${SCRIPT_LIBS}) +add_library(celestia SHARED ${CELESTIA_SOURCES} + ${SCRIPT_LIBS} + $ + $ + $ + $ + $ + $ + $ + $ +) + set_target_properties(celestia PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} WINDOWS_EXPORT_ALL_SYMBOLS TRUE ) -add_dependencies(celestia celengine celmath celutil) -target_link_libraries(celestia celengine celmath celutil) +if(ENABLE_SPICE) + target_link_libraries(celestia CSPICE::CSPICE) +endif() cotire(celestia) diff --git a/src/celmath/CMakeLists.txt b/src/celmath/CMakeLists.txt index c40b6411c..fbfeceb53 100644 --- a/src/celmath/CMakeLists.txt +++ b/src/celmath/CMakeLists.txt @@ -13,16 +13,5 @@ set(CELMATH_SOURCES sphere.h ) -add_library(celmath STATIC ${CELMATH_SOURCES}) - -#[[ -add_library(celmath SHARED ${CELMATH_SOURCES}) -set_target_properties(celmath PROPERTIES - VERSION ${VERSION} - SOVERSION ${VERSION} -) -]]# - +add_library(celmath OBJECT ${CELMATH_SOURCES}) cotire(celmath) - -#install(TARGETS celmath LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/celmodel/CMakeLists.txt b/src/celmodel/CMakeLists.txt index 636cf1c57..20e03cdf2 100644 --- a/src/celmodel/CMakeLists.txt +++ b/src/celmodel/CMakeLists.txt @@ -9,20 +9,5 @@ set(CELMODEL_SOURCES model.h ) -add_library(celmodel STATIC ${CELMODEL_SOURCES}) - -#[[ -add_library(celmodel SHARED ${CELMODEL_SOURCES}) -set_target_properties(celmodel PROPERTIES - VERSION ${VERSION} - SOVERSION ${VERSION} -) -]]# - -add_dependencies(celmodel celutil) -target_link_libraries(celmodel celutil) - +add_library(celmodel OBJECT ${CELMODEL_SOURCES}) cotire(celmodel) - -#install(TARGETS celmodel LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -#install(TARGETS celmodel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/celttf/CMakeLists.txt b/src/celttf/CMakeLists.txt index bfc475f9f..64cd6af4c 100644 --- a/src/celttf/CMakeLists.txt +++ b/src/celttf/CMakeLists.txt @@ -3,4 +3,4 @@ set(CELTTF_SOURCES truetypefont.h ) -add_library(celttf STATIC ${CELTTF_SOURCES}) +add_library(celttf OBJECT ${CELTTF_SOURCES}) diff --git a/src/celutil/CMakeLists.txt b/src/celutil/CMakeLists.txt index 197e5e25d..d0df4d651 100644 --- a/src/celutil/CMakeLists.txt +++ b/src/celutil/CMakeLists.txt @@ -31,19 +31,5 @@ if (WIN32) ) endif() -add_library(celutil STATIC ${CELUTIL_SOURCES} $) - -#[[ -add_library(celutil SHARED ${CELUTIL_SOURCES}) -set_target_properties(celutil PROPERTIES - VERSION ${VERSION} - SOVERSION ${VERSION} -) -]]# - -add_dependencies(celutil celmath) -target_link_libraries(celutil celmath) - +add_library(celutil OBJECT ${CELUTIL_SOURCES}) cotire(celutil) - -#install(TARGETS celutil LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index 24dbac3b0..70cc5eda1 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -1,8 +1,8 @@ include(TestCase) -test_case(hash celengine) -test_case(fs celengine) -test_case(stellarclass celengine) +test_case(hash) +test_case(fs) +test_case(stellarclass) if(WIN32) - test_case(winutil celutil) + test_case(winutil) endif()