Warning, /education/marble/src/lib/astro/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 PROJECT(astro VERSION ${RELEASE_SERVICE_VERSION}) 0002 0003 INCLUDE_DIRECTORIES( 0004 ${CMAKE_CURRENT_SOURCE_DIR} 0005 ${CMAKE_CURRENT_BINARY_DIR} 0006 ) 0007 0008 set(ASTRO_CMAKECONFIGNAME Astro) 0009 set(ASTRO_LIB_VERSION ${PROJECT_VERSION}) 0010 set(ASTRO_LIB_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) 0011 set(ASTRO_LIB_VERSION_MINOR ${PROJECT_VERSION_MINOR}) 0012 set(ASTRO_LIB_VERSION_PATCH ${PROJECT_VERSION_PATCH}) 0013 set(ASTRO_LIB_SOVERSION 1) 0014 set(HEADER_PREFIX ASTRO_LIB) 0015 configure_file("${marble_SOURCE_DIR}/cmake/templates/versionheader.h.in" "${CMAKE_CURRENT_BINARY_DIR}/astro_version.h") 0016 include(CMakePackageConfigHelpers) 0017 write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}ConfigVersion.cmake" VERSION "${PROJECT_VERSION}" COMPATIBILITY AnyNewerVersion) 0018 0019 ADD_DEFINITIONS(-O3) 0020 0021 SET(astrolib_SRCS 0022 astrolib.cpp 0023 astr2lib.cpp 0024 attlib.cpp 0025 eclsolar.cpp 0026 planetarySats.cpp 0027 solarsystem.cpp 0028 ) 0029 0030 ADD_LIBRARY(astro ${astrolib_SRCS}) 0031 generate_export_header(astro BASE_NAME astrolib) 0032 target_include_directories(astro PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>) 0033 0034 if (APPLE) 0035 #defined in top level makefile 0036 TARGET_LINK_LIBRARIES(astro ${MAC_EXTRA_LIBS}) 0037 endif (APPLE) 0038 0039 if (CMAKE_SYSTEM_NAME MATCHES "SunOS") 0040 TARGET_LINK_LIBRARIES(astro m) 0041 endif (CMAKE_SYSTEM_NAME MATCHES "SunOS") 0042 0043 if(WIN32) 0044 TARGET_LINK_LIBRARIES(astro ws2_32 imm32 winmm) 0045 endif(WIN32) 0046 0047 if (NOT ANDROID) 0048 set_target_properties(astro PROPERTIES 0049 EXPORT_NAME "Astro" 0050 VERSION ${ASTRO_LIB_VERSION} 0051 SOVERSION ${ASTRO_LIB_SOVERSION} 0052 ) 0053 endif() 0054 0055 target_include_directories(astro 0056 INTERFACE "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>" 0057 ) 0058 0059 # choose the correct target install library path 0060 if(WIN32) 0061 INSTALL(TARGETS astro EXPORT AstroTargets RUNTIME DESTINATION . ARCHIVE DESTINATION lib) 0062 elseif(APPLE) 0063 INSTALL(TARGETS astro LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib) 0064 else() 0065 install(TARGETS astro 0066 EXPORT AstroTargets 0067 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 0068 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 0069 ) 0070 endif() 0071 0072 ########### install headers & cmake config files ############### 0073 0074 if (APPLE) 0075 # TODO: find how to install & deploy library, headers and config files as bundle for development 0076 return() 0077 endif() 0078 0079 0080 INSTALL(FILES 0081 astrolib.h 0082 astr2lib.h 0083 attlib.h 0084 eclsolar.h 0085 planetarySats.h 0086 solarsystem.h 0087 ${CMAKE_CURRENT_BINARY_DIR}/astrolib_export.h 0088 ${CMAKE_CURRENT_BINARY_DIR}/astro_version.h 0089 0090 DESTINATION ${INCLUDE_INSTALL_DIR}/astro 0091 ) 0092 0093 ########### CMake Config files ############### 0094 0095 include(CMakePackageConfigHelpers) 0096 0097 set(ASTRO_INSTALL_CMAKECONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${ASTRO_CMAKECONFIGNAME}) 0098 0099 configure_package_config_file(AstroConfig.cmake.in 0100 ${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}Config.cmake 0101 INSTALL_DESTINATION ${ASTRO_INSTALL_CMAKECONFIGDIR} 0102 ) 0103 0104 install(FILES 0105 ${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}Config.cmake 0106 ${CMAKE_CURRENT_BINARY_DIR}/${ASTRO_CMAKECONFIGNAME}ConfigVersion.cmake 0107 0108 DESTINATION ${ASTRO_INSTALL_CMAKECONFIGDIR} 0109 ) 0110 0111 install( 0112 EXPORT AstroTargets 0113 FILE ${ASTRO_CMAKECONFIGNAME}Targets.cmake 0114 DESTINATION ${ASTRO_INSTALL_CMAKECONFIGDIR} 0115 )