1- cmake_minimum_required (VERSION 3.14 )
1+ cmake_minimum_required (VERSION 3.15 )
22
33project (dxfplotter)
44
@@ -15,11 +15,13 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
1515set (BUILD_TESTS OFF )
1616set (JUST_INSTALL_CEREAL ON )
1717
18- # Compilation flag with all warning and error as much as possible on warning.
19- add_compile_options (-fPIC -Wall -Wextra -Werror -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=unknown-pragmas -Wno-expansion-to-defined -Wno-error=missing-field-initializers )
18+ set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG :Debug >:Debug >" )
2019
21- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
22- add_compile_options (-Wno-error=deprecated-copy -Wno-error=maybe-uninitialized )
20+ # Compilation flag with all warnings.
21+ if (MSVC )
22+ add_compile_options (/W4 )
23+ else ()
24+ add_compile_options (-fPIC -Wall -Wextra )
2325endif ()
2426
2527set (CMAKE_CXX_STANDARD 17)
@@ -29,28 +31,26 @@ set(TEMPLATE_DIR ${PROJECT_SOURCE_DIR}/template)
2931
3032find_package (codecov )
3133
34+ find_package (PythonInterp )
35+
3236find_package (Qt5 COMPONENTS REQUIRED
3337 Widgets
3438 Gui
3539)
3640
37- find_package (yaml-cpp REQUIRED )
38- find_package (fmt REQUIRED )
39-
4041set (INCLUDE_DIRS
4142 src
4243 thirdparty
4344 thirdparty/cereal/include
4445 thirdparty/cavaliercontours/include
4546 thirdparty/fmt/include
4647 thirdparty/nanoflann/include
47- thirdparty/tomlplusplus /include
48+ thirdparty/yaml-cpp /include
4849 template
4950 ${CMAKE_BINARY_DIR} /src
5051 ${CMAKE_BINARY_DIR} /template
5152 ${Qt5Widgets_INCLUDE_DIRS}
5253 ${Qt5Gui_INCLUDE_DIRS}
53- ${YAML_CPP_INCLUDE_DIRS}
5454)
5555
5656set (LINK_LIBRARIES
@@ -70,7 +70,7 @@ set(LINK_LIBRARIES
7070 libdxfrw
7171 fmt::fmt
7272 Qt5::Widgets
73- ${YAML_CPP_LIBRARIES}
73+ yaml-cpp
7474)
7575
7676include_directories (${INCLUDE_DIRS} )
0 commit comments