Skip to content

Commit

Permalink
Improve CMake
Browse files Browse the repository at this point in the history
* Do not hardcode paths
* Specify RelWithDebugInfo as default CMAKE_BUILD_TYPE
* Hopefully have correct rpath information on mac
  • Loading branch information
ktf committed Jun 4, 2021
1 parent fc07e0f commit 02a2d2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ project(DebugGUI
LANGUAGES C CXX
)


find_package(GLFW NAMES glfw3 CONFIG)

# Set CMAKE_INSTALL_LIBDIR explicitly to lib (to avoid lib64 on CC7)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "RelWithDebInfo"
CACHE
STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel Coverage."
FORCE
)
endif()
set(CMAKE_INSTALL_LIBDIR lib)
add_subdirectory(DebugGUI)
10 changes: 6 additions & 4 deletions DebugGUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,15 @@ write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/cmake/DebugGUIConf
COMPATIBILITY AnyNewerVersion
)

set(CMAKE_INSTALL_LIBDIR lib)

install(TARGETS DebugGUI
EXPORT
DebugGUITargets
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_PREFIX}/include/DebugGUI
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(TARGETS ${GLFW_TESTS} ImGUIHeadless
Expand Down

0 comments on commit 02a2d2b

Please sign in to comment.