--- CMakeLists.txt.orig	2011-12-20 18:30:06 UTC
+++ CMakeLists.txt
@@ -36,19 +36,20 @@ set(TPM_DEVICE_NAME "/dev/tpm")
 else()
 set(TPM_LOG_FILE "/var/log/tpmd.log")
 set(TPM_SOCKET_NAME "/var/run/tpm/tpmd_socket:0")
-set(TPM_STORAGE_NAME "/var/lib/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
+set(TPM_STORAGE_NAME "$ENV{PREFIX}/var/db/tpm/tpm_emulator-1_2_${${PROJECT_NAME}_VERSION_MAJOR}_${${PROJECT_NAME}_VERSION_MINOR}")
 set(TPM_DEVICE_NAME "/dev/tpm")
 endif()
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
-add_definitions(-Wall -Werror -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
+add_definitions(-Wall -Wno-unused-parameter -Wpointer-arith -Wcast-align -Wwrite-strings)
 if("${CMAKE_SYSTEM}" MATCHES "Linux")
     add_definitions(-Wextra)
 endif()
 if(USE_OPENSSL)
     add_definitions(-DUSE_OPENSSL)
 endif()
-include_directories("/opt/local/include")
-link_directories("/opt/local/lib")
+include_directories(${TPM_INCLUDE_DIRS})
+link_directories(${TDDL_LIBRARY_DIRS})
+link_directories(${TPM_LIBRARY_DIRS})
 
 # configure CPack
 set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
