cmake_minimum_required(VERSION 3.16) project(sessiond LANGUAGES C CXX) # The following is needed, as we have both "sessiond" and "libsessiond" in our project, # and we don't want "libsessiond" to become "liblibsessiond". That would be tragic. set(CMAKE_SHARED_LIBRARY_PREFIX "") # Needed for ASLR to work set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE -Wno-error=shadow -Werror=missing-field-initializers") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIE -Wno-error=shadow -Werror=missing-field-initializers") set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") add_subdirectory(common) add_subdirectory(libsessiond) add_subdirectory(sessiond) add_subdirectory(clientExample) option(ENABLE_TARGET_TESTS "On target tests" ON) if(ENABLE_TARGET_TESTS) find_package(GTest REQUIRED) add_subdirectory(libsessiond/target_test) endif(ENABLE_TARGET_TESTS) enable_testing() #set ON if want run libsessiond test option(ENABLE_LIB_TESTS "Run libsessiond unit tests after build" OFF) if(ENABLE_LIB_TESTS) find_package(GTest REQUIRED) include(CTest) add_subdirectory(libsessiond/test) endif(ENABLE_LIB_TESTS) #set ON if want run sessiond tests option(ENABLE_SESSIOND_TESTS "Run sessiond unit tests after build" OFF) if(ENABLE_SESSIOND_TESTS) find_package(GTest REQUIRED) include(CTest) add_subdirectory(sessiond/test) endif(ENABLE_SESSIOND_TEST)