Skip to content

Commit

Permalink
Properly install libmodule's headers in /usr/include/module/ directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeDP committed Mar 25, 2018
1 parent bd690cf commit f5f9af6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ set(PRIVATE_H Lib/module_priv.h)
# Include header files
include_directories(Lib)

add_library(module SHARED ${SOURCES})
add_library(${PROJECT_NAME} SHARED ${SOURCES})

set_target_properties(module PROPERTIES
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
PUBLIC_HEADER "${PUBLIC_H}"
Expand All @@ -29,11 +29,11 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_GNU_SOURCE -fvisibility=hidden")

configure_file(Extra/libmodule.pc.in libmodule.pc @ONLY)

target_include_directories(module PRIVATE Lib/)
target_include_directories(${PROJECT_NAME} PRIVATE Lib/)

install(TARGETS module
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/)

install(FILES ${CMAKE_BINARY_DIR}/libmodule.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)
Expand Down
1 change: 0 additions & 1 deletion Lib/modules.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ static void modules_destroy(void) {
hashmap_free(ctx);
}


module_ret_code modules_ctx_set_logger(const char *ctx_name, log_cb logger) {
MOD_ASSERT(logger, "NULL logger. Fallbacking to default.", MOD_ERR);
GET_CTX(ctx_name);
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- [x] review hashmap code
- [x] split in modules.h and module.h
- [ ] install public headers in "/usr/lib/module/module.h/modules.h?"
- [x] install public headers in "/usr/lib/module/module.h/modules.h?"
- [ ] update doc

## Test it
Expand Down

0 comments on commit f5f9af6

Please sign in to comment.