Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,46 @@ project (libmysofa)

INCLUDE(CheckCCompilerFlag)

option(BUILD_TESTS "Build test programs" ON)

CHECK_C_COMPILER_FLAG(-Wall C_HAS_WALL)
IF(C_HAS_WALL)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
ENDIF(C_HAS_WALL)

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")

enable_testing()

add_subdirectory(src)


install(FILES share/default.sofa DESTINATION share/libmysofa)


add_test(sofa2json ../tests/sofa2json.docker sofacoustics.org/data/sofa_api_mo_test/Pulse.sofa)
add_test(nodejs nodejs --version)
add_test(getsofafiles wget -N -r -l 1 -np -c -U libmysofa-tests http://sofacoustics.org/data/sofa_api_mo_test/)
# add_test(ARI_NH2_hrtf_M_dtf256 ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/ARI_NH2_hrtf_M_dtf\ 256.sofa)
# add_test(ARI_NH4_4_freqs ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/ARI_NH4_4_freqs.sofa)
# add_test(ARI_NH4_hrtf_M_dtf256 ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/ARI_NH4_hrtf_M_dtf\ 256.sofa)
# add_test(BTdei-hp_H010-subj_S115-Set02-COMPENSATED.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/BTdei-hp_H010-subj_S115-Set02-COMPENSATED.sofa)
add_test(CIPIC_subject_003_hrir_final ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/CIPIC_subject_003_hrir_final.sofa)
add_test(FHK_HRIR_L2354.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/FHK_HRIR_L2354.sofa)
# add_test(hpir_nh5.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/hpir_nh5.sofa)
add_test(LISTEN_1002_IRC_1002_C_HRIR.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/LISTEN_1002_IRC_1002_C_HRIR.sofa)
add_test(MIT_KEMAR_large_pinna.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/MIT_KEMAR_large_pinna.sofa)
add_test(MIT_KEMAR_normal_pinna.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/MIT_KEMAR_normal_pinna.sofa)
# add_test(Oldenburg_OfficeII.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/Oldenburg_OfficeII.sofa)
add_test(Pulse ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/Pulse.sofa)
add_test(Tester ../tests/compare.sh ../tests/tester.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_0.5m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_0.5m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_1m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_1m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_2m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_2m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_3m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_3m.sofa)

#add_test( ../tests/compare.sh ../sofa_api_mo_test/)
#add_test( ../tests/compare.sh ../sofa_api_mo_test/)

if(BUILD_TESTS)
enable_testing()
add_test(sofa2json ../tests/sofa2json.docker sofacoustics.org/data/sofa_api_mo_test/Pulse.sofa)
add_test(nodejs nodejs --version)
add_test(getsofafiles wget -N -r -l 1 -np -c -U libmysofa-tests http://sofacoustics.org/data/sofa_api_mo_test/)
# add_test(ARI_NH2_hrtf_M_dtf256 ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/ARI_NH2_hrtf_M_dtf\ 256.sofa)
# add_test(ARI_NH4_4_freqs ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/ARI_NH4_4_freqs.sofa)
# add_test(ARI_NH4_hrtf_M_dtf256 ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/ARI_NH4_hrtf_M_dtf\ 256.sofa)
# add_test(BTdei-hp_H010-subj_S115-Set02-COMPENSATED.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/BTdei-hp_H010-subj_S115-Set02-COMPENSATED.sofa)
add_test(CIPIC_subject_003_hrir_final ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/CIPIC_subject_003_hrir_final.sofa)
add_test(FHK_HRIR_L2354.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/FHK_HRIR_L2354.sofa)
# add_test(hpir_nh5.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/hpir_nh5.sofa)
add_test(LISTEN_1002_IRC_1002_C_HRIR.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/LISTEN_1002_IRC_1002_C_HRIR.sofa)
add_test(MIT_KEMAR_large_pinna.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/MIT_KEMAR_large_pinna.sofa)
add_test(MIT_KEMAR_normal_pinna.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/MIT_KEMAR_normal_pinna.sofa)
# add_test(Oldenburg_OfficeII.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/Oldenburg_OfficeII.sofa)
add_test(Pulse ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/Pulse.sofa)
add_test(Tester ../tests/compare.sh ../tests/tester.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_0.5_1_2_3_m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_0.5m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_0.5m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_1m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_1m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_2m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_2m.sofa)
add_test(TU-Berlin_QU_KEMAR_anechoic_radius_3m.sofa ../tests/compare.sh sofacoustics.org/data/sofa_api_mo_test/TU-Berlin_QU_KEMAR_anechoic_radius_3m.sofa)

#add_test( ../tests/compare.sh ../sofa_api_mo_test/)
#add_test( ../tests/compare.sh ../sofa_api_mo_test/)
endif(BUILD_TESTS)

SET(CPACK_PACKAGE_DESCRIPTION "SOFA file reader for better HRTFs")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This library read AES SOFA files and normalizes them")
Expand Down
30 changes: 18 additions & 12 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,29 @@ add_library(mysofa-static STATIC ${libsrc})
add_library(mysofa-shared SHARED ${libsrc})
target_link_libraries (mysofa-static m z)
target_link_libraries (mysofa-shared m z)
SET_TARGET_PROPERTIES(mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(mysofa-static PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1 POSITION_INDEPENDENT_CODE ON)
SET_TARGET_PROPERTIES(mysofa-shared PROPERTIES OUTPUT_NAME mysofa CLEAN_DIRECT_OUTPUT 1)

add_executable(mysofa2json tests/sofa2json.c tests/json.c )
target_link_libraries (mysofa2json ${CMAKE_SOURCE_DIR}/build/src/libmysofa.a m z)

add_executable(tests tests/tests.c tests/tools.c tests/check.c tests/lookup.c tests/neighbors.c tests/interpolate.c tests/resample.c tests/loudness.c
tests/minphase.c tests/easy.c tests/cache.c tests/json.c)

target_link_libraries (tests mysofa-shared cunit)
add_test(NAME tests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND tests)

install(TARGETS mysofa-shared mysofa-static mysofa2json
install(TARGETS mysofa-shared mysofa-static
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

install(FILES hrtf/mysofa.h DESTINATION include)

if(BUILD_TESTS)
add_executable(mysofa2json tests/sofa2json.c tests/json.c )
target_link_libraries (mysofa2json ${CMAKE_SOURCE_DIR}/build/src/libmysofa.a m z)

add_executable(tests tests/tests.c tests/tools.c tests/check.c tests/lookup.c tests/neighbors.c tests/interpolate.c tests/resample.c tests/loudness.c
tests/minphase.c tests/easy.c tests/cache.c tests/json.c)

target_link_libraries (tests mysofa-shared cunit)
add_test(NAME tests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND tests)

install(TARGETS mysofa2json
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
endif(BUILD_TESTS)