Skip to content

Commit

Permalink
clean up cmakefile a little bit more.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksherlock committed Aug 31, 2016
1 parent 0ec15bc commit fa804e9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ project("mpw-shell")
set (PROJECT_TYPE "CXX")
set (PROJECT_NAME "MPW Shell")


# -std=c++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS FALSE)


#
# build config.h
#
Expand All @@ -24,22 +31,20 @@ CHECK_LIBRARY_EXISTS(history add_history "" HAVE_LIBHISTORY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)




set(CMAKE_CXX_FLAGS "-g -Wall -Wno-unused-variable -Wno-multichar -O1")
add_compile_options(-g -Wall -Wno-unused-variable -Wno-multichar -O1)

if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-const-variable ")
add_compile_options(-Wno-unused-const-variable)
endif()


if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
add_compile_options(-Wno-unused-but-set-variable)
endif()



add_definitions(-I ${CMAKE_SOURCE_DIR}/ -I ${CMAKE_CURRENT_BINARY_DIR}/ )
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})

# from https://github.com/gsauthof/cmake-ragel
macro(RAGEL_TARGET Name Input Output)
Expand Down Expand Up @@ -117,10 +122,6 @@ elseif(HAVE_LIBREADLINE)
endif()


# all this for -std=c++14
set_property (TARGET mpw-shell PROPERTY CXX_STANDARD 14)
set_property (TARGET mpw-shell PROPERTY CXX_STANDARD_REQUIRED TRUE)
set_property (TARGET mpw-shell PROPERTY CXX_EXTENSIONS FALSE)

# create a symlink for mpw-make
add_custom_command(
Expand Down

0 comments on commit fa804e9

Please sign in to comment.