Define simple configuration on INI files.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
902 B

  1. cmake_minimum_required(VERSION 3.24)
  2. project(ini_config C)
  3. set(CMAKE_C_STANDARD 11)
  4. include(CTest)
  5. include_directories(
  6. "${CMAKE_HOME_DIRECTORY}/src"
  7. "${CMAKE_HOME_DIRECTORY}/minIni/dev"
  8. )
  9. add_library(
  10. ini_config STATIC
  11. minIni/dev/minIni.h
  12. minIni/dev/minIni.c
  13. src/ini-config.c
  14. src/ini-config.h
  15. src/types/int.c
  16. src/types/int.h
  17. src/types/string.c
  18. src/types/string.h
  19. )
  20. add_executable(
  21. test_int
  22. minIni/dev/minIni.h
  23. minIni/dev/minIni.c
  24. tests/test-int.c
  25. src/ini-config.c
  26. src/ini-config.h
  27. src/types/int.c
  28. src/types/int.h
  29. )
  30. set_target_properties (test_int PROPERTIES RUNTIME_OUTPUT_DIRECTORY tests)
  31. add_test(
  32. NAME test_int
  33. COMMAND test_int
  34. WORKING_DIRECTORY tests
  35. )
  36. add_custom_command(
  37. TARGET test_int POST_BUILD
  38. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  39. "${CMAKE_HOME_DIRECTORY}/fixtures/test-int.ini"
  40. $<TARGET_FILE_DIR:test_int>
  41. )