How to specify CMAKE RUNTIME_OUTPUT_DIRECTORY correctly? -
i have following directory structure
cmake_test ├── bin ├── cmakelists.txt ├── src │ └── func.cxx └── subproj ├── cmakelists.txt └── src └── main.cxx
cmakelists.txt :
cmake_minimum_required(version 2.8) project(main) set(cmake_runtime_output_directory ${cmake_home_directory}/bin/) set(cmake_library_output_directory ${cmake_home_directory}/bin/lib/) set(cmake_cxx_flags_debug "-std=c++11 -wall -g3 -o0") set(cmake_cxx_flags "-std=c++11 -wall -wextra") set(meta_src_dir ${cmake_home_directory}/src) aux_source_directory(${meta_src_dir}/ meta_src_list) add_subdirectory(subproj)
subproj/cmakelists.txt :
cmake_minimum_required(version 2.8) project(subproj) aux_source_directory(${project_source_dir}/src src_list) #include_directories(${project_source_dir}/include) add_executable(${project_name} ${src_list})
when build project (cd bin; cmake ..; make
) face following error:
scanning dependencies of target subproj [ 50%] building cxx object subproj/cmakefiles/subproj.dir/src/main.cxx.o [100%] linking cxx executable . /usr/bin/ld: cannot open output file .: directory collect2: error: ld returned 1 exit status subproj/cmakefiles/subproj.dir/build.make:94: recipe target 'subproj' failed make[2]: *** [subproj] error 1 cmakefiles/makefile2:85: recipe target 'subproj/cmakefiles/subproj.dir/all' failed make[1]: *** [subproj/cmakefiles/subproj.dir/all] error 2 makefile:83: recipe target 'all' failed make: *** [all] error 2
how fix it?
Comments
Post a Comment