CMakeLists.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. set(SQSTDLIB_SRC sqstdaux.cpp
  2. sqstdblob.cpp
  3. sqstdio.cpp
  4. sqstdmath.cpp
  5. sqstdrex.cpp
  6. sqstdstream.cpp
  7. sqstdstring.cpp
  8. sqstdsystem.cpp)
  9. if(NOT DISABLE_DYNAMIC)
  10. add_library(sqstdlib SHARED ${SQSTDLIB_SRC})
  11. add_library(squirrel::sqstdlib ALIAS sqstdlib)
  12. set_property(TARGET sqstdlib PROPERTY EXPORT_NAME sqstdlib)
  13. set_property(TARGET sqstdlib PROPERTY OUTPUT_NAME ${SQSTDLIB_NAME})
  14. target_link_libraries(sqstdlib squirrel)
  15. if(NOT SQ_DISABLE_INSTALLER)
  16. install(TARGETS sqstdlib EXPORT squirrel
  17. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Libraries
  18. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries NAMELINK_SKIP
  19. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
  20. )
  21. install(TARGETS sqstdlib EXPORT squirrel
  22. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development NAMELINK_ONLY
  23. )
  24. endif()
  25. target_include_directories(sqstdlib PUBLIC
  26. "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
  27. "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
  28. )
  29. endif()
  30. if(NOT DISABLE_STATIC)
  31. add_library(sqstdlib_static STATIC ${SQSTDLIB_SRC})
  32. add_library(squirrel::sqstdlib_static ALIAS sqstdlib_static)
  33. set_property(TARGET sqstdlib_static PROPERTY EXPORT_NAME sqstdlib_static)
  34. if(NOT SQ_DISABLE_INSTALLER)
  35. install(TARGETS sqstdlib_static EXPORT squirrel ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Development)
  36. endif()
  37. target_include_directories(sqstdlib_static PUBLIC
  38. "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
  39. "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
  40. )
  41. endif()
  42. if(LONG_OUTPUT_NAMES)
  43. if(NOT DISABLE_STATIC)
  44. set_target_properties(sqstdlib_static PROPERTIES OUTPUT_NAME sqstdlib3_static)
  45. endif()
  46. endif()