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.

47 rivejä
858 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. src/ini-config.c
  12. src/ini-config.h
  13. src/types/int.c
  14. src/types/int.h
  15. src/types/string.c
  16. src/types/string.h
  17. )
  18. add_executable(
  19. test_int
  20. minIni/dev/minIni.h
  21. minIni/dev/minIni.c
  22. tests/test-int.c
  23. src/ini-config.c
  24. src/ini-config.h
  25. src/types/int.c
  26. src/types/int.h
  27. )
  28. set_target_properties (test-int PROPERTIES RUNTIME_OUTPUT_DIRECTORY tests)
  29. add_test(
  30. NAME test-int
  31. COMMAND test-int
  32. WORKING_DIRECTORY tests
  33. )
  34. add_custom_command(
  35. TARGET test-int POST_BUILD
  36. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  37. "${CMAKE_HOME_DIRECTORY}/fixtures/test-int.ini"
  38. $<TARGET_FILE_DIR:test-int>
  39. )