cmake_minimum_required (VERSION 2.6) project(gui_test C CXX) set(CMAKE_CXX_STANDARD 11) include_directories( ${DEPS_DIR}/include ${DEPS_DIR}/include/gui ${DEPS_DIR}/include/porting ${DEPS_DIR}/include/cairo ${DEPS_DIR}/include/epg ${DEPS_DIR}/include/freetype2 ) set(CMAKE_CXX_FLAGS "-Wl,--copy-dt-needed-entries") #prevent error adding symbols: DSO missing from command line link_directories(${DEPS_DIR}/lib) file(GLOB ExamplesFileList "*.cc") add_custom_target(build_app_examples COMMENT A target that requires all the examples.) foreach(Example ${ExamplesFileList}) message(STATUS "\tCreating build rule for ${Example}") # Get the name without extension or directory get_filename_component(ExampleName ${Example} NAME_WE) # Define example executable add_executable(${ExampleName} ${Example}) # Link example against curlpp target_link_libraries(${ExampleName} gui) # make the meta target depend on this example. add_dependencies(build_app_examples ${ExampleName}) install(TARGETS ${ExampleName} DESTINATION bin/examples) endforeach(Example ${ExamplesFileList}) add_custom_command(TARGET simplewin PRELINK COMMAND zip -r -0 ${CMAKE_CURRENT_BINARY_DIR}/simplewin.pak * WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/assets COMMENT "package assets resource=" )