*/}}

CMakeLists.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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(ExampleViewerFiles ${CMAKE_SOURCE_DIR}/example_viewer.c)
  17. add_executable(simplest ${SimplestFiles})
  18. add_executable(operator ${OperatorFiles})
  19. add_executable(simple_properties ${SimplePropertiesFiles})
  20. add_executable(widgets ${WidgetsFiles})
  21. add_executable(widget_flags ${WidgetFlagsFiles})
  22. add_executable(fruits ${FruitsFiles})
  23. add_executable(modelling_main ${ModellingFiles})
  24. add_executable(calculator ${CalculatorFiles})
  25. add_executable(example_viewer ${ExampleViewerFiles})
  26. target_link_libraries(simplest ${LAGUI_SHARED_LIBS} )
  27. target_link_libraries(operator ${LAGUI_SHARED_LIBS} )
  28. target_link_libraries(simple_properties ${LAGUI_SHARED_LIBS} )
  29. target_link_libraries(widgets ${LAGUI_SHARED_LIBS} )
  30. target_link_libraries(widget_flags ${LAGUI_SHARED_LIBS} )
  31. target_link_libraries(fruits ${LAGUI_SHARED_LIBS} )
  32. target_link_libraries(modelling_main ${LAGUI_SHARED_LIBS} )
  33. target_link_libraries(calculator ${LAGUI_SHARED_LIBS} )
  34. target_link_libraries(example_viewer ${LAGUI_SHARED_LIBS} )
  35. add_custom_command(
  36. TARGET example_viewer POST_BUILD
  37. COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/example_source_files
  38. COMMAND cp ${CMAKE_SOURCE_DIR}/calculator.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/calculator.c
  39. COMMAND cp ${CMAKE_SOURCE_DIR}/widgets.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/widgets.c
  40. COMMAND cp ${CMAKE_SOURCE_DIR}/widget_flags.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/widget_flags.c
  41. COMMAND cp ${CMAKE_SOURCE_DIR}/fruits.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/fruits.c
  42. COMMAND cp ${CMAKE_SOURCE_DIR}/modelling_main.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/modelling_main.c
  43. COMMAND cp ${CMAKE_SOURCE_DIR}/simple_properties.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/simple_properties.c
  44. COMMAND cp ${CMAKE_SOURCE_DIR}/operator.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/operator.c
  45. COMMAND cp ${CMAKE_SOURCE_DIR}/simplest.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/simplest.c)