Skip to content

Commit

Permalink
Make cmake better
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Apr 24, 2021
1 parent 12a93e2 commit 678481b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ set(COPYRIGHT "Copyright (c) ${PRODUCT_CURRENT_YEAR} Nicolas Bonnefon, Anton Fil
set(IDENTIFIER "com.github.variar.klogg")
set(PROJECT_DESCRIPTION "${PROJECT_NAME} log viewer")

option(BUILD_TESTS "Build tests" ON)
option(USE_LTO "Use link time optimization" ON)
option(KLOGG_BUILD_TESTS "Build tests" ON)
option(KLOGG_USE_LTO "Use link time optimization" ON)
option(KLOGG_USE_SENTRY "Use Sentry" ON)
option(KLOGG_USE_HYPERSCAN "Use Hyperscan" ON)


set(BUILD_VERSION $ENV{KLOGG_VERSION} CACHE STRING "build version")
set(BUILD_NUMBER "" CACHE STRING "build number")

Expand Down Expand Up @@ -130,7 +129,7 @@ add_test(
COMMAND klogg -platform offscreen -v
)

if (${BUILD_TESTS})
if (${KLOGG_BUILD_TESTS})
add_subdirectory(tests)
endif()

Expand Down
2 changes: 1 addition & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set_target_properties(klogg PROPERTIES AUTOMOC ON)
set_target_properties(klogg_portable PROPERTIES AUTORCC ON)
set_target_properties(klogg_portable PROPERTIES AUTOMOC ON)

if (${USE_LTO})
if (${KLOGG_USE_LTO})
set_property(TARGET klogg PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
set_property(TARGET klogg_portable PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/logdata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ endif()



if (${USE_LTO})
if (${KLOGG_USE_LTO})
set_property(TARGET logdata PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
2 changes: 1 addition & 1 deletion src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ set_target_properties(ui PROPERTIES AUTOUIC ON)
set_target_properties(ui PROPERTIES AUTOMOC ON)

set_property(TARGET ui APPEND PROPERTY AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui")
if (${USE_LTO})
if (${KLOGG_USE_LTO})
set_property(TARGET ui PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

Expand Down

0 comments on commit 678481b

Please sign in to comment.