Skip to content

Commit

Permalink
cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
collinalexbell committed May 20, 2024
1 parent c7e1806 commit 45a3d45
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
test
text
*.swp
build/
37 changes: 37 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
cmake_minimum_required(VERSION 3.10)
project(text)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

include_directories(include)

file(GLOB SOURCES
src/*.cpp
)
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/catch.cpp")
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/bufferTest.cpp")
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/InputProcessorTest.cpp")
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/test.cpp")
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp")

add_executable(text ${SOURCES} src/main.cpp)

find_library(NCURSES_LIBRARY NAMES ncurses)
target_link_libraries(text ${NCURSES_LIBRARY})

enable_testing()

add_executable(test_all
${SOURCES}
src/test.cpp
src/catch.cpp
src/bufferTest.cpp
src/InputProcessorTest.cpp
)

target_link_libraries(test_all ${NCURSES_LIBRARY})

add_test(NAME test_all COMMAND test)

install(TARGETS text RUNTIME DESTINATION bin)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 45a3d45

Please sign in to comment.