cmake_minimum_required(VERSION 3.5) project(mdev_fe) # Check for MIDASSYS environment variable if (NOT DEFINED ENV{MIDASSYS}) message(SEND_ERROR "MIDASSYS environment variable not defined.") endif() set(CMAKE_CXX_STANDARD 11) set(MIDASSYS $ENV{MIDASSYS}) if (${CMAKE_SYSTEM_NAME} MATCHES Linux) set(LIBS ${LIBS} -lpthread -lutil -lrt -ldl) endif() if (${CMAKE_SYSTEM_NAME} MATCHES Darwin) set(LIBS ${LIBS} -lutil) endif() add_executable(mdev_fe mdev_fe.cxx ${MIDASSYS}/src/mfed.cxx ${MIDASSYS}/drivers/mdev/mdev_mscb.cxx ${MIDASSYS}/mscb/src/mscb.cxx ) target_include_directories(mdev_fe PRIVATE ${MIDASSYS}/include ${MIDASSYS}/mscb/include ${MIDASSYS}/drivers/mdev ${MIDASSYS}/mxml ) target_link_libraries(mdev_fe ${MIDASSYS}/lib/libmfe.a ${MIDASSYS}/lib/libmidas.a ${LIBS} )