12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- cmake_minimum_required(VERSION 3.1)
- project(demo)
- set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
- find_package(lagui REQUIRED)
- find_package(LuaJIT OPTIONAL_COMPONENTS)
- include_directories(
- ${LAGUI_INCLUDE_DIRS_ALL}
- )
- if(LUAJIT_FOUND)
- include_directories(${LUA_INCLUDE_DIR})
- endif()
- add_definitions(-w)
- set(SimplestFiles ${CMAKE_SOURCE_DIR}/simplest.c)
- set(OperatorFiles ${CMAKE_SOURCE_DIR}/operator.c)
- set(SimplePropertiesFiles ${CMAKE_SOURCE_DIR}/simple_properties.c)
- set(WidgetsFiles ${CMAKE_SOURCE_DIR}/widgets.c)
- set(WidgetFlagsFiles ${CMAKE_SOURCE_DIR}/widget_flags.c)
- set(FruitsFiles ${CMAKE_SOURCE_DIR}/fruits.c)
- set(ModellingFiles ${CMAKE_SOURCE_DIR}/modelling_main.c)
- set(CalculatorFiles ${CMAKE_SOURCE_DIR}/calculator.c)
- set(NVGTestFiles ${CMAKE_SOURCE_DIR}/nvgtest.c)
- if(LUAJIT_FOUND)
- set(LuajitFiles ${CMAKE_SOURCE_DIR}/luajit.c)
- endif()
- set(ExampleViewerFiles ${CMAKE_SOURCE_DIR}/example_viewer.c)
- add_executable(simplest ${SimplestFiles})
- add_executable(operator ${OperatorFiles})
- add_executable(simple_properties ${SimplePropertiesFiles})
- add_executable(widgets ${WidgetsFiles})
- add_executable(widget_flags ${WidgetFlagsFiles})
- add_executable(fruits ${FruitsFiles})
- add_executable(modelling_main ${ModellingFiles})
- add_executable(calculator ${CalculatorFiles})
- add_executable(nvgtest ${NVGTestFiles})
- if(LUAJIT_FOUND)
- add_executable(luajit ${LuajitFiles})
- endif()
- add_executable(example_viewer ${ExampleViewerFiles})
- target_link_libraries(simplest ${LAGUI_SHARED_LIBS} )
- target_link_libraries(operator ${LAGUI_SHARED_LIBS} )
- target_link_libraries(simple_properties ${LAGUI_SHARED_LIBS} )
- target_link_libraries(widgets ${LAGUI_SHARED_LIBS} )
- target_link_libraries(widget_flags ${LAGUI_SHARED_LIBS} )
- target_link_libraries(fruits ${LAGUI_SHARED_LIBS} )
- target_link_libraries(modelling_main ${LAGUI_SHARED_LIBS} )
- target_link_libraries(calculator ${LAGUI_SHARED_LIBS} )
- target_link_libraries(nvgtest ${LAGUI_SHARED_LIBS} )
- if(LUAJIT_FOUND)
- target_link_libraries(luajit ${LAGUI_SHARED_LIBS} ${LUA_LIBRARY})
- endif()
- target_link_libraries(example_viewer ${LAGUI_SHARED_LIBS} )
- add_custom_command(
- TARGET example_viewer POST_BUILD
- COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/example_source_files
- COMMAND cp ${CMAKE_SOURCE_DIR}/luajit.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/luajit.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/nvgtest.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/nvgtest.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/calculator.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/calculator.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/widgets.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/widgets.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/widget_flags.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/widget_flags.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/fruits.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/fruits.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/modelling_main.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/modelling_main.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/simple_properties.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/simple_properties.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/operator.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/operator.c
- COMMAND cp ${CMAKE_SOURCE_DIR}/simplest.c ${CMAKE_CURRENT_BINARY_DIR}/example_source_files/simplest.c)
|