Commit e8c73a7db21a1ab445b3eabd021cf842ba98ee4d
1 parent
dfc8ab95
Installation working, need to clean up library paths
Showing
2 changed files
with
22 additions
and
11 deletions
openbr/plugins/stasm4.cmake
| @@ -6,5 +6,11 @@ if(${BR_WITH_STASM4}) | @@ -6,5 +6,11 @@ if(${BR_WITH_STASM4}) | ||
| 6 | set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/stasm4.cpp) | 6 | set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/stasm4.cpp) |
| 7 | set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Stasm4_LIBS}) | 7 | set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Stasm4_LIBS}) |
| 8 | 8 | ||
| 9 | - install(DIRECTORY ${Stasm_DIR}/data/ DESTINATION share/openbr/models/stasm) | 9 | + if(WIN32) |
| 10 | + install(FILES ${Stasm4_LIBS} DESTINATION bin) | ||
| 11 | + else() | ||
| 12 | + install(FILES ${Stasm4_LIBS} DESTINATION lib) | ||
| 13 | + endif() | ||
| 14 | + | ||
| 15 | + install(DIRECTORY ${Stasm4_DIR}/data/ DESTINATION share/openbr/models/stasm) | ||
| 10 | endif() | 16 | endif() |
share/openbr/cmake/FindStasm4.cmake
| @@ -23,26 +23,31 @@ foreach(CACHE_VAR ${CACHE_VARS}) | @@ -23,26 +23,31 @@ foreach(CACHE_VAR ${CACHE_VARS}) | ||
| 23 | endif() | 23 | endif() |
| 24 | endforeach() | 24 | endforeach() |
| 25 | 25 | ||
| 26 | -find_path(Stasm_DIR stasm/stasm_lib.h ${CMAKE_SOURCE_DIR}/3rdparty/*) | ||
| 27 | - | ||
| 28 | -message(${CMAKE_ARGS}) | 26 | +find_path(Stasm4_SOURCE_DIR stasm/include/stasm_lib.h ${CMAKE_SOURCE_DIR}/3rdparty/*) |
| 29 | 27 | ||
| 30 | set(stasm_prefix ${CMAKE_BINARY_DIR}/stasm) | 28 | set(stasm_prefix ${CMAKE_BINARY_DIR}/stasm) |
| 31 | 29 | ||
| 32 | # Have to use a name other than stasm so it doesn't conflict with the project itself | 30 | # Have to use a name other than stasm so it doesn't conflict with the project itself |
| 33 | ExternalProject_Add(external_stasm | 31 | ExternalProject_Add(external_stasm |
| 34 | - URL ${Stasm_DIR} | 32 | + URL ${Stasm4_SOURCE_DIR} |
| 35 | PREFIX ${stasm_prefix} | 33 | PREFIX ${stasm_prefix} |
| 36 | CMAKE_ARGS "-DCMAKE_PREFIX_PATH=~/Qt/5.3/clang_64/" | 34 | CMAKE_ARGS "-DCMAKE_PREFIX_PATH=~/Qt/5.3/clang_64/" |
| 37 | INSTALL_COMMAND "" | 35 | INSTALL_COMMAND "" |
| 36 | + BINARY_DIR "${stasm_prefix}/lib" | ||
| 38 | ) | 37 | ) |
| 39 | 38 | ||
| 40 | -file(GLOB HEADERS "${Stasm_DIR}/stasm/*.h") | ||
| 41 | - | ||
| 42 | ExternalProject_Add_Step( | 39 | ExternalProject_Add_Step( |
| 43 | external_stasm | 40 | external_stasm |
| 44 | copy_stasm_headers | 41 | copy_stasm_headers |
| 45 | - COMMAND ${CMAKE_COMMAND} -E copy_directory "${Stasm_DIR}/stasm/include" ${stasm_prefix}/include/stasm | 42 | + COMMAND ${CMAKE_COMMAND} -E copy_directory "${Stasm4_SOURCE_DIR}/stasm/include" ${stasm_prefix}/include/stasm |
| 43 | + COMMENT "Copying stasm headers..." | ||
| 44 | + DEPENDERS configure | ||
| 45 | + ) | ||
| 46 | + | ||
| 47 | +ExternalProject_Add_Step( | ||
| 48 | + external_stasm | ||
| 49 | + copy_stasm_data | ||
| 50 | + COMMAND ${CMAKE_COMMAND} -E copy_directory "${Stasm4_SOURCE_DIR}/data" ${stasm_prefix}/data | ||
| 46 | COMMENT "Copying stasm headers..." | 51 | COMMENT "Copying stasm headers..." |
| 47 | DEPENDERS configure | 52 | DEPENDERS configure |
| 48 | ) | 53 | ) |
| @@ -50,8 +55,8 @@ ExternalProject_Add_Step( | @@ -50,8 +55,8 @@ ExternalProject_Add_Step( | ||
| 50 | # We have to fake a library being created to force external_stasm to be built | 55 | # We have to fake a library being created to force external_stasm to be built |
| 51 | add_library(fake_stasm UNKNOWN IMPORTED) | 56 | add_library(fake_stasm UNKNOWN IMPORTED) |
| 52 | add_dependencies(fake_stasm external_stasm) | 57 | add_dependencies(fake_stasm external_stasm) |
| 53 | - | ||
| 54 | ExternalProject_Get_Property(external_stasm install_dir) | 58 | ExternalProject_Get_Property(external_stasm install_dir) |
| 55 | -include_directories(${install_dir}/include/stasm) | ||
| 56 | 59 | ||
| 57 | -file(GLOB Stasm4_LIBS ${install_dir}/lib/stasm/*) | 60 | +set(Stasm4_DIR ${install_dir}) |
| 61 | +include_directories(${install_dir}/include/stasm) | ||
| 62 | +file(GLOB Stasm4_LIBS ${install_dir}/lib/stasm/*.dylib) |