Skip to content

Commit

Permalink
Update install directory
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Sep 10, 2021
1 parent 5b61eda commit 6d371d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ include(cmake/functions.cmake)
#######################################################
# Set variables with project properties
set_master_project_booleans() # detect if master project / dev mode
option(SMALL_DEV_BUILD "Development build" ${MASTER_PROJECT})
set_debug_booleans() # detect if debug
set_optimization_flags() # detect and set default optimization flags
set_compiler_booleans() # detect compiler
Expand All @@ -37,6 +36,9 @@ set_compiler_booleans() # detect compiler
option(SMALL_BUILD_INSTALLER "Build installer target" ${MASTER_PROJECT})
option(SMALL_BUILD_PACKAGE "Build package" ${MASTER_PROJECT})

# How to build
option(SMALL_DEV_BUILD "Development build" ${MASTER_PROJECT})

#######################################################
### Dev Options ###
#######################################################
Expand All @@ -46,7 +48,7 @@ option(SMALL_BUILD_TESTS "Build tests" ${SMALL_DEV_BUILD})
option(SMALL_BUILD_TESTS_WITH_PCH "Build tests with precompiled headers" ${SMALL_DEV_BUILD})

# How to build
option(SMALL_BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." ${DEBUG_MODE})
option(SMALL_BUILD_WITH_PEDANTIC_WARNINGS "Use pedantic warnings. This is useful for developers because many of these warnings will be in continuous integration anyway." ${SMALL_DEV_BUILD})
option(SMALL_BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(SMALL_BUILD_WITH_SANITIZERS "Use pedantic warnings." ${DEBUG_MODE})

Expand Down Expand Up @@ -128,8 +130,8 @@ if (SMALL_BUILD_INSTALLER)
# https://cliutils.gitlab.io/modern-cmake/chapters/install/installing.html
# Set variable where the cmake config is
set(CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/small)
message("CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
message("CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}")
message(STATUS "${CMAKE_PROJECT_NAME} install directory: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "${CMAKE_PROJECT_NAME} library install directory: ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")

# Create smallConfigVersion.cmake and install it
if (CMAKE_PROJECT_VERSION VERSION_LESS 1.0.0)
Expand Down
2 changes: 1 addition & 1 deletion cmake/functions/target_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endmacro()

# @brief Maybe set pedantic compiler options for all targets
macro(maybe_add_pedantic_warnings)
if (BUILD_WITH_PEDANTIC_WARNINGS)
if (SMALL_BUILD_WITH_PEDANTIC_WARNINGS)
add_pedantic_warnings()
endif ()
endmacro()
Expand Down
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if (SMALL_BUILD_INSTALLER)
)

# Install headers
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/small
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
Expand Down

0 comments on commit 6d371d2

Please sign in to comment.