Search Results

Search found 175 results on 7 pages for 'cmake'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • CMake: Mac OS X: ld: unknown option: -soname

    - by Alex Ivasyuv
    I try to build my app with CMake on Mac OS X, I get the following error: Linking CXX shared library libsml.so ld: unknown option: -soname collect2: ld returned 1 exit status make[2]: *** [libsml.so] Error 1 make[1]: *** [CMakeFiles/sml.dir/all] Error 2 make: *** [all] Error 2 This is strange, as Mac has .dylib extension instead of .so. There's my CMakeLists.txt: cmake_minimum_required(VERSION 2.6) PROJECT (SilentMedia) SET(SourcePath src/libsml) IF (DEFINED OSS) SET(OSS_src ${SourcePath}/Media/Audio/SoundSystem/OSS/DSP/DSP.cpp ${SourcePath}/Media/Audio/SoundSystem/OSS/Mixer/Mixer.cpp ) ENDIF(DEFINED OSS) IF (DEFINED ALSA) SET(ALSA_src ${SourcePath}/Media/Audio/SoundSystem/ALSA/DSP/DSP.cpp ${SourcePath}/Media/Audio/SoundSystem/ALSA/Mixer/Mixer.cpp ) ENDIF(DEFINED ALSA) SET(SilentMedia_src ${SourcePath}/Utils/Base64/Base64.cpp ${SourcePath}/Utils/String/String.cpp ${SourcePath}/Utils/Random/Random.cpp ${SourcePath}/Media/Container/FileLoader.cpp ${SourcePath}/Media/Container/OGG/OGG.cpp ${SourcePath}/Media/PlayList/XSPF/XSPF.cpp ${SourcePath}/Media/PlayList/XSPF/libXSPF.cpp ${SourcePath}/Media/PlayList/PlayList.cpp ${OSS_src} ${ALSA_src} ${SourcePath}/Media/Audio/Audio.cpp ${SourcePath}/Media/Audio/AudioInfo.cpp ${SourcePath}/Media/Audio/AudioProxy.cpp ${SourcePath}/Media/Audio/SoundSystem/SoundSystem.cpp ${SourcePath}/Media/Audio/SoundSystem/libao/AO.cpp ${SourcePath}/Media/Audio/Codec/WAV/WAV.cpp ${SourcePath}/Media/Audio/Codec/Vorbis/Vorbis.cpp ${SourcePath}/Media/Audio/Codec/WavPack/WavPack.cpp ${SourcePath}/Media/Audio/Codec/FLAC/FLAC.cpp ) SET(SilentMedia_LINKED_LIBRARY sml vorbisfile FLAC++ wavpack ao #asound boost_thread-mt boost_filesystem-mt xspf gtest ) INCLUDE_DIRECTORIES( /usr/include /usr/local/include /usr/include/c++/4.4 /Users/alex/Downloads/boost_1_45_0 ${SilentMedia_SOURCE_DIR}/src ${SilentMedia_SOURCE_DIR}/${SourcePath} ) #link_directories( # /usr/lib # /usr/local/lib # /Users/alex/Downloads/boost_1_45_0/stage/lib #) IF(LibraryType STREQUAL "static") ADD_LIBRARY(sml-static STATIC ${SilentMedia_src}) # rename library from libsml-static.a => libsml.a SET_TARGET_PROPERTIES(sml-static PROPERTIES OUTPUT_NAME "sml") SET_TARGET_PROPERTIES(sml-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) ELSEIF(LibraryType STREQUAL "shared") ADD_LIBRARY(sml SHARED ${SilentMedia_src}) # change compile optimization/debug flags # -Werror -pedantic IF(BuildType STREQUAL "Debug") SET_TARGET_PROPERTIES(sml PROPERTIES COMPILE_FLAGS "-pipe -Wall -W -ggdb") ELSEIF(BuildType STREQUAL "Release") SET_TARGET_PROPERTIES(sml PROPERTIES COMPILE_FLAGS "-pipe -Wall -W -O3 -fomit-frame-pointer") ENDIF() SET_TARGET_PROPERTIES(sml PROPERTIES CLEAN_DIRECT_OUTPUT 1) ENDIF() ### TEST ### IF(Test STREQUAL "true") ADD_EXECUTABLE (bin/TestXSPF ${SourcePath}/Test/Media/PlayLists/XSPF/TestXSPF.cpp) TARGET_LINK_LIBRARIES (bin/TestXSPF ${SilentMedia_LINKED_LIBRARY}) ADD_EXECUTABLE (bin/test1 ${SourcePath}/Test/test.cpp) TARGET_LINK_LIBRARIES (bin/test1 ${SilentMedia_LINKED_LIBRARY}) ADD_EXECUTABLE (bin/TestFileLoader ${SourcePath}/Test/Media/Container/FileLoader/TestFileLoader.cpp) TARGET_LINK_LIBRARIES (bin/TestFileLoader ${SilentMedia_LINKED_LIBRARY}) ADD_EXECUTABLE (bin/testMixer ${SourcePath}/Test/testMixer.cpp) TARGET_LINK_LIBRARIES (bin/testMixer ${SilentMedia_LINKED_LIBRARY}) ENDIF (Test STREQUAL "true") ### TEST ### ADD_CUSTOM_TARGET(doc COMMAND doxygen ${SilentMedia_SOURCE_DIR}/doc/Doxyfile) There was no error on Linux. Build process: cmake -D BuildType=Debug -D LibraryType=shared . make I found, that incorrect command generate in CMakeFiles/sml.dir/link.txt. But why, as the goal of CMake is cross-platforming.. How to fix it?

    Read the article

  • How can I get cmake to find my boost installation

    - by BD at Rivenhill
    I have installed the most recent version of boost in /usr/local (with includes in /usr/local/boost and libraries in /usr/local/lib/boost) and I am now attempting to install Wt from source, but cmake (version 2.6) can't seem to find the boost installation. It tries to give helpful suggestions about setting BOOST_DIR and Boost_LIBRARYDIR, but I haven't been able to get it to work by tweaking these variables. The most recent error message that I get is that it can't find the libraries, but it seems to indicate that it is using "/usr/local/include" for the include path, which isn't correct (and I can't seem to fix it). Does anybody have a solution for this off the top of their head, or do I need to go mucking around inside cmake to figure it out?

    Read the article

  • Are CMake GLOB and source_group compatible?

    - by jwfearn
    I'm using CMake 2.8.0 (on Windows) with the "Visual Studio 10 Win64" generator. GLOB and source_group don't seem to work together. Is there a way to get this to work? I use file( GLOB ... ) to create a list of .cpp files and then use source_group to create a filter in the generated Visual Studio project: # C:\Users\My Name\hello\CMakeLists.txt cmake_minimum_required( VERSION 2.8 ) project( hello_proj ) file( GLOB HELLO_SRCS *.cpp ) message( "HELLO_SRCS="${HELLO_SRCS} ) #source_group( hello_group ${HELLO_SRCS} ) #line 6: uncomment to get error add_executable( hello_exec ${HELLO_SRCS} ) with line 6 commented out, the project is generated fine: HELLO_SRCS=C:/Users/My Name/hello/hello.cppC:/Users/My Name/hello/print_line.cpp -- Configuring done -- Generating done -- Build files have been written to: C:/Users/My Name/hello with line 6 un-commented, I get an error: HELLO_SRCS=C:/Users/My Name/hello/hello.cppC:/Users/My Name/hello/print_line.cpp CMake Error at CMakeLists.txt:6 (source_group): source_group Unknown argument "C:/Users/My Name/hello/hello.cpp". Perhaps the FILES keyword is missing. -- Configuring incomplete, errors occurred! I notice that output value of ${HELLO_SRCS} does not seem to contain any delimiters between the file names, nor does it have quotes or other delimiters wrapping the file names which contain spaces. Does that have anything to do with my problem? Renaming all directories to avoid spaces is not really an option.

    Read the article

  • CMake add_custom_command not being run

    - by Jonathan Sternberg
    I'm trying to use add_custom_command to generate a file during the build. The command never seemed to be run, so I made this test file. cmake_minimum_required( VERSION 2.6 ) add_custom_command( OUTPUT hello.txt COMMAND touch hello.txt DEPENDS hello.txt ) I tried running: cmake . make And hello.txt was not generated. What have I done wrong?

    Read the article

  • cmake source and out-of-source navigation

    - by idimba
    Hi, cmake advises to use out-of-source builds. While in general I like the idea I find it not comfortable to navigate from out-of-source sub directory to the corresponding source directory. I frequently need the code to perform some actions with code (e.g. grep, svn command etc.). Is there an easy way in shell to navigate from out-of-source sub directory to the corresponding source directory? Thanks Dima

    Read the article

  • cmake dependency

    - by idimba
    I'm trying to create a cmake equivalent to the following make: all: run_demo demo: main.cpp gcc -o demo main.cpp run_demo: demo demo is executed whenever demo is created. This what I came to, but demo is not executed as I want: add_executable(demo main.cpp) add_custom_target(run_demo demo) This is actually equivalent to: all: demo demo: main.cpp gcc -o demo main.cpp run_demo:demo What do I miss?

    Read the article

  • CMake: add static library to shared lib

    - by redvarib
    I would like to create shared library with cmake, but also I need to link it to third party static libraries. For example if it should include my own file1.o, file2.o, then statically linked libfoo.la and then be written down to disk as .so file which dynamically linked to libbar.so Is it even possible?

    Read the article

  • Trying to link my project with Boost.Thread using CMake

    - by wowus
    When I link Boost.Thread to my boost_test executable, it gives me make[2]: *** No rule to make target `/usr/lib64/libboost_thread-mt.so', needed by `gogo/test/test_boost'. Stop. when I make it. Here's the offending CMake code, what am I doing wrong? add_executable(boost_test boost_test.cpp) add_test(boost_test boost_test) # Boost auto-links for MSVC, so we exclude it. if(CMAKE_COMPILER_IS_GNUCXX) target_link_libraries(test_boost #LINK_INTERFACE_LIBRARIES ${Boost_THREAD_LIBRARY} ) endif()

    Read the article

  • Automatically rebuild external cmake project after edit_cache

    - by arunkd13
    I have a main cmake project which has a PROJECT_INCLUDE_PATH which is a cached variable. I pass this variable as a CMAKE_ARGS parameter to an external project that I add using ExternalProject_Add(). The problem is, when I change the value of the PROJECT_INCLUDE_PATH using 'make edit_cache' the external project is not reconfigured. Is there any way make the external project to be reconfigured and built automatically when the cached variable is changed in the main project?

    Read the article

  • sudo port install cmake trouble (for MGTwitterEngine)

    - by RexOnRoids
    I am following This Tutorial on installing MGTwitterEngine on my MAC osx 10.6.2. I am stuck on this step: sudo port install cmake it gives me the following error: dlopen(/opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib, 10): no suitable image found. Did find: /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib: no matching architecture in universal wrapper while executing "load /opt/local/share/macports/Tcl/pextlib1.0/Pextlib.dylib" ("package ifneeded Pextlib 1.0" script) invoked from within "package require Pextlib 1.0" (file "/opt/local/bin/port" line 40) Rex-MacBook-Pro:~ Rex$ Thus, I cannot use TERMINAL to install YAJL to get my app to build. Help needed. P.S. In terminal preferences, Shells Open With is either /usr/bin/login or /bin/bash YAJL is supposedly installed at /Users/Rex I am using OSX 10.6.2

    Read the article

  • Linking C and CXX files in CMake

    - by vedro so snegom
    Hi I'm building C++ app with CMake. But it uses some source files in C. Here is simplified structure: trunk/CMakeLists.txt: project(myapp) set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g -Wall") add_subdirectory (src myapp) trunk/src/main.cpp: #include "smth/f.h" int main() { f(); } trunk/src/CMakeLists.txt: add_subdirectory (smth) link_directories (smth) set(APP_SRC main) add_executable (myapp ${APP_SRC}) target_link_libraries (myapp smth) trunk/src/smth/f.h: #ifndef F_H #define F_H void f(); #endif trunk/src/smth/f.c: #include "f.h" void f() {} trunk/src/smth/CMakeLists.txt set (SMTH_SRC some_cpp_file1 some_cpp_file2 f) add_library (smth STATIC ${SMTH_SRC}) The problem is: i run gmake, it compiles all the files and when it links all libs together, i get: undefined reference to `f()` in main.cpp if i rename f.c into f.cpp everything goes just fine. What's the difference and how to handle it? Thanks

    Read the article

  • FLTK Images (Using Cmake)

    - by Cenoc
    I'm trying to load and manipulate a jpeg file using FLTK compiled using cmake... but I get the following errors: 2LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_read_scanlines referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_start_decompress referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_calc_output_dimensions referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_read_header referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_stdio_src referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_CreateDecompress referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_destroy_decompress referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) 2fltkimages.lib(Fl_JPEG_Image.obj) : error LNK2019: unresolved external symbol _jpeg_finish_decompress referenced in function "public: __thiscall Fl_JPEG_Image::Fl_JPEG_Image(char const *)" (??0Fl_JPEG_Image@@QAE@PBD@Z) I hate these linking errors..... can anyone help? Thank you in advance.

    Read the article

  • How do I view the CMake command line statement that Qt Creator executes?

    - by Evan
    I'm attempting to debug a command line CMake failure. The same CMake file works in Qt Creator, with the arguments in the Qt Creator window matching what I have entered on the command line. This makes me think Qt Creator is adding some extra arguments, which makes sense since the generator drop down has several options that specify architecture and CMake version. Is there a way to get the CMake command that Qt Creator executed to produce the desired result, specifically the arguments passed to the CMake executable? I found one post that talks about viewing the CMakeCache files to do some forensics, but this only proves there are differences, it doesn't quickly show me what arguments to change.

    Read the article

  • cmake add_library at a custom location

    - by celil
    I need to build a library that is to be placed at a custom location stored in the variable CUSTOM_OUTDIR. Currently, I am using the following code to make sure that the library is copied to its proper location. ADD_LIBRARY(example MODULE example.c) GET_TARGET_PROPERTY(FILEPATH example LOCATION) ADD_CUSTOM_COMMAND( TARGET example POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${FILEPATH} ${CUSTOM_OUTDIR} ) However, this is not a good solution as the copying is done post_build, and I end up with two copies of the library. Is there a way to setup CMAKE_BINARY_DIR just for the example library so that only one copy of it is kept in the proper location?

    Read the article

  • In CMake, how does CHECK_INCLUDE_FILE_CXX work?

    - by Neil G
    The following code prints nothing CHECK_INCLUDE_FILE_CXX(glog/logging.h GLOG_INCLUDE) IF(GLOG_INCLUDE) MESSAGE("YY") ENDIF(GLOG_INCLUDE) But I have the following environment variable set: export CPLUS_INCLUDE_PATH=/usr/local/include And, "ls /usr/local/include/glog/logging.h" returns the file. I tried using include_directories( "/usr/local/include" ) but it doesn't work either.

    Read the article

  • Using CMake with Eclipse CDT, quickly switch targets?

    - by Cheezmeister
    I'm using the CDT4 - MinGW Makefiles generator. Project-Build All successfully builds the target (a shared library) but it seems I would have to (A) open a project settings page and type in the target, hoping it's spelled right*, or (B) run make from a terminal to "build" the install and package targets. I noticed a promising Project-Make Target entry, but the Create... and Build... sub-entries are greyed-out. Any hints would be appreciated! *http://publib.boulder.ibm.com/infocenter/rsdhelp/v7r0m0/topic/org.eclipse.cdt.doc.user/concepts/cdt_c_build_over.htm

    Read the article

  • CMake with include and source paths - basic setup

    - by user912403
    I'm trying to set up a test project looking like my own project just to get things working first and it looks like this: /MainProject/inc/main.h /MainProject/src/main.cpp /LibProject/inc/test.h /LibProject/src/test.cpp I've found some tutorials, but I cant find out how to set up this when I have the inc and src folder? How would the CMakeLists.txt files look? Would I have one in /, one in each of the project folders? It seems like I dont need to have one in the inc and src folders?

    Read the article

  • How to add an extra plist property using CMake?

    - by Jesse Beder
    I'm trying to add the item <key>UIStatusBarHidden</key><true/> to my plist that's auto-generated by CMake. For certain keys, it appears there are pre-defined ways to add an item; for example: set(MACOSX_BUNDLE_ICON_FILE ${ICON}) But I can't find a way to add an arbitrary property. I tried using the MACOSX_BUNDLE_INFO_PLIST target property as follows: I'd like the resulting plist to be identical to the old one, except with the new property I want, so I just copied the auto-generated plist and set that as my template. But the plist uses some Xcode variables, which also look like ${foo}, and CMake grumbles about this: Syntax error in cmake code when parsing string <string>com.bedaire.${PRODUCT_NAME:identifier}</string> syntax error, unexpected cal_SYMBOL, expecting } (47) Policy CMP0010 is not set: Bad variable reference syntax is an error. Run "cmake --help-policy CMP0010" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. In any case, I'm not even sure that this is the right thing to do. I can't find a good example or any good documentation about this. Ideally, I'd just let CMake generate everything as before, and just add a single extra line. What can I do?

    Read the article

  • How to let CMake to know the library is in some directory?

    - by prosseek
    I have a library in c:\cppunit\lib, and a header files in c:\cppunit\include. I come up with this cmake file to build with the library. How to let CMake to know the library is in c:/cppunit/lib? PROJECT( cppunitest ) INCLUDE_DIRECTORIES( "c:/cppunit/include" ) ??? How to let CMake to know the library is in c:/cppunit/lib SET( cppunitest_SRC main.cpp testset.cpp complex.cpp ) LINK_LIBRARIES(cppunit) ADD_EXECUTABLE( cpptest ${cppunitest_SRC})

    Read the article

  • Build automation: Is it usual to use QMake for non-Qt projects?

    - by Raphael
    So, I'm planning to write a C++ library and I want it to be cross-platform, and as this library won't deal with UI and I want it to have as little dependencies as possible, I won't be using Qt (actually Qt won't really help me to achieve what I want, all I plan on using is STL and Boost). Now when it comes to build a cross-platform project, I really like QMake as it's extremely easy to use and I have experience with it. I also heard good things about CMake, though I really doubt it's as easy to use as QMake. Anyway, here is my question: Should I stick with build automation tool that I know or is QMake just out of context for a non-Qt project? Should I take this as an opportunity to learn CMake? Or is there a better alternative to these two?

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >