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

fix ios build #416

Merged
merged 1 commit into from
Sep 6, 2024
Merged
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
24 changes: 17 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ option(BUILD_TESTS "Build tests" ON)

option(USE_CRYPTO "Use crypto library" OFF)

option(BUILD_KVAZAAR_BINARY "Build kvazaar-bin" ON) # To build only the lib, useful for iOS-builds

include(GNUInstallDirs) #Helps to define correct distro specific install directories
set(DEFERRED "@")

Expand Down Expand Up @@ -213,18 +215,22 @@ if(MSVC)
list(APPEND CLI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/extras/getopt.c ${CMAKE_CURRENT_SOURCE_DIR}/src/threadwrapper/src/pthread.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/threadwrapper/src/semaphore.cpp)
endif()

add_executable(kvazaar-bin ${CLI_SOURCES})
if(BUILD_KVAZAAR_BINARY)
add_executable(kvazaar-bin ${CLI_SOURCES})

set_target_properties(kvazaar-bin PROPERTIES OUTPUT_NAME kvazaar)
set_target_properties(kvazaar-bin PROPERTIES RUNTIME_OUTPUT_NAME kvazaar)
set_target_properties(kvazaar-bin PROPERTIES OUTPUT_NAME kvazaar)
set_target_properties(kvazaar-bin PROPERTIES RUNTIME_OUTPUT_NAME kvazaar)

target_link_libraries(kvazaar-bin PUBLIC kvazaar)
target_link_libraries(kvazaar-bin PUBLIC kvazaar)
endif()

if(MSVC)
target_include_directories(kvazaar PUBLIC src/threadwrapper/include)
set_property( SOURCE ${LIB_SOURCES_STRATEGIES_AVX2} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" )
else()
set_target_properties(kvazaar-bin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src)
if(BUILD_KVAZAAR_BINARY)
set_target_properties(kvazaar-bin PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src)
endif()
set_target_properties(kvazaar PROPERTIES SOVERSION "7" VERSION "7.4.0")
list(APPEND ALLOW_AVX2 "x86_64" "AMD64")
if(${CMAKE_SYSTEM_PROCESSOR} IN_LIST ALLOW_AVX2)
Expand Down Expand Up @@ -256,7 +262,9 @@ else()
endif ()

target_link_libraries(kvazaar PUBLIC ${EXTRA_LIBS})
target_link_libraries(kvazaar-bin PUBLIC ${EXTRA_LIBS} )
if(BUILD_KVAZAAR_BINARY)
target_link_libraries(kvazaar-bin PUBLIC ${EXTRA_LIBS} )
endif()
endif()


Expand Down Expand Up @@ -308,7 +316,9 @@ source_group( "" FILES ${SOURCE_GROUP_TOPLEVEL})
install(CODE "configure_file(\"${PROJECT_SOURCE_DIR}/src/kvazaar.pc.temp\" \"${PROJECT_SOURCE_DIR}/src/kvazaar.pc\" @ONLY)")

install(FILES ${PROJECT_SOURCE_DIR}/src/kvazaar.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(TARGETS kvazaar-bin DESTINATION ${CMAKE_INSTALL_BINDIR})
if(BUILD_KVAZAAR_BINARY)
install(TARGETS kvazaar-bin DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
install(TARGETS kvazaar
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down
Loading