Skip to content
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

cmake improvements #37

Merged
merged 3 commits into from
Sep 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
project(TPM_Emulator C)

cmake_minimum_required(VERSION 2.4)
include(GNUInstallDirs)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
Expand Down Expand Up @@ -66,14 +67,21 @@ include_directories(${CMAKE_BINARY_DIR})

# add internal libraries
add_subdirectory(tpm)
add_subdirectory(mtm)
if(MTM_EMULATOR)
add_subdirectory(mtm)
endif()
add_subdirectory(crypto)

# add TDDL
add_subdirectory(tddl)

# add kernel modules
add_subdirectory(tpmd_dev)
if(NOT DEFINED BUILD_DEV)
set(BUILD_DEV ON)
endif()
if(BUILD_DEV)
add_subdirectory(tpmd_dev)
endif()

# add executables
add_subdirectory(tpmd)
Expand Down
6 changes: 3 additions & 3 deletions tddl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ elseif(WIN32)
set_target_properties(tddl PROPERTIES PREFIX "")
endif()

install(TARGETS tddl DESTINATION lib)
install(TARGETS tddl_static DESTINATION lib)
install(FILES "tddl.h" DESTINATION include)
install(TARGETS tddl DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS tddl_static DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES "tddl.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(test_tddl test_tddl.c)
Expand Down
2 changes: 1 addition & 1 deletion tpmd/unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ target_link_libraries(tpmd mtm tpm tpm_crypto)
else()
target_link_libraries(tpmd tpm tpm_crypto)
endif()
install(TARGETS tpmd RUNTIME DESTINATION bin)
install(TARGETS tpmd RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})