Skip to content

Commit 733e913

Browse files
authored
Merge pull request cpp-best-practices#7 from saimen/fix-use-of-cmake-options
Fix use of cmake options
2 parents cb9ff69 + d15e68e commit 733e913

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 3.8)
22

3-
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" FALSE)
4-
option(CPP_STARTER_USE_QT "Enable compilation of QT sample" FALSE)
5-
option(CPP_STARTER_USE_FLTK "Enable compilation of FLTK sample" FALSE)
6-
option(CPP_STARTER_USE_GTKMM "Enable compilation of GTKMM sample" FALSE)
7-
option(CPP_STARTER_USE_IMGUI "Enable compilation of ImGui sample" FALSE)
8-
option(CPP_STARTER_USE_NANA "Enable compilation of Nana GUI sample" FALSE)
3+
option(BUILD_SHARED_LIBS "Enable compilation of shared libraries" OFF)
4+
option(CPP_STARTER_USE_QT "Enable compilation of QT sample" OFF)
5+
option(CPP_STARTER_USE_FLTK "Enable compilation of FLTK sample" OFF)
6+
option(CPP_STARTER_USE_GTKMM "Enable compilation of GTKMM sample" OFF)
7+
option(CPP_STARTER_USE_IMGUI "Enable compilation of ImGui sample" OFF)
8+
option(CPP_STARTER_USE_NANA "Enable compilation of Nana GUI sample" OFF)
99

1010
# Link this 'library' to use the following warnings
1111
add_library(project_warnings INTERFACE)
@@ -63,21 +63,21 @@ target_link_libraries(tester PRIVATE project_warnings --coverage)
6363
add_test(Tester tester)
6464

6565
# qt
66-
if(DEFINED CPP_STARTER_USE_QT)
66+
if(CPP_STARTER_USE_QT)
6767
message("Using Qt")
6868
add_subdirectory(qt)
6969
endif()
7070

7171
# fltk test
72-
if(DEFINED CPP_STARTER_USE_FLTK)
72+
if(CPP_STARTER_USE_FLTK)
7373
find_package(FLTK REQUIRED)
7474
add_executable(test_fltk fltk/test_fltk.cpp)
7575
target_link_libraries(test_fltk PRIVATE project_warnings ${FLTK_LIBRARIES})
7676
target_include_directories(test_fltk PRIVATE ${FLTK_INCLUDE_DIR})
7777
endif()
7878

7979
# gtkmm test
80-
if(DEFINED CPP_STARTER_USE_GTKMM)
80+
if(CPP_STARTER_USE_GTKMM)
8181
find_package(PkgConfig REQUIRED)
8282
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
8383
add_executable(test_gtkmm gtkmm/main.cpp gtkmm/hello_world.cpp)
@@ -86,7 +86,7 @@ if(DEFINED CPP_STARTER_USE_GTKMM)
8686
endif()
8787

8888
# imgui example
89-
if(DEFINED CPP_STARTER_USE_IMGUI)
89+
if(CPP_STARTER_USE_IMGUI)
9090
find_package(SFML COMPONENTS graphics window system)
9191
find_package(OpenGL)
9292

@@ -101,7 +101,7 @@ if(DEFINED CPP_STARTER_USE_IMGUI)
101101
endif()
102102

103103
# Nana
104-
if(DEFINED CPP_STARTER_USE_NANA)
104+
if(CPP_STARTER_USE_NANA)
105105
include(ExternalProject)
106106
externalproject_add(Nana
107107
GIT_REPOSITORY

0 commit comments

Comments
 (0)