Warning, /sdk/codevis/thirdparty/soci/examples/subdir-include/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # This is a very simple example of using SOCI in a CMake-based project
0002 # when placing SOCI in a subdirectory lib/soci/ of your project.
0003 # For this example, the SOCI backend called Empty is used.
0004
0005 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
0006
0007 project(SOCIExampleSubdirectoryInclude)
0008
0009 set(SOCI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/soci)
0010
0011 # All compile options need to be set before the SOCI directory gets included.
0012 # The backend you want to use needs to be enabled here.
0013 option(SOCI_EMPTY "Build the sample backend called Empty" ON)
0014
0015 # This line needs to be changed to include the directory you placed SOCI in, e.g.
0016 # add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/soci ${SOCI_BINARY_DIR})
0017 add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../.. ${SOCI_BINARY_DIR})
0018
0019 add_executable(subdir_include subdir-include.cpp)
0020
0021 # Link the soci_<backend> libraries you want to use here.
0022 # There is no need to explicitly use target_include_directories() for the
0023 # main headers or the generated header (soci/soci-config.h), because both
0024 # are automatically added as part of the Soci::core target.
0025 target_link_libraries(subdir_include
0026 PRIVATE
0027 Soci::core
0028 Soci::empty
0029 )