-
Notifications
You must be signed in to change notification settings - Fork 7
/
CMakeLists.txt
36 lines (28 loc) · 990 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
cmake_minimum_required(VERSION 3.6)
project(hdlcpp VERSION 1.0.0 LANGUAGES CXX)
add_library(${PROJECT_NAME} INTERFACE)
include(GNUInstallDirs)
target_include_directories(${PROJECT_NAME}
INTERFACE ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME})
install(FILES include/Hdlcpp.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hdlcpp)
install(EXPORT ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NAMESPACE hdlcpp:: FILE ${PROJECT_NAME}-config.cmake
EXPORT_LINK_INTERFACE_LIBRARIES
)
if (BUILD_HDLCPP_MAIN)
include_directories(include)
add_library(${PROJECT_NAME}-main src/main.cpp)
target_include_directories(${PROJECT_NAME}-main PUBLIC include)
endif()
if (BUILD_TESTING)
include(cmake/Externals.cmake)
include_directories(include)
if (BUILD_EXTERNAL)
add_subdirectory(src)
endif()
add_subdirectory(test)
add_subdirectory(python)
endif()