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) add_compile_options("$<$:/utf-8>") add_compile_options("$<$:/utf-8>") 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} ) get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(GENERATOR_IS_MULTI_CONFIG) set(INSTALL_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR}/$) else() set(INSTALL_CONFIG_PATH ${CMAKE_CURRENT_BINARY_DIR}) endif() add_custom_command( TARGET example_viewer POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_CONFIG_PATH}/example_source_files COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/luajit.c ${INSTALL_CONFIG_PATH}/example_source_files/luajit.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/nvgtest.c ${INSTALL_CONFIG_PATH}/example_source_files/nvgtest.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/calculator.c ${INSTALL_CONFIG_PATH}/example_source_files/calculator.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/widgets.c ${INSTALL_CONFIG_PATH}/example_source_files/widgets.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/widget_flags.c ${INSTALL_CONFIG_PATH}/example_source_files/widget_flags.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/fruits.c ${INSTALL_CONFIG_PATH}/example_source_files/fruits.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/modelling_main.c ${INSTALL_CONFIG_PATH}/example_source_files/modelling_main.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/simple_properties.c ${INSTALL_CONFIG_PATH}/example_source_files/simple_properties.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/operator.c ${INSTALL_CONFIG_PATH}/example_source_files/operator.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/simplest.c ${INSTALL_CONFIG_PATH}/example_source_files/simplest.c )