Correct(?) syntax with target_compile_options() in top level CMakeLists.txt. Correct the logic flow in libncxml/CMakeLists.txt to not try to include non-existant directory when libxml2 is not found.

This commit is contained in:
Ward Fisher 2024-02-23 14:06:17 -07:00
parent 1e31577a2c
commit 44cb18169e
2 changed files with 13 additions and 8 deletions

View File

@ -132,7 +132,7 @@ include(GNUInstallDirs)
if(MSVC)
set(GLOBAL PROPERTY USE_FOLDERS ON)
target_compile_options(netcdf "/utf-8")
target_compile_options(netcdf PUBLIC "/utf-8")
endif()
# auto-configure style checks, other CMake modules.

View File

@ -5,14 +5,19 @@ ELSE()
ENDIF()
add_library(ncxml OBJECT ${libncxml_SOURCES})
target_include_directories(ncxml
PUBLIC
./include
PRIVATE
${LIBXML2_INCLUDE_DIRS}
IF(HAVE_LIBXML2)
target_include_directories(ncxml
PUBLIC
./include
PRIVATE
${LIBXML2_INCLUDE_DIRS}
)
ELSE()
target_include_directories(ncxml
PUBLIC
./include
)
ENDIF(HAVE_LIBXML2)
#IF(NOT MSVC)
#target_compile_features(ncxml PUBLIC cxx_std_11)