@@ -33,13 +33,13 @@ else()
3333 -Wpedantic # warn if non-standard C++ is used
3434 -Wconversion # warn on type conversions that may lose data
3535 -Wsign-conversion # warn on sign conversions
36- -Wmisleading-indentation # warn if identation implies blocks where blocks
36+ # -Wmisleading-indentation # warn if identation implies blocks where blocks
3737 # do not exist
38- -Wduplicated-cond # warn if if / else chain has duplicated conditions
39- -Wduplicated-branches # warn if if / else branches have duplicated code
38+ # -Wduplicated-cond # warn if if / else chain has duplicated conditions
39+ # -Wduplicated-branches # warn if if / else branches have duplicated code
4040 -Wlogical-op # warn about logical operations being used where bitwise were
4141 # probably wanted
42- -Wnull-dereference # warn if a null dereference is detected
42+ # -Wnull-dereference # warn if a null dereference is detected
4343 -Wuseless-cast # warn if you perform a cast to the same type
4444 -Wdouble-promotion # warn if float is implicit promoted to double
4545 -Wformat=2 # warn on security issues around functions that format output
@@ -48,37 +48,46 @@ else()
4848endif ()
4949
5050add_executable (intro main.cpp)
51- target_compile_features (intro PRIVATE cxx_std_17 )
51+ # target_compile_features(intro PRIVATE cxx_std_14 )
5252target_link_libraries (intro PRIVATE project_warnings --coverage)
5353
54- #qt
55- find_package ( Qt5Widgets REQUIRED )
56- set ( CMAKE_AUTOMOC ON )
57- add_executable ( helloQt qt/qtMain.cpp qt/HelloQt.cpp )
58- target_link_libraries ( helloQt Qt5::Widgets )
59- target_compile_features ( helloQt PUBLIC cxx_nullptr )
60-
6154enable_testing ()
6255
6356add_executable (tester tester.cpp)
6457target_link_libraries (tester PRIVATE project_warnings --coverage)
6558
6659add_test (Tester tester)
6760
61+ #qt
62+ if ( DEFINED CPP_STARTER_USE_QT )
63+ message ( "Using Qt" )
64+ find_package ( Qt5Widgets REQUIRED )
65+ set ( CMAKE_AUTOMOC ON )
66+ add_executable ( helloQt qt/qtMain.cpp qt/HelloQt.cpp )
67+ #set_target_properties( helloQt PROPERTIES CMAKE_AUTOMOC ON )
68+ target_link_libraries ( helloQt Qt5::Widgets )
69+ target_compile_features ( helloQt PUBLIC cxx_nullptr cxx_lambdas )
70+ endif ()
71+
6872#fltk test
73+ if ( DEFINED CPP_STARTER_USE_FLTK )
6974find_package (FLTK REQUIRED)
7075add_executable (test_fltk fltk/test_fltk.cpp)
7176target_link_libraries (test_fltk PRIVATE project_warnings ${FLTK_LIBRARIES} )
7277target_include_directories (test_fltk PRIVATE ${FLTK_INCLUDE_DIR} )
78+ endif ()
7379
7480# gtkmm test
81+ if ( DEFINED CPP_STARTER_USE_GTKMM )
7582find_package (PkgConfig REQUIRED)
7683pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
7784add_executable (test_gtkmm gtkmm/main.cpp gtkmm/hello_world.cpp)
7885target_link_libraries (test_gtkmm PRIVATE project_warnings ${GTKMM_LIBRARIES} )
7986target_include_directories (test_gtkmm PRIVATE ${GTKMM_INCLUDE_DIRS} )
87+ endif ()
8088
8189# imgui example
90+ if ( DEFINED CPP_STARTER_USE_IMGUI )
8291find_package (SFML COMPONENTS graphics window system )
8392find_package (OpenGL)
8493
@@ -90,8 +99,10 @@ target_link_libraries(imgui INTERFACE ${SFML_LIBRARIES} ${OPENGL_gl_LIBRARY})
9099add_executable (test_imgui imgui/test .cpp)
91100target_link_libraries (test_imgui PRIVATE project_warnings imgui)
92101target_include_directories (test_imgui PRIVATE ${SFML_INCLUDE_DIR} )
102+ endif ()
93103
94- # Nana
104+ ## Nana
105+ if ( DEFINED CPP_STARTER_USE_NANA )
95106include (ExternalProject)
96107ExternalProject_add(
97108 Nana
@@ -106,5 +117,4 @@ ExternalProject_Get_Property(Nana SOURCE_DIR BINARY_DIR)
106117add_executable (test_nana nana/main.cpp)
107118target_include_directories (test_nana PRIVATE ${SOURCE_DIR} /include )
108119target_link_libraries (test_nana PRIVATE ${BINARY_DIR} /libnana.so ${NANA_LINKS} )
109-
110-
120+ endif ()
0 commit comments