CMakeLists.txt 657 B

123456789101112131415161718192021222324252627
  1. set(SRCS
  2. analog_from_button.cpp
  3. keyboard.cpp
  4. main.cpp
  5. )
  6. set(HEADERS
  7. analog_from_button.h
  8. keyboard.h
  9. main.h
  10. )
  11. if(SDL2_FOUND)
  12. set(SRCS ${SRCS} sdl/sdl.cpp)
  13. set(HEADERS ${HEADERS} sdl/sdl.h)
  14. include_directories(${SDL2_INCLUDE_DIR})
  15. endif()
  16. create_directory_groups(${SRCS} ${HEADERS})
  17. add_library(input_common STATIC ${SRCS} ${HEADERS})
  18. target_link_libraries(input_common common core)
  19. if(SDL2_FOUND)
  20. target_link_libraries(input_common ${SDL2_LIBRARY})
  21. set_property(TARGET input_common APPEND PROPERTY COMPILE_DEFINITIONS HAVE_SDL2)
  22. endif()