mpw/CMakeLists.txt

67 lines
1.8 KiB
CMake
Raw Normal View History

2016-08-09 12:16:12 +00:00
cmake_minimum_required(VERSION 3.1)
2016-08-02 21:12:15 +00:00
project(mpw)
set (PROJECT_TYPE "CXX")
set (PROJECT_NAME "mpw")
2016-08-03 00:12:17 +00:00
# these are only effective as of CMake 3.1, apparently.
# Use c++14 for all C++ files, c99 for C files.
#
2016-08-02 21:12:15 +00:00
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS FALSE)
2016-08-03 00:12:17 +00:00
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_EXTENSIONS FALSE)
2016-08-02 21:12:15 +00:00
if (APPLE)
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
set(CMAKE_CXX_FLAGS "-stdlib=libc++ -Wall -g")
set(CMAKE_C_FLAGS "-Wall -g")
2016-08-02 21:12:15 +00:00
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
2016-08-09 12:16:12 +00:00
set(CMAKE_CXX_FLAGS "-Wall -g -Wno-unknown-pragmas")
2016-08-03 00:33:41 +00:00
set(CMAKE_C_FLAGS "-std=c99 -Wall -g")
2016-08-02 21:12:15 +00:00
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
2016-08-09 12:16:12 +00:00
set(CMAKE_CXX_FLAGS "-Wall -g -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "-Wall -g")
2016-08-02 21:12:15 +00:00
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Windows")
endif()
#
# create the config.h file.
#
INCLUDE (CheckIncludeFiles)
INCLUDE (CheckTypeSize)
CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
CHECK_INCLUDE_FILES(sys/endian.h HAVE_SYS_ENDIAN_H)
CHECK_INCLUDE_FILES(machine/endian.h HAVE_MACHINE_ENDIAN_H)
SET(CMAKE_EXTRA_INCLUDE_FILES dirent.h)
CHECK_TYPE_SIZE("((struct dirent *)0)->d_namlen" DIRENT_D_NAMLEN)
SET(CMAKE_EXTRA_INCLUDE_FILES)
SET(CMAKE_EXTRA_INCLUDE_FILES sys/stat.h)
CHECK_TYPE_SIZE("((struct stat *)0)->st_birthtime" STAT_ST_BIRTHTIME)
SET(CMAKE_EXTRA_INCLUDE_FILES)
2016-08-09 15:56:25 +00:00
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h)
2016-08-02 21:12:15 +00:00
2013-02-06 04:41:11 +00:00
add_subdirectory(bin)
2013-02-07 04:44:12 +00:00
add_subdirectory(cpu)
2013-02-08 00:47:49 +00:00
add_subdirectory(toolbox)
2013-02-11 01:18:47 +00:00
add_subdirectory(mplite)
add_subdirectory(mpw)
2013-03-04 03:17:27 +00:00
add_subdirectory(macos)
2016-08-09 12:16:12 +00:00
add_subdirectory(cxx)
add_subdirectory(native)