-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build][refactoring] Converted Library to a shared library, and moved…
… unnecessary files to tools directory (#24)
- Loading branch information
1 parent
48b02f5
commit b1d9332
Showing
12 changed files
with
42 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
find_package(PNG REQUIRED) | ||
file(GLOB RAY_TRACER_SOURCES *.cpp) | ||
|
||
add_library(ray_tracer OBJECT camera.cpp hierarchy.cpp dump_png.cpp flat_shader.cpp parse.cpp phong_shader.cpp plane.cpp reflective_shader.cpp render_world.cpp sphere.cpp box.cpp mesh.cpp) | ||
add_library(ray_tracer SHARED ${RAY_TRACER_SOURCES}) | ||
|
||
target_include_directories(ray_tracer | ||
PRIVATE ${PNG_INCLUDE_DIR} | ||
PRIVATE ${PROJECT_SOURCE_DIR}/include | ||
PRIVATE ${CMAKE_BINARY_DIR}/generated) | ||
|
||
target_compile_options(ray_tracer | ||
PUBLIC -ffast-math) | ||
|
||
target_link_libraries(ray_tracer ${PNG_LIBRARY}) | ||
|
||
add_executable(original_ray_tracer main.cpp) | ||
|
||
target_include_directories(original_ray_tracer | ||
PRIVATE ${PNG_INCLUDE_DIR} | ||
PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
|
||
target_link_libraries(original_ray_tracer ray_tracer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
find_package(PNG REQUIRED) | ||
|
||
file(GLOB TOOL_COMMON_SOURCES *.cpp) | ||
|
||
add_library(tool_common OBJECT ${TOOL_COMMON_SOURCES}) | ||
|
||
set_target_properties(tool_common PROPERTIES CXX_STANDARD 17) | ||
|
||
target_include_directories(tool_common | ||
PUBLIC . | ||
PRIVATE ${PNG_INCLUDE_DIR} | ||
PRIVATE ${PROJECT_SOURCE_DIR}/include | ||
PRIVATE ${CMAKE_BINARY_DIR}/generated | ||
) | ||
|
||
target_link_libraries(tool_common | ||
PUBLIC ${PNG_LIBRARY}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
add_subdirectory(image) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
add_executable(image_demo main.cpp) | ||
|
||
target_include_directories(image_demo | ||
PRIVATE ${PROJECT_SOURCE_DIR}/include | ||
PRIVATE $<TARGET_PROPERTY:tool_common,INTERFACE_INCLUDE_DIRECTORIES> | ||
) | ||
|
||
target_link_libraries(image_demo | ||
PRIVATE ray_tracer | ||
PRIVATE tool_common) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters