File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ add_library(my_header_lib INTERFACE)
22target_link_libraries (my_header_lib INTERFACE project_options project_warnings ) # link project_options/warnings
33
44# Includes
5- set (my_header_lib_INCLUDE_DIR ". /include" CACHE STRING "" ) # must be relative paths
5+ set (my_header_lib_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /include" CACHE STRING "" ) # must be relative paths
66target_include_directories (
7- my_header_lib INTERFACE "$<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} / ${ my_header_lib_INCLUDE_DIR} >"
7+ my_header_lib INTERFACE "$<BUILD_INTERFACE :${my_header_lib_INCLUDE_DIR} >"
88 "$<INSTALL_INTERFACE :${CMAKE_INSTALL_INCLUDEDIR} >" )
99
1010# Find dependencies:
Original file line number Diff line number Diff line change @@ -2,12 +2,16 @@ add_library(my_lib "./src/my_lib/lib.cpp")
22target_link_libraries (my_lib PRIVATE project_options project_warnings ) # link project_options/warnings
33
44# Includes
5- set (my_lib_INCLUDE_DIR "include" CACHE STRING "" ) # must be relative paths
6- target_include_directories (my_lib PUBLIC "$<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /${my_lib_INCLUDE_DIR} >"
5+ set (my_lib_INCLUDE_DIR
6+ "${CMAKE_CURRENT_SOURCE_DIR} /include"
7+ CACHE STRING "" )
8+ target_include_directories (my_lib PUBLIC "$<BUILD_INTERFACE :${my_lib_INCLUDE_DIR} >"
79 "$<INSTALL_INTERFACE :./${CMAKE_INSTALL_INCLUDEDIR} >" )
810
911# Find dependencies:
10- set (my_lib_DEPENDENCIES_CONFIGURED fmt CACHE STRING "" )
12+ set (my_lib_DEPENDENCIES_CONFIGURED
13+ fmt
14+ CACHE STRING "" )
1115
1216foreach (DEPENDENCY ${my_lib_DEPENDENCIES_CONFIGURED} )
1317 find_package (${DEPENDENCY} CONFIG REQUIRED )
You can’t perform that action at this time.
0 commit comments