CMakeLists.txt 802 Bytes
Newer Older
Philip Trettner's avatar
Philip Trettner committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
cmake_minimum_required(VERSION 3.0)
project(NetMessage)

file(GLOB_RECURSE SOURCE_FILES "src/*.cc")
file(GLOB_RECURSE HEADER_FILES "src/*.hh")
file(GLOB_RECURSE SOURCE_FILES_INTERNAL "internal/*.cc")
file(GLOB_RECURSE HEADER_FILES_INTERNAL "internal/*.hh")

add_library(netmessage STATIC ${SOURCE_FILES} ${HEADER_FILES} ${SOURCE_FILES_INTERNAL} ${HEADER_FILES_INTERNAL})
target_include_directories(netmessage PUBLIC src/)
target_include_directories(netmessage PRIVATE internal/)
if (MSVC)
    target_compile_options(netmessage PUBLIC /MP)
else()
    target_compile_options(netmessage PRIVATE -Wall -Werror)
    target_compile_options(netmessage PUBLIC
        $<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)
endif()

find_package(Qt5Core REQUIRED)
target_link_libraries(netmessage PRIVATE ${Qt5Core_LIBRARIES})