Просмотр исходного кода

CMake: Use target properties to add inih include paths

Yuri Kunde Schlesner 9 лет назад
Родитель
Сommit
cb49df156d
2 измененных файлов с 2 добавлено и 3 удалено
  1. 1 3
      CMakeLists.txt
  2. 1 0
      externals/inih/CMakeLists.txt

+ 1 - 3
CMakeLists.txt

@@ -254,9 +254,7 @@ get_git_head_revision(GIT_REF_SPEC GIT_REV)
 git_describe(GIT_DESC --always --long --dirty)
 git_describe(GIT_DESC --always --long --dirty)
 git_branch_name(GIT_BRANCH)
 git_branch_name(GIT_BRANCH)
 
 
-set(INI_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/externals/inih")
-include_directories(${INI_PREFIX})
-add_subdirectory(${INI_PREFIX})
+add_subdirectory(externals/inih)
 
 
 add_subdirectory(externals)
 add_subdirectory(externals)
 
 

+ 1 - 0
externals/inih/CMakeLists.txt

@@ -9,3 +9,4 @@ set(HEADERS
 
 
 create_directory_groups(${SRCS} ${HEADERS})
 create_directory_groups(${SRCS} ${HEADERS})
 add_library(inih ${SRCS} ${HEADERS})
 add_library(inih ${SRCS} ${HEADERS})
+target_include_directories(inih INTERFACE .)