vcpkg/ports/libodb/CMakeLists.txt

38 lines
1.1 KiB
CMake
Raw Normal View History

2016-10-19 05:57:53 +08:00
cmake_minimum_required(VERSION 3.0)
project(libodb VERSION 2.4.0 LANGUAGES CXX)
2016-10-19 07:53:43 +08:00
set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)")
2016-10-19 05:57:53 +08:00
file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.cxx)
list(FILTER libodb_src EXCLUDE REGEX /posix/.*)
add_library(libodb ${libodb_src})
target_include_directories(libodb
2016-10-19 07:53:43 +08:00
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
2016-10-19 05:57:53 +08:00
)
if(BUILD_SHARED_LIBS)
target_compile_definitions(libodb PRIVATE
-DLIBODB_DYNAMIC_LIB)
else()
target_compile_definitions(libodb PRIVATE
-DLIBODB_STATIC_LIB)
endif()
install(TARGETS libodb EXPORT libodbConfig
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
if(LIBODB_INSTALL_HEADERS)
install(DIRECTORY odb DESTINATION include/
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.hxx"
PATTERN "*.ixx"
PATTERN "*.txx"
)
endif()
2016-10-19 07:53:43 +08:00
install(EXPORT libodbConfig NAMESPACE libodb:: DESTINATION share/libodb)
export(TARGETS libodb NAMESPACE libodb:: FILE libodbConfig.cmake)