Skip to content

Commit

Permalink
initial cmake script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joker2770 committed Nov 19, 2020
1 parent 589ae39 commit 33706e7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
## files generated by popular Visual Studio add-ons.

# User-specific files
*.txt
*.o
*.so
*morse-encode-and-decode
Expand Down
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.10)

project(morse-encode-and-decode)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_FLAGS, "-Wall")

if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "My multi config types" FORCE)
elseif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
file(GLOB SRCS "src/*.c" "src/*.h")
add_executable(${PROJECT_NAME} ${SRCS})

if(UNIX)
set(CMAKE_INSTALL_PREFIX /usr/local)
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
elseif(WIN32)
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/")
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
endif()

0 comments on commit 33706e7

Please sign in to comment.