Fix header usage in MSVS build

This commit is contained in:
Stephen Seo 2020-08-09 17:00:27 +09:00
parent bfe92f50f9
commit 4219b79ed8

View file

@ -77,13 +77,23 @@ target_link_libraries(TrianglesLib PUBLIC
) )
endif() endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_include_directories(TrianglesLib PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${SFML_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui # imgui related headers
${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui-sfml # imgui-sfml related headers
)
else()
target_include_directories(TrianglesLib PUBLIC target_include_directories(TrianglesLib PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src
${SFML_INCLUDE_DIR} ${SFML_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/build_include # imgui related headers ${CMAKE_CURRENT_SOURCE_DIR}/build_include # imgui related headers
) )
endif()
# Use macro to override imgui config header # Use macro to override imgui config header
target_compile_definitions(TrianglesLib PRIVATE target_compile_definitions(TrianglesLib PUBLIC
"IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui-sfml/imconfig-SFML.h\"") "IMGUI_USER_CONFIG=\"${CMAKE_CURRENT_SOURCE_DIR}/third_party/imgui-sfml/imconfig-SFML.h\"")
if(CMAKE_BUILD_TYPE MATCHES "Debug") if(CMAKE_BUILD_TYPE MATCHES "Debug")