-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (32 loc) · 1.7 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 3.9)
project(fastwfc VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(DEFAULT_BUILD_TYPE "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.")
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
endif()
include(GNUInstallDirs)
set(SOURCE_FILES
src/include/fastwfc/wfc.hpp)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
set(LIBRARY_OUTPUT_PATH lib CACHE PATH "Build directory" FORCE)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/include>)
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1)
add_executable(${PROJECT_NAME}_demo examples/src/lib/main.cpp)
set_target_properties(fastwfc PROPERTIES LINKER_LANGUAGE CXX)
target_include_directories(${PROJECT_NAME}_demo PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/examples/src/include>)
install(TARGETS ${PROJECT_NAME}_demo EXPORT FastWFCConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION share/fastwfc-examples)
install(DIRECTORY examples/samples DESTINATION share/fastwfc-examples)
install(FILES examples/samples.xml DESTINATION share/fastwfc-examples)
install(FILES examples/results/.empty DESTINATION share/fastwfc-examples/results)
install(DIRECTORY src/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
install(EXPORT FastWFCConfig DESTINATION share/fastwfc/cmake)
export(TARGETS ${PROJECT_NAME} FILE FastWFCConfig.cmake)