Skip to content

Commit

Permalink
Remove include_directories and link_directories (#967)
Browse files Browse the repository at this point in the history
Remove include_directories and link_directories
  • Loading branch information
durswd authored Oct 25, 2023
1 parent d53c468 commit f65d2bb
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 48 deletions.
11 changes: 0 additions & 11 deletions Dev/Cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,6 @@ if (BUILD_VIEWER OR BUILD_EDITOR)
add_subdirectory(3rdParty)
endif()

# set include directories
include_directories(
Effekseer/
include/
)

# set lib directories
link_directories(
${PROJECT_SOURCE_DIR}/lib/
)

# Add compile targets
if (BUILD_DX12 OR BUILD_METAL OR BUILD_VULKAN)
set(BUILD_TEST_TEMP ${BUILD_TEST})
Expand Down
3 changes: 0 additions & 3 deletions Dev/Cpp/EffekseerMaterial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ else()
file(GLOB_RECURSE srcs *.cpp)
endif()

# set include directories
include_directories(../include/)

# Add compile targets
add_library( EffekseerMaterial STATIC ${hs} ${srcs} )

Expand Down
2 changes: 1 addition & 1 deletion Dev/Cpp/EffekseerMaterialCompiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_library(

target_link_libraries(
EffekseerMaterialCompilerCommon
PRIVATE
PUBLIC
Effekseer
)

Expand Down
8 changes: 3 additions & 5 deletions Dev/Cpp/EffekseerMaterialEditor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ file(GLOB hs
Dialog/*.h
Graphics/*.h)

link_directories(
${PROJECT_SOURCE_DIR}/../lib/
)

# Add compile targets
add_executable(
EffekseerMaterialEditor
Expand Down Expand Up @@ -137,7 +133,9 @@ FIND_PACKAGE(OpenGL REQUIRED)
find_package(X11 REQUIRED)
find_package(Threads REQUIRED)

include_directories(
target_include_directories(
EffekseerMaterialEditor
PRIVATE
${OPENGL_INCLUDE_DIR}
${X11_INCLUDE_DIR})

Expand Down
5 changes: 4 additions & 1 deletion Dev/Cpp/EffekseerSoundAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ if(OpenAL_FOUND)
add_library(EffekseerSoundAL STATIC
${effekseer_sound_h}
${effekseer_sound_src})


target_link_libraries(${PROJECT_NAME} PUBLIC
Effekseer)

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/EffekseerSoundAL>)
Expand Down
3 changes: 3 additions & 0 deletions Dev/Cpp/EffekseerSoundDSound/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ add_library(EffekseerSoundDSound STATIC
${effekseer_sound_h}
${effekseer_sound_src})

target_link_libraries(${PROJECT_NAME} PUBLIC
Effekseer)

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/EffekseerSoundDSound>)
Expand Down
3 changes: 3 additions & 0 deletions Dev/Cpp/EffekseerSoundOSMixer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ target_include_directories(
PRIVATE
${EFK_THIRDPARTY_INCLUDES})

target_link_libraries(${PROJECT_NAME} PUBLIC
Effekseer)

target_link_directories(
EffekseerSoundOSMixer
PRIVATE
Expand Down
3 changes: 3 additions & 0 deletions Dev/Cpp/EffekseerSoundXAudio2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ add_library(EffekseerSoundXAudio2 STATIC
${effekseer_sound_h}
${effekseer_sound_src})

target_link_libraries(${PROJECT_NAME} PUBLIC
Effekseer)

target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/EffekseerSoundXAudio2>)
Expand Down
26 changes: 12 additions & 14 deletions Dev/Cpp/TakeScreenshots/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@ set(effekseer_take_screenshots_src
Helper.cpp
)

include_directories(
${EFK_THIRDPARTY_INCLUDES}
../Effekseer/
../EffekseerRendererGL/
../EffekseerSoundAL/
)

if(WIN32)
include_directories(
${EFK_THIRDPARTY_INCLUDES}
../EffekseerRendererDX11/
)
endif()

set(common_lib)
set(common_inc)

Expand Down Expand Up @@ -74,6 +60,18 @@ add_executable(${PROJECT_NAME} ${effekseer_take_screenshots_src})
target_link_directories(${PROJECT_NAME} PRIVATE ${EFK_THIRDPARTY_LIBRARY_DIRECTORIES})
target_link_libraries(${PROJECT_NAME} PRIVATE TestRuntimeFramework)

target_include_directories(
${PROJECT_NAME} PRIVATE
${EFK_THIRDPARTY_INCLUDES}
)

if(WIN32)
target_include_directories(
${PROJECT_NAME} PRIVATE
${EFK_THIRDPARTY_INCLUDES}
)
endif()

if (NOT APPLE)
if(WIN32)
target_link_libraries(
Expand Down
5 changes: 0 additions & 5 deletions Dev/Cpp/Viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,6 @@ if(WIN32)
add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GLEW)
endif()

link_directories(
${PROJECT_SOURCE_DIR}/../lib/
)


if(CLANG_FORMAT_ENABLED)
clang_format(Viewer)
endif()
Expand Down
5 changes: 4 additions & 1 deletion Examples/CustomAsyncLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/CustomLoader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/Distortion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/NetworkClient/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/NetworkServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/OpenGL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/SortHandle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down
5 changes: 4 additions & 1 deletion Examples/Trigger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ endif()
if(UNIX AND NOT APPLE)
find_package(X11 REQUIRED)

include_directories(${X11_INCLUDE_DIR})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${X11_INCLUDE_DIR})

target_link_libraries(
${PROJECT_NAME}
Expand Down

0 comments on commit f65d2bb

Please sign in to comment.