Skip to content

Some CMake improvements #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/fbcode_builder/getdeps/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ def _build(self, reconfigure) -> None:
copy_if_different(src, dest)

cmake_lists = """
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5...4.0)
project(sqlite3 C)
add_library(sqlite3 STATIC sqlite3.c)
# These options are taken from the defaults in Makefile.msc in
Expand Down
2 changes: 1 addition & 1 deletion build/fbcode_builder/getdeps/py_wheel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
)

CMAKE_HEADER = """
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.8...4.0)

project("{manifest_name}" LANGUAGES C)

Expand Down
11 changes: 6 additions & 5 deletions cachelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.

cmake_minimum_required (VERSION 3.12)
cmake_minimum_required (VERSION 3.12...4.0)

## TODO: get version from variable
project (CacheLib VERSION 0.1)
Expand All @@ -44,16 +44,17 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

option(BUILD_TESTS "If enabled, compile the tests." ON)

include(GNUInstallDirs)

set(BIN_INSTALL_DIR bin CACHE STRING
set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE STRING
"The subdirectory where binaries should be installed")
set(TESTS_INSTALL_DIR tests CACHE STRING
"The subdirectory where test binaries should be installed")
set(INCLUDE_INSTALL_DIR include/cachelib CACHE STRING
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/cachelib CACHE STRING
"The subdirectory where header files should be installed")
set(LIB_INSTALL_DIR lib CACHE STRING
set(LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING
"The subdirectory where libraries should be installed")
set(CMAKE_INSTALL_DIR lib/cmake/cachelib CACHE STRING
set(CMAKE_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/cachelib CACHE STRING
"The subdirectory where CMake package config files should be installed")
set(CONFIGS_INSTALL_DIR test_configs CACHE STRING
"The subdirectory where sample test configurations should be installed")
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_cache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required (VERSION 3.12)
cmake_minimum_required (VERSION 3.12...4.0)

project (cachelib-cmake-test-project VERSION 0.1)

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_compact_cache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required (VERSION 3.12)
cmake_minimum_required (VERSION 3.12...4.0)

project (cachelib-cmake-test-project VERSION 0.1)

Expand Down
2 changes: 1 addition & 1 deletion examples/single_tier_cache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required (VERSION 3.12)
cmake_minimum_required (VERSION 3.12...4.0)

project (cachelib-cmake-test-project VERSION 0.1)

Expand Down