aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/CMakeLists.txt
blob: 3fc3b4f6200104c225eb4d93d9a4c7834ca90864 (plain) (tree)
1
2
3
4
5
6
7
8



                                                                   

                

                           



                                                                        
 
                                                       
                                                        
 




                                                                 

                                                        
 
                                                      






                                                     
cmake_minimum_required(VERSION 3.5) # for Boost::* imported targets

project(winapi_common CXX)

enable_testing()

include(cmake/common.cmake)

file(GLOB_RECURSE winapi_common_include "include/*.hpp")
file(GLOB winapi_common_src "src/*.cpp")
add_library(winapi_common ${winapi_common_include} ${winapi_common_src})
target_include_directories(winapi_common PUBLIC include)

add_subdirectory(3rdparty/winapi/utf8 EXCLUDE_FROM_ALL)
target_link_libraries(winapi_common PRIVATE winapi_utf8)

if(NOT TARGET SafeInt)
    add_subdirectory(3rdparty/microsoft/SafeInt EXCLUDE_FROM_ALL)
endif()
target_link_libraries(winapi_common PUBLIC SafeInt)

find_package(Boost REQUIRED)
target_link_libraries(winapi_common PUBLIC Boost::boost)

install(TARGETS winapi_common ARCHIVE DESTINATION lib)
install(DIRECTORY include/winapi DESTINATION include)

if(WINAPI_COMMON_TESTS)
    add_subdirectory(test)
endif()

install(FILES LICENSE.txt DESTINATION share)