forked from mcauley-penney/mmv-c
-
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.
Replaced the build system from Make to CMake
Add /build dir to ignore Add CMakeLists.txt file to configure build system Del Makefile
- Loading branch information
Showing
4 changed files
with
43 additions
and
88 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
/build/ |
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,29 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
set(NAME mmv) | ||
|
||
project(${NAME}-c C) | ||
|
||
set(SRCDIR ${CMAKE_SOURCE_DIR}/src) | ||
|
||
include_directories(${SRCDIR}) | ||
|
||
file(GLOB SRCS ${SRCDIR}/*.c) | ||
|
||
add_executable(${NAME} ${CMAKE_SOURCE_DIR}/main.c ${SRCS}) | ||
|
||
|
||
option(TESTING "Enable tests executables" OFF) | ||
|
||
if(TESTING) | ||
message(STATUS "Enable testing") | ||
enable_testing() | ||
add_subdirectory(libs/Unity) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
|
||
include(GNUInstallDirs) | ||
|
||
install(TARGETS ${NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
install(FILES ${CMAKE_SOURCE_DIR}/man/${NAME}.1.gz DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) |
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,13 @@ | ||
|
||
add_executable(test_utils ${CMAKE_CURRENT_SOURCE_DIR}/test_utils.c) | ||
target_link_libraries(test_utils PRIVATE unity::framework) | ||
add_test(NAME Utils COMMAND test_utils) | ||
|
||
add_executable(test_set ${CMAKE_CURRENT_SOURCE_DIR}/test_set.c) | ||
target_link_libraries(test_set PRIVATE unity::framework) | ||
add_test(NAME Set COMMAND test_set) | ||
|
||
add_executable(test_mmv ${CMAKE_CURRENT_SOURCE_DIR}/test_mmv.c) | ||
target_link_libraries(test_mmv PRIVATE unity::framework) | ||
add_test(NAME mmv COMMAND test_mmv) | ||
set_tests_properties(mmv PROPERTIES ENVIRONMENT "EDITOR=true") |