mirror of
https://github.com/ksherlock/mpw.git
synced 2025-01-05 02:31:12 +00:00
b8d17f4481
* Check C and C++ compiler separately It's possible (however unlikely) that the C++ compiler might be clang but the C compiler might not be. * Don't overwrite user-specified CFLAGS and CXXFLAGS
39 lines
861 B
CMake
39 lines
861 B
CMake
cmake_minimum_required(VERSION 3.1)
|
|
project(mpw VERSION 0.8.3 LANGUAGES CXX C)
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
|
set(CMAKE_CXX_EXTENSIONS FALSE)
|
|
|
|
set(CMAKE_C_STANDARD 99)
|
|
set(CMAKE_C_STANDARD_REQUIRED TRUE)
|
|
set(CMAKE_C_EXTENSIONS FALSE)
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|
# Clang or AppleClang
|
|
set(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS}")
|
|
endif()
|
|
|
|
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
|
|
# Clang or AppleClang
|
|
set(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
|
|
endif()
|
|
|
|
|
|
find_program(RAGEL NAMES ragel)
|
|
if (NOT RAGEL)
|
|
message(FATAL_ERROR "ragel (version 6) is required.")
|
|
endif()
|
|
|
|
|
|
include_directories("${CMAKE_SOURCE_DIR}")
|
|
|
|
add_subdirectory(bin)
|
|
add_subdirectory(cpu)
|
|
add_subdirectory(toolbox)
|
|
add_subdirectory(mplite)
|
|
add_subdirectory(mpw)
|
|
add_subdirectory(macos)
|
|
|
|
add_subdirectory(libsane)
|