CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. set(CMAKE_C_STANDARD 99)
  2. if(NOT DISABLE_DYNAMIC)
  3. add_executable(sq sq.c)
  4. add_executable(squirrel::interpreter ALIAS sq)
  5. set_target_properties(sq PROPERTIES EXPORT_NAME interpreter)
  6. target_link_libraries(sq squirrel sqstdlib)
  7. if(NOT SQ_DISABLE_INSTALLER)
  8. install(TARGETS sq EXPORT squirrel RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)
  9. endif()
  10. target_include_directories(sq PUBLIC
  11. "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
  12. "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
  13. )
  14. endif()
  15. if(NOT DISABLE_STATIC)
  16. add_executable(sq_static sq.c)
  17. add_executable(squirrel::interpreter_static ALIAS sq_static)
  18. set_target_properties(sq_static PROPERTIES EXPORT_NAME interpreter_static)
  19. target_link_libraries(sq_static squirrel_static sqstdlib_static)
  20. if(NOT SQ_DISABLE_INSTALLER)
  21. install(TARGETS sq_static EXPORT squirrel RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime)
  22. endif()
  23. target_include_directories(sq_static PUBLIC
  24. "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
  25. "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
  26. )
  27. endif()
  28. if(LONG_OUTPUT_NAMES)
  29. if(NOT DISABLE_DYNAMIC)
  30. set_target_properties(sq PROPERTIES OUTPUT_NAME squirrel3)
  31. endif()
  32. if(NOT DISABLE_STATIC)
  33. set_target_properties(sq_static PROPERTIES OUTPUT_NAME squirrel3_static)
  34. endif()
  35. endif()