Skip to content

Commit

Permalink
use GNUInstallDirs to figure out lib vs. lib64 on different Linux fla…
Browse files Browse the repository at this point in the history
…vors
  • Loading branch information
marcdegraef committed Nov 19, 2021
1 parent 32dfd43 commit 564dedf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/nlopt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ set(extProjectName "nlopt")
set(NLopt_VERSION "2.7.0")
message(STATUS "Building: ${extProjectName} ${NLopt_VERSION}: -DBUILD_NLOPT=${BUILD_NLOPT}" )

# This is need to figure out the proper install dir for some Linux distributions
include(GNUInstallDirs)

if(MSVC_IDE)
set(nlopt_INSTALL "${EMsoft_SDK}/${extProjectName}-${NLopt_VERSION}")
elseif(WIN32)
Expand Down Expand Up @@ -80,7 +83,7 @@ if(APPLE)
elseif(WIN32)
FILE(APPEND ${EMsoft_SDK_FILE} "set(NLopt_DIR \"\${EMsoft_SDK_ROOT}/${extProjectName}-${NLopt_VERSION}/lib/cmake/${extProjectName}\" CACHE PATH \"\")\n")
else()
FILE(APPEND ${EMsoft_SDK_FILE} "set(NLopt_DIR \"\${EMsoft_SDK_ROOT}/${extProjectName}-${NLopt_VERSION}-\${BUILD_TYPE}/lib64/cmake/${extProjectName}\" CACHE PATH \"\")\n")
FILE(APPEND ${EMsoft_SDK_FILE} "set(NLopt_DIR \"\${EMsoft_SDK_ROOT}/${extProjectName}-${NLopt_VERSION}-\${BUILD_TYPE}/${CMAKE_INSTALL_LIBDIR}/cmake/${extProjectName}\" CACHE PATH \"\")\n")
endif()
FILE(APPEND ${EMsoft_SDK_FILE} "set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH} \${NLopt_DIR})\n")
FILE(APPEND ${EMsoft_SDK_FILE} "set(NLopt_VERSION \"${NLopt_VERSION}\" CACHE STRING \"\")\n")

0 comments on commit 564dedf

Please sign in to comment.