Skip to content

Commit

Permalink
Created separate CMake file for samples
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Jan 30, 2019
1 parent 8d87630 commit 6a3aea3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
15 changes: 1 addition & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,7 @@ if (BOX2D_BUILD_SAMPLES)

add_subdirectory(extern/glfw)
add_subdirectory(extern/imgui)

# box2d-lite samples
set (SAMPLE_SOURCE_FILES
samples/imgui_impl_glfw.cpp
samples/imgui_impl_opengl2.cpp
samples/main.cpp)

set (SAMPLE_HEADER_FILES
samples/imgui_impl_glfw.h
samples/imgui_impl_opengl2.h)

add_executable(samples ${SAMPLE_SOURCE_FILES} ${SAMPLE_HEADER_FILES})
target_include_directories(samples PUBLIC ${OPENGL_INCLUDE_DIR})
target_link_libraries(samples PUBLIC box2d-lite glfw imgui ${OPENGL_LIBRARIES})
add_subdirectory(samples)

# default startup project for Visual Studio
if (MSVC)
Expand Down
14 changes: 14 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project(samples LANGUAGES CXX)

set (SAMPLE_SOURCE_FILES
imgui_impl_glfw.cpp
imgui_impl_opengl2.cpp
main.cpp)

set (SAMPLE_HEADER_FILES
imgui_impl_glfw.h
imgui_impl_opengl2.h)

add_executable(samples ${SAMPLE_SOURCE_FILES} ${SAMPLE_HEADER_FILES})
target_include_directories(samples PUBLIC ${OPENGL_INCLUDE_DIR})
target_link_libraries(samples PUBLIC box2d-lite glfw imgui ${OPENGL_LIBRARIES})

0 comments on commit 6a3aea3

Please sign in to comment.