Author: brane Date: Mon May 26 07:54:58 2025 New Revision: 1925807 URL: http://svn.apache.org/viewvc?rev=1925807&view=rev Log: Fix CMake debug/release build selection and the generated pkg-config file.
* CMakeLists.txt: CMAKE_BUILD_TYPE is a string, so look at its value instead of messing with its name, which doesn't work. Force any new value into the cache, because there's already an empty default there which we want to override. Without the FORCE, changes have no effect. (make_pkgconfig): Add the apr and apr-util LDFLAGS to serf.pc. Modified: serf/trunk/CMakeLists.txt Modified: serf/trunk/CMakeLists.txt URL: http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1925807&r1=1925806&r2=1925807&view=diff ============================================================================== --- serf/trunk/CMakeLists.txt (original) +++ serf/trunk/CMakeLists.txt Mon May 26 07:54:58 2025 @@ -82,11 +82,11 @@ if(USE_HOMEBREW AND USE_MACPORTS) endif() # Initialize the build type if it was not set on the command line. -if(NOT CMAKE_BUILD_TYPE) +if("${CMAKE_BUILD_TYPE}" STREQUAL "") if(DEBUG) - set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Default to debug build.") + set(CMAKE_BUILD_TYPE DEBUG CACHE STRING "Default to debug build." FORCE) else() - set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "Default to release build.") + set(CMAKE_BUILD_TYPE RELEASE CACHE STRING "Default to release build." FORCE) endif() endif() @@ -389,8 +389,10 @@ if(NOT SERF_WINDOWS) set(VERSION ${SERF_VERSION}) set(MAJOR ${SERF_MAJOR_VERSION}) set(SERF_INTERFACE_LIBS + ${APR_LDFLAGS} ${APR_LIBRARIES} ${APR_EXTRALIBS} + ${APRUTIL_LDFLAGS} ${APRUTIL_LIBRARIES} ${APRUTIL_EXTRALIBS} )