Hi all , I was trying to build my .cpp file in windows in Windows platform (windows 10) using cmake . My .cpp file makes use of two external libraries 1)armadillo 2)libsnd file. I have written a corresponding cmakelist.txt to compile and obtain the binary . I was successful in doing so in Linux , when it come to Windows I obtain the following error .
*3>Time Elapsed 00:00:02.062> Current branch master is up to date.2> No patch step for 'project_libsndfile'2> Performing autogen step for 'project_libsndfile'2> Performing configure step for 'project_libsndfile'2> 'C:\Users\computing7\Desktop\TSM_cmake\build\lib\libsndfile\src\project_libsndfile\configure' is not recognized as an internal or external command,2> operable program or batch file.2> 1>2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 9009.2> Done executing task "CustomBuild" -- FAILED.2> 1>2>Done building target "CustomBuild" in project "project_libsndfile.vcxproj" -- FAILED.2>2>Build FAILED.* PFA of the cmakelist.txt in case for clarifications. Why does this error come ? Is it possible to compile and build libsndfile in windows successfully ? -- Regards, Aishwarya Selvaraj
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(TSM2) include(ExternalProject) MESSAGE(STATUS "Trying to install armadillo...") ExternalProject_Add(armadillo URL https://github.com/lsolanka/armadillo/archive/master.zip PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo_library CONFIGURE_COMMAND "" #--Build step----------------- BUILD_COMMAND "" #--Install step--------------- UPDATE_COMMAND "" # Skip annoying updates for every build INSTALL_COMMAND "" ) include_directories(${CMAKE_CURRENT_BINARY_DIR}/armadillo_library/src/armadillo/include) include(ExternalProject) MESSAGE(STATUS "Trying to install libsndfile...") ExternalProject_Add(project_libsndfile GIT_REPOSITORY https://github.com/erikd/libsndfile.git PREFIX lib/libsndfile CONFIGURE_COMMAND <SOURCE_DIR>/configure BUILD_COMMAND make BUILD_IN_SOURCE 1 INSTALL_COMMAND echo Skipping install step for libsndfile ) ExternalProject_Add_Step(project_libsndfile autogen COMMAND <SOURCE_DIR>/autogen.sh DEPENDEES update DEPENDERS configure ) ExternalProject_Get_Property(project_libsndfile BINARY_DIR) SET(libsndfile_lib_dir "${BINARY_DIR}/src/.libs") SET(libsndfile_inc_dir "${BINARY_DIR}/src") ADD_LIBRARY(libsndfile STATIC IMPORTED) SET_PROPERTY(TARGET libsndfile PROPERTY IMPORTED_LOCATION ${libsndfile_lib_dir}/libsndfile.a) SET(LIBSNDFILE_INCLUDE_PATH "${install_dir}/src/project_libsndfile-build/src/") INCLUDE_DIRECTORIES(include ${libsndfile_inc_dir}) ADD_EXECUTABLE(tsm ${PROJECT_SOURCE_DIR}/src/TSM_CODE_V3.cpp) TARGET_LINK_LIBRARIES(tsm ${ARMADILLO} libsndfile )
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake