I'm a beginner in Cmake and try to compile a library with my makefile. After hours and hours of research, all is good and compiles fines in visual studio. But it stills a problem for ouput folders. I explain.
I want to have this structure of folders at the end :
-vc_2013_x64 < for platform x64 in release
--bin
---my.dll, my.lib, ...
-vc_2013_x64d < for platform x64 in debug
--bin
---my.dll, my.lib, ...
But when i try to make this tree, CMake add some "release" and "debug" folders after my bin folder. Like this following example :
-vc_2013_x64
--bin
*---release* --> NOT WANTED FOLDER
----my.dll, my.lib, ...
How i can fix it ? or try to overide like this maybe :
-release
--vc_2013_x64
---bin
----my.dll, my.lib, ...
I've search on web but have not find any answer.
Here is my CMakeLists.txt file :
cmake_minimum_required(VERSION 2.8)
#Configuration du projet
project(core CXX)
#add definitions
set(LIBRARY_OUTPUT_PATH /vc2013_x64/bin/)
set(LIBRARY_OUTPUT_DIRECTORY ../essai)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
add_definitions(-D_UNICODE -D_USRDLL -DCORE_EXPORTS)
add_definitions("/Gm")#"/GL" "/Gy"
#remove_definitions
add_definitions(-UCMAKE_INTDIR="Release")
#inclusions
#include_directories(include/*)
#file( GLOB_RECURSE source_files src/*)
#Configuration de la librairie
add_library(
core
SHARED
src/asserts.h
src/errors.h
src/filepath.h
src/memory.h
src/resources.h
src/stdafx.h
src/streams.h
src/string.h
src/system.h
src/variants.h
src/filepath.cpp
src/main.cpp
src/memory.cpp
src/resources.cpp
src/stdafx.cpp
src/streams.cpp
src/string.cpp
src/system.cpp
)
And here is my structure folder :
-core
--src -> contains my .h and .cpp files
--win32 -> solution files of visual studios
--cmake_build -> contains my files generated by cmake
--CMakeLists.txt
Thanks
Edit :
So i try to make something like you say, but it doesn't create folder i specifiy :
project(core CXX)
#add definitions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
add_definitions(-D_UNICODE -D_USRDLL -DCORE_EXPORTS)
add_definitions("/Gm")#"/GL" "/Gy"
#remove_definitions
add_definitions(-UCMAKE_INTDIR="Release")
#Configuration de la librairie
add_library(
core
SHARED
src/asserts.h
src/errors.h
src/filepath.h
src/memory.h
src/resources.h
src/stdafx.h
src/streams.h
src/string.h
src/system.h
src/variants.h
src/filepath.cpp
src/main.cpp
src/memory.cpp
src/resources.cpp
src/stdafx.cpp
src/streams.cpp
src/string.cpp
src/system.cpp
)
set(DIR_NAME "/vc2013_x64")
set(LIBRARY_OUTPUT_PATH_RELEASE "${DIR_NAME}/bin")
set(LIBRARY_OUTPUT_PATH_DEBUG "${DIR_NAME}d/bin")
install (TARGETS core DESTINATION ${LIBRARY_OUTPUT_PATH_RELEASE} CONFIGURATIONS Release)
install (TARGETS core DESTINATION ${LIBRARY_OUTPUT_PATH_DEBUG})