CMakeLists.txt 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #-------------------------------------------------------------------------------------------
  2. # Copyright (C) Electronic Arts Inc. All rights reserved.
  3. #-------------------------------------------------------------------------------------------
  4. cmake_minimum_required(VERSION 3.14)
  5. include(FetchContent)
  6. project(EAThread CXX)
  7. #-------------------------------------------------------------------------------------------
  8. # Options
  9. #-------------------------------------------------------------------------------------------
  10. option(EATHREAD_BUILD_TESTS "Enable generation of build files for tests" OFF)
  11. #-------------------------------------------------------------------------------------------
  12. # Compiler Flags (TODO: do we really need this?)
  13. #-------------------------------------------------------------------------------------------
  14. set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/scripts/Cmake" CACHE INTERNAL "Inject path to CommonCppFlags")
  15. include(CommonCppFlags)
  16. #-------------------------------------------------------------------------------------------
  17. # Library definition
  18. #-------------------------------------------------------------------------------------------
  19. file(GLOB EATHREAD_SOURCES "source/*.cpp")
  20. add_library(EAThread ${EATHREAD_SOURCES})
  21. #-------------------------------------------------------------------------------------------
  22. # Defines
  23. #-------------------------------------------------------------------------------------------
  24. add_definitions(-D_CHAR16T)
  25. add_definitions(-D_CRT_SECURE_NO_WARNINGS)
  26. #-------------------------------------------------------------------------------------------
  27. # Export Include Directories
  28. #-------------------------------------------------------------------------------------------
  29. target_include_directories(EAThread PUBLIC include)
  30. #-------------------------------------------------------------------------------------------
  31. # Package Dependencies
  32. #-------------------------------------------------------------------------------------------
  33. FetchContent_Declare(
  34. EABase
  35. GIT_REPOSITORY https://github.com/electronicarts/EABase.git
  36. GIT_TAG 123363eb82e132c0181ac53e43226d8ee76dea12
  37. GIT_SUBMODULES "" # This should be temporary until we update the cyclic submodule dependencies in EABase.
  38. )
  39. FetchContent_MakeAvailable(EABase)
  40. target_link_libraries(EAThread EABase)
  41. if(EATHREAD_BUILD_TESTS)
  42. add_subdirectory(test)
  43. endif()