Fix symlinks
[anna.git] / CMakeLists.txt
index 1cd503d..576325c 100644 (file)
@@ -117,8 +117,8 @@ SUBDIRLIST(SUBDIRS ${CMAKE_CURRENT_SOURCE_DIR}/source)
 FOREACH(subdir ${SUBDIRS})
   message(STATUS "Processing library at: source/${subdir}")
   file(GLOB_RECURSE SRCS source/${subdir}/*.cpp)
-  add_library(${subdir}_static STATIC ${SRCS})
-  add_library(${subdir}_shared SHARED ${SRCS})
+  add_library(anna_${subdir}_static STATIC ${SRCS})
+  add_library(anna_${subdir}_shared SHARED ${SRCS})
 ENDFOREACH()
 
 # <dynamic>
@@ -131,18 +131,15 @@ FOREACH(procedure ${DYNAMIC_PROCEDURES})
 
   message(STATUS "Processing dynamic library at: dynamic/launcher/${rel}")
   file(GLOB_RECURSE SRCS dynamic/launcher/${rel}/*.cpp)
-  add_library(launcher_procedure_${libpath}_shared SHARED ${SRCS})
-  set(target_dirname build/${CMAKE_BUILD_TYPE}/lib/dynamic_launcher/${libpath})
-  set(target_basename launcher_procedure_${libpath}_shared)
+  add_library(anna_launcher_procedure_${libpath}_shared SHARED ${SRCS})
+
+  set(target_dirname build/${CMAKE_BUILD_TYPE}/lib/dynamic/launcher/${rel})
+
+  set(target_basename anna_launcher_procedure_${libpath}_shared)
   set_target_properties(${target_basename} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${target_dirname})
   #file(RENAME ${target_dirname}/lib${target_basename}.so ${target_dirname}/libprocedure.so)
 ENDFOREACH()
 
-# Linking example:
-#file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/example/core/genLogon/*.cpp)
-#add_executable(genLogon ${SRCS})
-#target_link_libraries(genLogon core_static app_static core_static test_static xml_static io_static crypto xml2 rt)
-
 # Generalization:
 # <example>
 SUBDIRLIST(MODULES ${CMAKE_CURRENT_SOURCE_DIR}/example)
@@ -155,7 +152,7 @@ FOREACH(module ${MODULES})
     file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/example/${module}/${subdir}/*.cpp)
 
     # Executable
-    set(target "${module}_${subdir}")
+    set(target "anna_${module}_${subdir}")
     add_executable(${target} "${SRCS}")
     set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CXX)
     set(libraries_file "${CMAKE_CURRENT_SOURCE_DIR}/example/${module}/${subdir}/libraries.txt")
@@ -199,7 +196,7 @@ FOREACH(module ${MODULES})
   file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/*.cpp)
 
   # Executable
-  set(target "test_${module}")
+  set(target "anna_test_${module}")
   add_executable(${target} "${SRCS}")
   target_link_libraries(${target} ${GTEST_BOTH_LIBRARIES} pthread)
   set(libraries_file "${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/libraries.txt")
@@ -216,12 +213,15 @@ ENDFOREACH()
 
 
 # Install
+SET(MY_OWN_INSTALL_PREFIX "/opt/anna" CACHE PATH "Prefix prepended to install directories")
+SET(CMAKE_INSTALL_PREFIX "${MY_OWN_INSTALL_PREFIX}" CACHE INTERNAL "Prefix prepended to install directories" FORCE)
+
 message(STATUS "CMAKE_INSTALL_PREFIX = ${CMAKE_INSTALL_PREFIX}")
 # Binaries:
 file(GLOB_RECURSE BINARIES ${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/*)
 install(PROGRAMS ${BINARIES} DESTINATION bin)
 # Headers:
-install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/anna/ DESTINATION include)
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/anna DESTINATION include)
 # Libraries:
 file(GLOB_RECURSE LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/*)
 install(FILES ${LIBRARIES} DESTINATION lib)