Skip to content

Instantly share code, notes, and snippets.

@Algogator
Created August 11, 2020 14:23
Show Gist options
  • Save Algogator/ff25947f823e01606efd191fe6cde73f to your computer and use it in GitHub Desktop.
Save Algogator/ff25947f823e01606efd191fe6cde73f to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 2.8.4)
project(lotd)
find_package(PkgConfig REQUIRED)
pkg_search_module(EVENT REQUIRED libevent)
set(libname "config")
file(GLOB SRC
"timer/*.cpp"
"server/*.cpp"
"hardware/*.cpp"
"client/*.cpp"
)
add_library( myLib STATIC ${SRC} )
set(SOURCE_FILES src/main.cpp)
set(ROOTFS_ORIG /home/aphilips/dart/_rootfs)
include_directories("${CMAKE_SOURCE_DIR}/server"
"${CMAKE_SOURCE_DIR}/hardware"
"${CMAKE_SOURCE_DIR}/client"
"${CMAKE_SOURCE_DIR}/timer"
"${CMAKE_SOURCE_DIR}/timeseries"
)
link_directories("${CMAKE_SOURCE_DIR}/server")
add_executable( Main ${SOURCE_FILES} )
target_include_directories(Main PRIVATE ${CMAKE_SOURCE_DIR}/lib)
SET( CMAKE_CXX_FLAGS "-pthread")
#set (CMAKE_SHARED_LINKER_FLAGS "-levent_pthreads -levent_extra -levent_core -levent -lconfig++")
# add_executable(test2 test)
target_link_libraries( Main myLib ${libname}++)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment