-
-
Notifications
You must be signed in to change notification settings - Fork 430
/
Copy pathCMakeLists.txt
53 lines (46 loc) · 1.6 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
47
48
49
50
51
52
53
project(tinygltf-validator CXX)
cmake_minimum_required(VERSION 3.2)
# exe
add_executable(tinygltf-validator
app/tinygltf-validate.cc
src/json-schema.hpp
src/json-schema-draft4.json.cpp
src/json-uri.cpp
src/json-validator.cpp)
target_include_directories(tinygltf-validator
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src)
target_compile_features(tinygltf-validator
PUBLIC
cxx_range_for) # for C++11 - flags
# Enable more compiler warnings, except when using Visual Studio compiler
if(NOT MSVC)
target_compile_options(tinygltf-validator
PUBLIC
-Wall -Wextra)
endif()
target_compile_definitions(tinygltf-validator
PRIVATE
-DJSON_SCHEMA_VALIDATOR_EXPORTS)
# regex with boost if gcc < 4.8 - default is std::regex
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0")
find_package(Boost COMPONENTS regex)
if(NOT Boost_FOUND)
message(STATUS "GCC less then 4.9 and boost-regex NOT found - no regex used")
target_compile_definitions(tinygltf-validator PRIVATE -DJSON_SCHEMA_NO_REGEX)
else()
message(STATUS "GCC less then 4.9 and boost-regex FOUND - using boost::regex")
target_compile_definitions(tinygltf-validator PRIVATE -DJSON_SCHEMA_BOOST_REGEX)
target_include_directories(tinygltf-validator PRIVATE ${Boost_INCLUDE_DIRS})
target_link_libraries(tinygltf-validator PRIVATE ${Boost_LIBRARIES})
endif()
endif()
endif()
# test-zone
# enable_testing()
install ( TARGETS
tinygltf-validator
DESTINATION
bin
)