-
Notifications
You must be signed in to change notification settings - Fork 115
/
CMakeLists.txt
46 lines (36 loc) · 1.12 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.0.0)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(io2d CXX)
if( MSVC )
if(CMAKE_C_FLAGS MATCHES "/W[0-4]")
string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
endif()
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string (REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()
add_compile_options(/permissive-)
#else()
# message(STATUS "Not MSVC")
endif()
# Setup default installation subpaths, if they were not defined outside
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_BINDIR bin)
endif()
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
set(CMAKE_INSTALL_INCLUDEDIR include/io2d)
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR lib)
endif()
add_subdirectory(P0267_RefImpl/P0267_RefImpl)
if( NOT DEFINED IO2D_WITHOUT_SAMPLES )
add_subdirectory(P0267_RefImpl/Samples)
endif()
if( NOT DEFINED IO2D_WITHOUT_TESTS )
enable_testing()
add_subdirectory(P0267_RefImpl/Tests)
endif()