*/}}

CMakeLists.txt 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. cmake_minimum_required(VERSION 3.1)
  2. project(demo)
  3. find_package(lagui REQUIRED)
  4. include_directories(
  5. ${LAGUI_INCLUDE_DIRS_ALL}
  6. )
  7. add_definitions(-w)
  8. set(SimplestFiles ${CMAKE_SOURCE_DIR}/simplest.c)
  9. set(OperatorFiles ${CMAKE_SOURCE_DIR}/operator.c)
  10. set(SimplePropertiesFiles ${CMAKE_SOURCE_DIR}/simple_properties.c)
  11. set(WidgetsFiles ${CMAKE_SOURCE_DIR}/widgets.c)
  12. set(WidgetFlagsFiles ${CMAKE_SOURCE_DIR}/widget_flags.c)
  13. set(FruitsFiles ${CMAKE_SOURCE_DIR}/fruits.c)
  14. set(ModellingFiles ${CMAKE_SOURCE_DIR}/modelling_main.c)
  15. set(CalculatorFiles ${CMAKE_SOURCE_DIR}/calculator.c)
  16. set(NVGTestFiles ${CMAKE_SOURCE_DIR}/nvgtest.c)
  17. set(ExampleViewerFiles ${CMAKE_SOURCE_DIR}/example_viewer.c)
  18. add_executable(simplest ${SimplestFiles})
  19. add_executable(operator ${OperatorFiles})
  20. add_executable(simple_properties ${SimplePropertiesFiles})
  21. add_executable(widgets ${WidgetsFiles})
  22. add_executable(widget_flags ${WidgetFlagsFiles})
  23. add_executable(fruits ${FruitsFiles})
  24. add_executable(modelling_main ${ModellingFiles})
  25. add_executable(calculator ${CalculatorFiles})
  26. add_executable(nvgtest ${NVGTestFiles})
  27. add_executable(example_viewer ${ExampleViewerFiles})
  28. target_link_libraries(simplest ${LAGUI_SHARED_LIBS} )
  29. target_link_libraries(operator ${LAGUI_SHARED_LIBS} )
  30. target_link_libraries(simple_properties ${LAGUI_SHARED_LIBS} )
  31. target_link_libraries(widgets ${LAGUI_SHARED_LIBS} )
  32. target_link_libraries(widget_flags ${LAGUI_SHARED_LIBS} )
  33. target_link_libraries(fruits ${LAGUI_SHARED_LIBS} )
  34. target_link_libraries(modelling_main ${LAGUI_SHARED_LIBS} )
  35. target_link_libraries(calculator ${LAGUI_SHARED_LIBS} )
  36. target_link_libraries(nvgtest ${LAGUI_SHARED_LIBS} )
  37. target_link_libraries(example_viewer ${LAGUI_SHARED_LIBS} )
  38. add_custom_command(
  39. TARGET example_viewer POST_BUILD
  40. COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/example_source_files
  41. COMMAND cp ${CMAKE_SOURCE_DIR}/nvgtest.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/nvgtest.c
  42. COMMAND cp ${CMAKE_SOURCE_DIR}/calculator.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/calculator.c
  43. COMMAND cp ${CMAKE_SOURCE_DIR}/widgets.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/widgets.c
  44. COMMAND cp ${CMAKE_SOURCE_DIR}/widget_flags.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/widget_flags.c
  45. COMMAND cp ${CMAKE_SOURCE_DIR}/fruits.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/fruits.c
  46. COMMAND cp ${CMAKE_SOURCE_DIR}/modelling_main.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/modelling_main.c
  47. COMMAND cp ${CMAKE_SOURCE_DIR}/simple_properties.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/simple_properties.c
  48. COMMAND cp ${CMAKE_SOURCE_DIR}/operator.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/operator.c
  49. COMMAND cp ${CMAKE_SOURCE_DIR}/simplest.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/simplest.c)