Skip to content
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
18 changes: 15 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.7)
cmake_minimum_required(VERSION 3.7...4.0)

project(chipmunk)

Expand All @@ -14,11 +14,23 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

include(GNUInstallDirs)
# to manually select install locations of libraries and executables
# -D LIB_INSTALL_DIR mylib
# -D BIN_INSTALL_DIR newbin
set(LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries")
set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables")
if(DEFINED LIB_INSTALL_DIR)
message(WARNING
"LIB_INSTALL_DIR is deprecated, use the standard CMAKE_INSTALL_LIBDIR instead."
)
else()
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
endif()
if(DEFINED BIN_INSTALL_DIR)
message(WARNING
"LIB_INSTALL_DIR is deprecated, use the standard CMAKE_INSTALL_LIBDIR instead."
)
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
endif()

# other options for the build, you can i.e. activate the shared library by passing
# -D BUILD_SHARED=ON
Expand Down
4 changes: 1 addition & 3 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cmake_policy(SET CMP0015 NEW) # Convert relative paths

set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)

Expand Down Expand Up @@ -44,5 +42,5 @@ add_executable(chipmunk_demos ${chipmunk_demos_source_files})
target_link_libraries(chipmunk_demos ${chipmunk_demos_libraries})

if(INSTALL_DEMOS)
install(TARGETS chipmunk_demos RUNTIME DESTINATION bin)
install(TARGETS chipmunk_demos)
endif(INSTALL_DEMOS)
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(BUILD_STATIC)
endif(BUILD_STATIC)

if(BUILD_SHARED OR INSTALL_STATIC)
# FIXME: change to PUBLIC_HEADER to allow building frameworks
install(FILES ${chipmunk_public_header} DESTINATION include/chipmunk)
install(FILES ${chipmunk_constraint_header} DESTINATION include/chipmunk/constraints)
# FIXME: change to target_sources(FILE_SET)
install(FILES ${chipmunk_public_header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chipmunk)
install(FILES ${chipmunk_constraint_header} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/chipmunk/constraints)
endif(BUILD_SHARED OR INSTALL_STATIC)