Skip to content

Commit

Permalink
all INSTALL DIR using GNUInstallDirs
Browse files Browse the repository at this point in the history
  • Loading branch information
owent committed Dec 11, 2018
1 parent cf07f92 commit 426641f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion include/libcopp/utils/config/compiler_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# undef UTIL_CONFIG_COMPILER_IS_zOS
# define UTIL_CONFIG_COMPILER_IS_zOS 1

#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
#elif defined(__ibmxl__) || (defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800)
# undef UTIL_CONFIG_COMPILER_IS_XL
# define UTIL_CONFIG_COMPILER_IS_XL 1

Expand Down Expand Up @@ -637,6 +637,8 @@

# if defined(UTIL_CONFIG_COMPILER_CXX_NULLPTR) && UTIL_CONFIG_COMPILER_CXX_NULLPTR
# define UTIL_CONFIG_NULLPTR nullptr
# elif UTIL_CONFIG_COMPILER_IS_GNU
# define UTIL_CONFIG_NULLPTR __null
# else
# define UTIL_CONFIG_NULLPTR 0
# endif
Expand Down
3 changes: 2 additions & 1 deletion project/cmake/TargetOption.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 设置实际的默认编译输出目录,为防止呗外部模块设置,所以要先判定一下

set(CMAKE_INSTALL_LIBDIR "lib${PLATFORM_SUFFIX}" CACHE STRING "install for library dir")
include(GNUInstallDirs)
# add CMAKE_INSTALL_*, CMAKE_INSTALL_LIBDIR, CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_INCLUDEDIR and etc.

if (NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib${PLATFORM_SUFFIX}")
Expand Down
4 changes: 2 additions & 2 deletions src/libcopp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ endif()
add_library(${PROJECT_LIBCOPP_LIB_LINK} ${COPP_SRC_LIST})

install(TARGETS ${PROJECT_LIBCOPP_LIB_LINK}
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(DIRECTORY "${PROJECT_LIBCOPP_INC_DIR}"
DESTINATION include
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
USE_SOURCE_PERMISSIONS
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
Expand Down
4 changes: 2 additions & 2 deletions src/libcotask/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ source_group_by_dir(COTASK_SRC_LIST)
add_library(${PROJECT_LIBCOTASK_LIB_LINK} ${COTASK_SRC_LIST})

install(TARGETS ${PROJECT_LIBCOTASK_LIB_LINK}
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(DIRECTORY "${PROJECT_LIBCOTASK_INC_DIR}"
DESTINATION include
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
USE_SOURCE_PERMISSIONS
PATTERN ".svn" EXCLUDE
PATTERN ".git" EXCLUDE
Expand Down

0 comments on commit 426641f

Please sign in to comment.