# common/CMakeLists.txt cmake_minimum_required(VERSION 3.10) project(simworld VERSION 0.0.1 LANGUAGES C) set(SOURCE_DIR ${CMAKE_SOURCE_DIR}/common/src) file(GLOB_RECURSE SOURCES ${SOURCE_DIR}/*.c) add_library(${PROJECT_NAME} SHARED ${SOURCES}) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/common/include) find_package(PkgConfig REQUIRED) pkg_check_modules(LUA REQUIRED lua5.4) pkg_check_modules(JANSSON REQUIRED jansson) target_link_libraries(${PROJECT_NAME} ${LUA_LIBRARIES} ${JANSSON_LIBRARIES}) target_include_directories(${PROJECT_NAME} PRIVATE ${LUA_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS}) install(TARGETS ${PROJECT_NAME} DESTINATION lib)