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

add kmeansiou to build targets #8831

Merged
merged 3 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
build also kmeansiou with cmake
  • Loading branch information
cenit committed Aug 25, 2023
commit 09cd14d825ad60142f4114c7389d0e39144ace66
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ set(INSTALL_LIB_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Path where lib
set(INSTALL_INCLUDE_DIR "include/darknet" CACHE PATH "Path where headers will be installed")
set(INSTALL_CMAKE_DIR "share/darknet" CACHE PATH "Path where cmake configs will be installed")

find_library(MATH_LIBRARY m)

if(ENABLE_CUDA)
include(CheckLanguage)
check_language(CUDA)
Expand Down Expand Up @@ -453,6 +455,11 @@ if(BUILD_AS_CPP)
set_target_properties(darknet PROPERTIES LINKER_LANGUAGE CXX)
endif()

add_executable(kmeansiou ${CMAKE_CURRENT_LIST_DIR}/scripts/kmeansiou.c)
if(MATH_LIBRARY)
target_link_libraries(kmeansiou PRIVATE ${MATH_LIBRARY})
endif()

target_include_directories(darknet PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
target_include_directories(dark PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
target_include_directories(uselib PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src> $<INSTALL_INTERFACE:${INSTALL_INCLUDE_DIR}> $<BUILD_INTERFACE:${Stb_INCLUDE_DIR}>)
Expand Down Expand Up @@ -492,9 +499,9 @@ if(OPENMP_FOUND)
target_link_libraries(dark PUBLIC OpenMP::OpenMP_C)
endif()

if(CMAKE_COMPILER_IS_GNUCC)
target_link_libraries(darknet PRIVATE m)
target_link_libraries(dark PUBLIC m)
if(CMAKE_COMPILER_IS_GNUCC AND MATH_LIBRARY)
target_link_libraries(darknet PRIVATE ${MATH_LIBRARY})
target_link_libraries(dark PUBLIC ${MATH_LIBRARY})
endif()

if(MSVC)
Expand Down
13 changes: 2 additions & 11 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
build
Created By: Stefano Sinigardi
Created Date: February 18, 2019
Last Modified Date: August 1, 2023
Last Modified Date: August 10, 2023

.DESCRIPTION
Build tool using CMake, trying to properly setup the environment around compiler
Expand Down Expand Up @@ -189,7 +189,7 @@ param (

$global:DisableInteractive = $DisableInteractive

$build_ps1_version = "3.4.0"
$build_ps1_version = "3.4.1"
$script_name = $MyInvocation.MyCommand.Name

Import-Module -Name $PSScriptRoot/scripts/utils.psm1 -Force
Expand Down Expand Up @@ -729,15 +729,6 @@ if (($null -eq $vcpkg_path) -and $UseVCPKG) {
Write-Host "Found vcpkg in $PWD/vcpkg${VCPKGSuffix}: $vcpkg_path"
$AdditionalBuildSetup = $AdditionalBuildSetup + " -DENABLE_VCPKG_INTEGRATION:BOOL=ON"
}
else {
if (-not ($VCPKGSuffix -eq "")) {
MyThrow("Unable to find vcpkg${VCPKGSuffix}")
}
else {
Write-Host "Skipping vcpkg integration`n" -ForegroundColor Yellow
$AdditionalBuildSetup = $AdditionalBuildSetup + " -DENABLE_VCPKG_INTEGRATION:BOOL=OFF"
}
}

$vcpkg_branch_set_by_this_script = $false

Expand Down
9 changes: 4 additions & 5 deletions scripts/utils.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ function getLatestVisualStudioWithDesktopWorkloadPath([bool]$required = $true) {
$installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash
}
if (!$installationPath) {
Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also partial installations" -ForegroundColor Yellow
#Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also partial installations" -ForegroundColor Yellow
$output = & $vswhereExe -products * -latest -format xml
[xml]$asXml = $output
foreach ($instance in $asXml.instances.instance) {
$installationPath = $instance.InstallationPath -replace "\\$" # Remove potential trailing backslash
}
}
if (!$installationPath) {
Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also pre-release installations" -ForegroundColor Yellow
#Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also pre-release installations" -ForegroundColor Yellow
$output = & $vswhereExe -prerelease -products * -latest -format xml
[xml]$asXml = $output
foreach ($instance in $asXml.instances.instance) {
Expand Down Expand Up @@ -130,15 +130,15 @@ function getLatestVisualStudioWithDesktopWorkloadVersion([bool]$required = $true
$installationVersion = $instance.InstallationVersion
}
if (!$installationVersion) {
Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also partial installations" -ForegroundColor Yellow
#Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also partial installations" -ForegroundColor Yellow
$output = & $vswhereExe -products * -latest -format xml
[xml]$asXml = $output
foreach ($instance in $asXml.instances.instance) {
$installationVersion = $instance.installationVersion
}
}
if (!$installationVersion) {
Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also pre-release installations" -ForegroundColor Yellow
#Write-Host "Warning: no full Visual Studio setup has been found, extending search to include also pre-release installations" -ForegroundColor Yellow
$output = & $vswhereExe -prerelease -products * -latest -format xml
[xml]$asXml = $output
foreach ($instance in $asXml.instances.instance) {
Expand Down Expand Up @@ -340,4 +340,3 @@ Export-ModuleMember -Function DownloadNinja
Export-ModuleMember -Function DownloadAria2
Export-ModuleMember -Function Download7Zip
Export-ModuleMember -Function MyThrow
Export-ModuleMember -Function CopyTexFile