diff --git a/CMakeLists.txt b/CMakeLists.txt index d7771be..7a7e37c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 0000000..870d441 --- /dev/null +++ b/samples/CMakeLists.txt @@ -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})