Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake error at cmakeLists.txt:39 (include directories) #21

Open
hgbutte opened this issue Feb 11, 2021 · 1 comment
Open

cmake error at cmakeLists.txt:39 (include directories) #21

hgbutte opened this issue Feb 11, 2021 · 1 comment

Comments

@hgbutte
Copy link

hgbutte commented Feb 11, 2021

I am using cmake to build on Windows and VS2019.
sqlpp11 is installed through VCPKG

cmake .. -G"Visual Studio 16 2019" -A Win32 -DCMAKE_TOOLCHAIN_FILE="D:\Tools\vcpkg\scripts\buildsystems\vcpkg.cmake" -DSQLPP11_ODBC_DISABLE_SHARED=ON

results in

-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.17763.
-- The CXX compiler identification is MSVC 19.28.29337.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ODBC: C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0/um
-- Configuring done
CMake Error at CMakeLists.txt:39 (include_directories):
  Error evaluating generator expression:

    $<TARGET_PROPERTY:sqlpp11,INTERFACE_INCLUDE_DIRECTORIES>

  Target "sqlpp11" not found.

When i remove line 39 it works:
include_directories(${HinnantDate_INCLUDE_DIR} $<TARGET_PROPERTY:sqlpp11,INTERFACE_INCLUDE_DIRECTORIES>)

@hgbutte
Copy link
Author

hgbutte commented Feb 11, 2021

Found another problem with using in VCPKG

"cmake --build" cannot find sqlpp11 headers.

When replacing this
target_link_libraries(sqlpp11-odbc INTERFACE sqlpp11 ${ODBC_LIBRARIES})

with that
target_link_libraries(sqlpp11-odbc INTERFACE sqlpp11::sqlpp11 ${ODBC_LIBRARIES})

headers are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant