Skip to content

Commit

Permalink
refactor: add subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
jwsung91 committed Feb 4, 2025
1 parent fe93d7e commit 93c2abc
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@
*.out
*.app

build
build
.vscode
16 changes: 5 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
cmake_minimum_required(VERSION 3.10)

# Set the project name
project(DijkstraCpp)
project(dijkstra-cpp)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Add include directories
include_directories(include)
add_subdirectory(dijkstra)

# Add the executable
file(GLOB SOURCES "src/*.cc")
add_executable(DijkstraCpp ${SOURCES})

# Optionally, you can add any required libraries here
# target_link_libraries(DijkstraCpp <library_name>)
add_executable(dijkstra_main main.cc)
target_include_directories(dijkstra_main PRIVATE ${CMAKE_SOURCE_DIR}/dijkstra)
target_link_libraries(dijkstra_main dijkstra)
3 changes: 3 additions & 0 deletions dijkstra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
file(GLOB SOURCES "*.cc")

add_library(dijkstra STATIC ${SOURCES})
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 93c2abc

Please sign in to comment.